10000 Don't use "static const <type>", breaks on MSVC. · H4ckF0rFun/MemoryModule@d9dcc0e · GitHub
[go: up one dir, main page]

Skip to content

Commit d9dcc0e

Browse files
committed
Don't use "static const <type>", breaks on MSVC.
1 parent e2826eb commit d9dcc0e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

MemoryModule.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
#define IMAGE_SIZEOF_BASE_RELOCATION (sizeof(IMAGE_BASE_RELOCATION))
4949
#endif
5050

51+
#ifdef _WIN64
52+
#define HOST_MACHINE IMAGE_FILE_MACHINE_AMD64
53+
#else
54+
#define HOST_MACHINE IMAGE_FILE_MACHINE_I386
55+
#endif
56+
5157
#include "MemoryModule.h"
5258

5359
typedef BOOL (WINAPI *DllEntryProc)(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved);
@@ -525,11 +531,6 @@ HMEMORYMODULE MemoryLoadLibraryEx(const void *data, size_t size,
525531
return NULL;
526532
}
527533

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
533534
if (old_header->FileHeader.Machine != HOST_MACHINE) {
534535
SetLastError(ERROR_BAD_EXE_FORMAT);
535536
return NULL;

0 commit comments

Comments
 (0)
0