From 5ce3707c7d9d6f3dfcde8b848a96986ef2e6c5dd Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Tue, 20 Sep 2016 01:23:24 +0200 Subject: [PATCH] MSVC again - "static const" can not be used as array size. --- MemoryModule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MemoryModule.c b/MemoryModule.c index a032d52..7e6c1a5 100644 --- a/MemoryModule.c +++ b/MemoryModule.c @@ -835,7 +835,7 @@ static PIMAGE_RESOURCE_DIRECTORY_ENTRY _MemorySearchResourceEntry( #else // Resource names are always stored using 16bit characters, need to // convert string we search for. - static const size_t MAX_LOCAL_KEY_LENGTH = 2048; +#define MAX_LOCAL_KEY_LENGTH 2048 // In most cases resource names are short, so optimize for that by // using a pre-allocated array. wchar_t _searchKeySpace[MAX_LOCAL_KEY_LENGTH+1]; @@ -884,6 +884,7 @@ static PIMAGE_RESOURCE_DIRECTORY_ENTRY _MemorySearchResourceEntry( if (searchKeyLen > MAX_LOCAL_KEY_LENGTH) { free(_searchKey); } +#undef MAX_LOCAL_KEY_LENGTH #endif }