Index: base/file_version_info.h |
diff --git a/base/file_version_info.h b/base/file_version_info.h |
index 57b837c24b08e90c8a1b14ec4175160a7cea0d3e..8c1bf92438e7b0a849e06cd3eb8de25cb046ccd2 100644 |
--- a/base/file_version_info.h |
+++ b/base/file_version_info.h |
@@ -32,6 +32,17 @@ class FilePath; |
// version returns values from the Info.plist as appropriate. TODO(avi): make |
// this a less-obvious Windows-ism. |
+#if defined(OS_WIN) |
+// Creates a FileVersionInfo for the current module. Returns NULL in case of |
+// error. The returned object should be deleted when you are done with it. This |
+// is done as a macro to force inlining of __ImageBase. It used to be inside of |
+// a method labeled with __forceinline, but inlining through __forceinline |
+// stopped working for Debug builds in VS2013 (http://crbug.com/516359). |
+#define CREATE_FILE_VERSION_INFO_FOR_CURRENT_MODULE() \ |
+ FileVersionInfo::CreateFileVersionInfoForModule( \ |
+ reinterpret_cast<HMODULE>(&__ImageBase)) |
+#endif |
+ |
class BASE_EXPORT FileVersionInfo { |
public: |
virtual ~FileVersionInfo() {} |
@@ -46,17 +57,9 @@ class BASE_EXPORT FileVersionInfo { |
#if defined(OS_WIN) |
// Creates a FileVersionInfo for the specified module. Returns NULL in case |
// of error. The returned object should be deleted when you are done with it. |
+ // See CREATE_FILE_VERSION_INFO_FOR_CURRENT_MODULE() helper above for a |
+ // CreateFileVersionInfoForCurrentModule() alternative for Windows. |
static FileVersionInfo* CreateFileVersionInfoForModule(HMODULE module); |
- |
- // Creates a FileVersionInfo for the current module. Returns NULL in case |
- // of error. The returned object should be deleted when you are done with it. |
- // This function should be inlined so that the "current module" is evaluated |
- // correctly, instead of being the module that contains base. |
- __forceinline static FileVersionInfo* |
- CreateFileVersionInfoForCurrentModule() { |
- HMODULE module = reinterpret_cast<HMODULE>(&__ImageBase); |
- return CreateFileVersionInfoForModule(module); |
- } |
#else |
// Creates a FileVersionInfo for the current module. Returns NULL in case |
// of error. The returned object should be deleted when you are done with it. |