]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Cygwin defines WIN32 in <windows.h>!
authorBruno Haible <bruno@clisp.org>
Wed, 17 May 2006 10:39:57 +0000 (10:39 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:13:21 +0000 (12:13 +0200)
gettext-tools/lib/ChangeLog
gettext-tools/lib/classpath.c
gettext-tools/lib/javaexec.c
gettext-tools/lib/localcharset.c
gettext-tools/lib/progreloc.c
gettext-tools/src/ChangeLog
gettext-tools/src/hostname.c

index 40420947e63f8d422bdbaad17c8bfb4234b3a95f..930eea16cac8555c5fd992103324a807fccbdfdf 100644 (file)
@@ -1,3 +1,12 @@
+2006-05-17  Bruno Haible  <bruno@clisp.org>
+
+       Cygwin portability.
+       * classpath.c (PATH_SEPARATOR) [CYGWIN]: Define as ':'.
+       * javaexec.c (execute_java_class): Test for jview program also on
+       Cygwin.
+       * localcharset.c (WIN32_NATIVE): Renamed from WIN32.
+       * progreloc.c (WIN32_NATIVE): Renamed from WIN32.
+
 2006-05-16  Bruno Haible  <bruno@clisp.org>
 
        * localcharset.c [CYGWIN]: Include <windows.h>.
index 1cbc14b1dcd3466cb955bb11ac7efed72d06d304..ccb66de262ab03059cdc3924850c34fa8dd9a53d 100644 (file)
@@ -1,5 +1,5 @@
 /* Java CLASSPATH handling.
-   Copyright (C) 2001-2003 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -36,7 +36,7 @@
 #endif
 
 /* Separator in PATH like lists of pathnames.  */
-#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
   /* Win32, OS/2, DOS */
 # define PATH_SEPARATOR ';'
 #else
index a555c967236ec7e3cf8dc52c2eebd0287edd0241..c50a30eea33254f3992609b6e0a104fa1e0d0579 100644 (file)
@@ -1,5 +1,5 @@
 /* Execute a Java program.
-   Copyright (C) 2001-2003 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -360,8 +360,8 @@ execute_java_class (const char *class_name,
       }
   }
 
-#if defined _WIN32 || defined __WIN32__
-  /* Win32 */
+#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
+  /* Win32, Cygwin */
   {
     static bool jview_tested;
     static bool jview_present;
index e4e81ca3c040fc5bc15d74cc334bd2f3ad4b45e1..e8505bfa908a8e43e5d77f0900356ce94dfe5f04 100644 (file)
@@ -41,8 +41,7 @@
 #endif
 
 #if defined _WIN32 || defined __WIN32__
-# undef WIN32   /* avoid warning on mingw32 */
-# define WIN32
+# define WIN32_NATIVE
 #endif
 
 #if defined __EMX__
@@ -50,7 +49,7 @@
 # define OS2
 #endif
 
-#if !defined WIN32
+#if !defined WIN32_NATIVE
 # if HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
 # else
@@ -62,7 +61,7 @@
 #  define WIN32_LEAN_AND_MEAN
 #  include <windows.h>
 # endif
-#elif defined WIN32
+#elif defined WIN32_NATIVE
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 #endif
@@ -118,7 +117,7 @@ get_charset_aliases (void)
   cp = charset_aliases;
   if (cp == NULL)
     {
-#if !(defined VMS || defined WIN32 || defined __CYGWIN__)
+#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
       FILE *fp;
       const char *dir;
       const char *base = "charset.alias";
@@ -244,7 +243,7 @@ get_charset_aliases (void)
           "DECKOREAN" "\0" "EUC-KR" "\0";
 # endif
 
-# if defined WIN32 || defined __CYGWIN__
+# if defined WIN32_NATIVE || defined __CYGWIN__
       /* To avoid the troubles of installing a separate file in the same
         directory as the DLL and of retrieving the DLL's directory at
         runtime, simply inline the aliases here.  */
@@ -296,7 +295,7 @@ locale_charset (void)
   const char *codeset;
   const char *aliases;
 
-#if !(defined WIN32 || defined OS2)
+#if !(defined WIN32_NATIVE || defined OS2)
 
 # if HAVE_LANGINFO_CODESET
 
@@ -380,7 +379,7 @@ locale_charset (void)
 
 # endif
 
-#elif defined WIN32
+#elif defined WIN32_NATIVE
 
   static char buf[2 + 10 + 1];
 
index 45c8826379d3377a62f218ba151a905473503231..9a6915d5db6958df959cc06484a2e3d323d4c9c8 100644 (file)
 #endif
 
 #if defined _WIN32 || defined __WIN32__
-# undef WIN32   /* avoid warning on mingw32 */
-# define WIN32
+# define WIN32_NATIVE
 #endif
 
-#if defined WIN32 || defined __CYGWIN__
+#if defined WIN32_NATIVE || defined __CYGWIN__
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 #endif
@@ -97,7 +96,7 @@ static bool
 maybe_executable (const char *filename)
 {
   /* Woe32 lacks the access() function, but Cygwin doesn't.  */
-#if !(defined WIN32 && !defined __CYGWIN__)
+#if !(defined WIN32_NATIVE && !defined __CYGWIN__)
   if (access (filename, X_OK) < 0)
     return false;
 
@@ -132,7 +131,7 @@ maybe_executable (const char *filename)
 static char *
 find_executable (const char *argv0)
 {
-#if defined WIN32 || defined __CYGWIN__
+#if defined WIN32_NATIVE || defined __CYGWIN__
   char location[MAX_PATH];
   int length = GetModuleFileName (NULL, location, sizeof (location));
   if (length < 0)
index 36cb3b7a07b94e66024b4e40491977e7bcd1f0ea..ee444f18049762dc4d80206b05a5f1522f3d148a 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-17  Bruno Haible  <bruno@clisp.org>
+
+       Cygwin portability.
+       * hostname.c (WIN32_NATIVE): Renamed from WIN32.
+
 2006-05-16  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am (CLEANFILES): Add gettext-po.h.
index ae0e5251dbe005682b85b74b6f451a8951633878..70bf2f9128ca37c59cbb2042c5762e2393ea1aff 100644 (file)
 #include <locale.h>
 
 #if defined _WIN32 || defined __WIN32__
-# undef WIN32   /* avoid warning on mingw32 */
-# define WIN32
+# define WIN32_NATIVE
 #endif
 
 /* Get gethostname().  */
 #include <unistd.h>
 
-#ifdef WIN32
+#ifdef WIN32_NATIVE
 /* Native Woe32 API lacks gethostname() but has GetComputerName() instead.  */
 # include <windows.h>
 #else
@@ -245,7 +244,7 @@ Informative output:\n"));
 static char *
 xgethostname ()
 {
-#ifdef WIN32
+#ifdef WIN32_NATIVE
   char hostname[MAX_COMPUTERNAME_LENGTH+1];
   DWORD size = sizeof (hostname);