authorgravatar for linux@nebulae.onlinenebulaeonline <linux@nebulae.online> 2018-12-23 23:59:59-05:00
committergravatar for linux@nebulae.onlinenebulaeonline <linux@nebulae.online> 2018-12-23 23:59:59-05:00
log7dcee99510fe4d69faae67f3aa41cfb47a43045e
tree12caa988c5dcafbbf984debc0f21d7b69c07403b
parent51baea184bb2bcfb325caf3c5051118deadc319d

fixed stricmp/strcasecmp between windows/posix


1 files changed, 15 insertions(+), 8 deletions(-)

src/main.cpp+15-8
......@@ -16,6 +16,13 @@
1616
1717#include <stdio.h>
1818
19#ifdef __GNUC__
20#include <strings.h>
21#define STRCASECMP strcasecmp
22#else
23#define STRCASECMP stricmp
24#endif
25
1926static int print_error_usage(const char *arg0) {
2027 fprintf(stderr, "See `%s help` for detailed usage information\n", arg0);
2128 return EXIT_FAILURE;
......@@ -545,21 +552,21 @@ int main(int argc, char **argv) {
545552 return print_error_usage(arg0);
546553 }
547554 i += 1;
548 if (stricmp(argv[i], "CONSOLE") == 0) {
555 if (STRCASECMP(argv[i], "CONSOLE") == 0) {
549556 msvc_subsystem_type = ZigLLVM_MSVC_CONSOLE;
550 } else if (stricmp(argv[i], "WINDOWS") == 0) {
557 } else if (STRCASECMP(argv[i], "WINDOWS") == 0) {
551558 msvc_subsystem_type = ZigLLVM_MSVC_WINDOWS;
552 } else if (stricmp(argv[i], "POSIX") == 0) {
559 } else if (STRCASECMP(argv[i], "POSIX") == 0) {
553560 msvc_subsystem_type = ZigLLVM_MSVC_POSIX;
554 } else if (stricmp(argv[i], "NATIVE") == 0) {
561 } else if (STRCASECMP(argv[i], "NATIVE") == 0) {
555562 msvc_subsystem_type = ZigLLVM_MSVC_NATIVE;
556 } else if (stricmp(argv[i], "EFI_APPLICATION") == 0) {
563 } else if (STRCASECMP(argv[i], "EFI_APPLICATION") == 0) {
557564 msvc_subsystem_type = ZigLLVM_MSVC_EFI_APPLICATION;
558 } else if (stricmp(argv[i], "EFI_BOOT_SERVICE_DRIVER") == 0) {
565 } else if (STRCASECMP(argv[i], "EFI_BOOT_SERVICE_DRIVER") == 0) {
559566 msvc_subsystem_type = ZigLLVM_MSVC_EFI_BOOT_SERVICE_DRIVER;
560 } else if (stricmp(argv[i], "EFI_ROM") == 0) {
567 } else if (STRCASECMP(argv[i], "EFI_ROM") == 0) {
561568 msvc_subsystem_type = ZigLLVM_MSVC_EFI_ROM;
562 } else if (stricmp(argv[i], "EFI_RUNTIME_DRIVER") == 0) {
569 } else if (STRCASECMP(argv[i], "EFI_RUNTIME_DRIVER") == 0) {
563570 msvc_subsystem_type = ZigLLVM_MSVC_EFI_RUNTIME_DRIVER;
564571 } else {
565572 fprintf(stderr, "Unknown format %s for --msvc-subsystem argument\n", argv[i]);