https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d564c7c8e33a3bc9579b1…
commit d564c7c8e33a3bc9579b1f5d7886ea2c4f589ffa
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Wed Sep 5 21:49:02 2018 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Fri Oct 12 19:30:35 2018 +0200
[SPEC2DEF] Fix support for different OS versions.
---
sdk/tools/spec2def/spec2def.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sdk/tools/spec2def/spec2def.c b/sdk/tools/spec2def/spec2def.c
index f5a91aa326..1246ce3ad3 100644
--- a/sdk/tools/spec2def/spec2def.c
+++ b/sdk/tools/spec2def/spec2def.c
@@ -4,7 +4,8 @@
#include <string.h>
#ifdef _MSC_VER
-#define strcasecmp _stricmp
+#define strcasecmp(_String1, _String2) _stricmp(_String1, _String2)
+#define strncasecmp(_String1, _String2, _MaxCount) _strnicmp(_String1, _String2,
_MaxCount)
#endif
#define ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0]))
@@ -1126,6 +1127,7 @@ int main(int argc, char *argv[])
{
size_t nFileSize;
char *pszSource, *pszDefFileName = NULL, *pszStubFileName = NULL, *pszLibStubName =
NULL;
+ const char* pszVersionOption = "--version=0x";
char achDllName[40];
FILE *file;
int result = 0, i;
@@ -1161,9 +1163,9 @@ int main(int argc, char *argv[])
{
pszDllName = argv[i] + 3;
}
- else if (strcasecmp(argv[i], "--version=0x") == 0)
+ else if (strncasecmp(argv[i], pszVersionOption, strlen(pszVersionOption)) == 0)
{
- guOsVersion = strtoul(argv[i] + sizeof("--version=0x"), NULL, 16);
+ guOsVersion = strtoul(argv[i] + strlen(pszVersionOption), NULL, 16);
}
else if (strcasecmp(argv[i], "--implib") == 0)
{