GeezerVison is showing github.com — Don't use "static const <type>", breaks on MSVC. · coderup2u/MemoryModule@d9dcc0e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: MemoryModule.c +6-5Lines changed: 6 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
48 | 48 | #define IMAGE_SIZEOF_BASE_RELOCATION (sizeof(IMAGE_BASE_RELOCATION)) |
49 | 49 | #endif |
50 | 50 |
|
| 51 | +#ifdef _WIN64 |
| 52 | +#define HOST_MACHINE IMAGE_FILE_MACHINE_AMD64 |
| 53 | +#else |
| 54 | +#define HOST_MACHINE IMAGE_FILE_MACHINE_I386 |
| 55 | +#endif |
| 56 | + |
51 | 57 | #include "MemoryModule.h" |
52 | 58 |
|
53 | 59 | typedef BOOL (WINAPI *DllEntryProc)(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved); |
@@ -525,11 +531,6 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size, |
525 | 531 | return NULL; |
526 | 532 | } |
527 | 533 |
|
528 | | -#ifdef _WIN64 |
529 | | - static const int HOST_MACHINE = IMAGE_FILE_MACHINE_AMD64; |
530 | | -#else |
531 | | - static const int HOST_MACHINE = IMAGE_FILE_MACHINE_I386; |
532 | | -#endif |
533 | 534 | if (old_header->FileHeader.Machine != HOST_MACHINE) { |
534 | 535 | SetLastError(ERROR_BAD_EXE_FORMAT); |
535 | 536 | return NULL; |
|