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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy