MSVC again - "static const" can not be used as array size.

This commit is contained in:
Joachim Bauch
2016-09-20 01:23:24 +02:00
parent d9dcc0eb8c
commit 5ce3707c7d
+2 -1
View File
@@ -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
}