[KBDTOOL] - Fix build under MSVC

svn path=/trunk/; revision=54385
This commit is contained in:
Rafal Harabien 2011-11-15 11:07:31 +00:00
parent ba2815a03e
commit a61f0b9cff
2 changed files with 85 additions and 84 deletions

View file

@ -12,7 +12,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <time.h>
#include <typedefs.h>

View file

@ -61,18 +61,22 @@ INT
main(INT argc,
PCHAR* argv)
{
ULONG ErrorCode, FailureCode;
ULONG i, ErrorCode, FailureCode;
CHAR Option;
PCHAR OpenFlags;
CHAR BuildOptions[16] = {0};
/* Loop for parameter */
while (TRUE)
{
/* Get the options */
Option = getopt(argc, argv, "aAeEiIkKmMnNOosSuUvVwWxX?");
if (Option != -1)
for (i = 1; i < argc; ++i)
{
if (argv[i][0] != '/' && argv[i][0] != '-')
break;
if (argv[i][1] && !argv[i][2])
Option = argv[i][1];
else
Option = 0;
/* Check supported options */
switch (Option)
{
@ -80,79 +84,77 @@ main(INT argc,
case 'A':
case 'a':
UnicodeFile = 0;
continue;
break;
/* UNICODE File */
case 'U':
case 'u':
UnicodeFile = 1;
continue;
break;
/* Verbose */
case 'V':
case 'v':
Verbose = 1;
continue;
break;
/* No logo */
case 'N':
case 'n':
NoLogo = 1;
continue;
break;
/* Fallback driver */
case 'K':
case 'k':
FallbackDriver = 1;
continue;
break;
/* Sanity Check */
case 'W':
case 'w':
SanityCheck = 1;
continue;
break;
/* Itanium */
case 'I':
case 'i':
BuildType = 1;
continue;
break;
/* X86 */
case 'X':
case 'x':
BuildType = 0;
continue;
break;
/* AMD64 */
case 'M':
case 'm':
BuildType = 2;
continue;
break;
/* WOW64 */
case 'O':
case 'o':
BuildType = 3;
continue;
break;
/* Source only */
case 'S':
case 's':
SourceOnly = 1;
continue;
default:
break;
}
default:
/* If you got here, the options are invalid or missing */
PrintUsage();
}
break;
}
}
/* Do we have no options? */
if (optind == argc) PrintUsage();
if (i == argc) PrintUsage();
/* Should we announce ourselves? */
if (!NoLogo)
@ -163,7 +165,7 @@ main(INT argc,
}
/* Save the file name */
gpszFileName = argv[optind];
gpszFileName = argv[i];
/* Open either as binary or text */
OpenFlags = "rb";