cygwin1.c (132718) | cygwin1.c (146895) |
---|---|
1/* Helper routines for cygwin-specific command-line parsing. 2 Contributed by Christopher Faylor (cgf@redhat.com) 3 Copyright 2003 Free Software Foundation, Inc. 4 5This file is part of GCC. 6 7GCC is free software; you can redistribute it and/or modify 8it under the terms of the GNU General Public License as published by --- 16 unchanged lines hidden (view full) --- 25#include "tm.h" 26#include <string.h> 27 28void 29mingw_scan (int argc ATTRIBUTE_UNUSED, 30 const char *const *argv, 31 char **spec_machine) 32{ | 1/* Helper routines for cygwin-specific command-line parsing. 2 Contributed by Christopher Faylor (cgf@redhat.com) 3 Copyright 2003 Free Software Foundation, Inc. 4 5This file is part of GCC. 6 7GCC is free software; you can redistribute it and/or modify 8it under the terms of the GNU General Public License as published by --- 16 unchanged lines hidden (view full) --- 25#include "tm.h" 26#include <string.h> 27 28void 29mingw_scan (int argc ATTRIBUTE_UNUSED, 30 const char *const *argv, 31 char **spec_machine) 32{ |
33 putenv ("GCC_CYGWIN_MINGW=0"); | 33 putenv (xstrdup ("GCC_CYGWIN_MINGW=0")); |
34 35 while (*++argv) 36 if (strcmp (*argv, "-mno-win32") == 0) | 34 35 while (*++argv) 36 if (strcmp (*argv, "-mno-win32") == 0) |
37 putenv ("GCC_CYGWIN_WIN32=0"); | 37 putenv (xstrdup ("GCC_CYGWIN_WIN32=0")); |
38 else if (strcmp (*argv, "-mwin32") == 0) | 38 else if (strcmp (*argv, "-mwin32") == 0) |
39 putenv ("GCC_CYGWIN_WIN32=1"); | 39 putenv (xstrdup ("GCC_CYGWIN_WIN32=1")); |
40 else if (strcmp (*argv, "-mno-cygwin") == 0) 41 { 42 char *p = strstr (*spec_machine, "-cygwin"); 43 if (p) 44 { 45 int len = p - *spec_machine; 46 char *s = xmalloc (strlen (*spec_machine) + 3); 47 memcpy (s, *spec_machine, len); 48 strcpy (s + len, "-mingw32"); 49 *spec_machine = s; 50 } | 40 else if (strcmp (*argv, "-mno-cygwin") == 0) 41 { 42 char *p = strstr (*spec_machine, "-cygwin"); 43 if (p) 44 { 45 int len = p - *spec_machine; 46 char *s = xmalloc (strlen (*spec_machine) + 3); 47 memcpy (s, *spec_machine, len); 48 strcpy (s + len, "-mingw32"); 49 *spec_machine = s; 50 } |
51 putenv ("GCC_CYGWIN_MINGW=1"); | 51 putenv (xstrdup ("GCC_CYGWIN_MINGW=1")); |
52 } 53 return; 54} | 52 } 53 return; 54} |