Author: rfm
Date: Fri Mar  4 16:02:07 2016
New Revision: 39453

URL: http://svn.gna.org/viewcvs/gnustep?rev=39453&view=rev
Log:
use compiler conventions to tell if we are on mswindows

Modified:
    libs/base/trunk/ChangeLog
    libs/base/trunk/Headers/GNUstepBase/GSConfig.h.in
    libs/base/trunk/SSL/GSSSLHandle.m
    libs/base/trunk/Source/NSBundle.m
    libs/base/trunk/Source/NSFileManager.m
    libs/base/trunk/macosx/GNUstepBase/preface.h

Modified: libs/base/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=39453&r1=39452&r2=39453&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog   (original)
+++ libs/base/trunk/ChangeLog   Fri Mar  4 16:02:07 2016
@@ -1,6 +1,13 @@
 2016-03-04  Richard Frith-Macdonald <[email protected]>
 
        * Source/NSCalendar.m: Fix 64bit issue with undefined components.
+       * Source\NSBundle.m:
+       * Source\NSFileManager.m:
+       * SSL\GSSSLHandle.m:
+       * Headers\GNUstepBase\GSConfig.h.in:
+       * macosx\GNUstepBase\preface.h:
+       Standardise on using _WIN32 and _WIN64 defines, following the
+       informal convention used by all the compilers we might be compiled with.
 
 2016-03-01  Richard Frith-Macdonald <[email protected]>
 

Modified: libs/base/trunk/Headers/GNUstepBase/GSConfig.h.in
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Headers/GNUstepBase/GSConfig.h.in?rev=39453&r1=39452&r2=39453&view=diff
==============================================================================
--- libs/base/trunk/Headers/GNUstepBase/GSConfig.h.in   (original)
+++ libs/base/trunk/Headers/GNUstepBase/GSConfig.h.in   Fri Mar  4 16:02:07 2016
@@ -30,31 +30,25 @@
 #define        included_GSConfig_h
 
 /* Check the compiler to see if we are building on/for ms-windows.
- * Whatever the compiler uses, we want a standard setting of __WIN32__
- * for a windows build.
+ * Whatever the compiler uses, we want a standard setting of _WIN64
+ * to indicate 64bit AND _WIN32 to indicate ms-windows.
+ * These are defined by gcc, clang, and microsoft compilers anyway.
  */
 #if     defined(__WIN32__) \
-       || defined(_WIN32) \
        || defined(__MS_WIN32__) \
-       || defined(__MINGW64__)
-#  if  !defined(__WIN32__)
-#    define __WIN32__
-#  endif
-#endif
-
-/* Check the compiler to see if we are building on/for 64bit ms-windows.
- * Whatever the compiler uses, we want a standard setting of __WIN64__
- * to indicate 64bit AND __WIN32__ to indicate ms-windows.
- */
+       || defined(__MINGW32__)
+#  if  !defined(_WIN32)
+#    define _WIN32
+#  endif
+#endif
 #if     defined(__WIN64__) \
-       || defined(_WIN64) \
        || defined(__MS_WIN64__) \
        || defined(__MINGW64__)
 #  if  !defined(__WIN64__)
 #    define __WIN64__
 #  endif
-#  if  !defined(__WIN32__)
-#    define __WIN32__
+#  if  !defined(_WIN32)
+#    define _WIN32
 #  endif
 #endif
 
@@ -310,7 +304,7 @@
 #  define __has_extension(x) __has_feature(x)
 #endif
 
-#if defined(__WIN32__)
+#if defined(_WIN32)
 #define BOOL WinBOOL
 #include <w32api.h>
 #ifndef _WIN32_WINNT
@@ -336,7 +330,7 @@
 #  include <objc/block_runtime.h>
 #endif
 
-#ifndef __WIN32__
+#ifndef _WIN32
 #include <sys/param.h> /* Hack to get rid of warning in GNU libc 2.0.3. */
 #endif
 

Modified: libs/base/trunk/SSL/GSSSLHandle.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/SSL/GSSSLHandle.m?rev=39453&r1=39452&r2=39453&view=diff
==============================================================================
--- libs/base/trunk/SSL/GSSSLHandle.m   (original)
+++ libs/base/trunk/SSL/GSSSLHandle.m   Fri Mar  4 16:02:07 2016
@@ -25,19 +25,13 @@
 
 #include "config.h"
 
-#if     defined(__WIN32__) || defined(_WIN32) || defined(__MS_WIN32__)
-#ifndef __WIN32__
-#define __WIN32__
-#endif
-#endif
-
-#ifdef __MINGW__
-#ifndef __WIN32__
-#define __WIN32__
-#endif
-#endif
-
-#if defined(__WIN32__)
+#if     defined(__WIN32__) || defined(__MINGW32__) || defined(__MS_WIN32__)
+#ifndef _WIN32
+#define _WIN32
+#endif
+#endif
+
+#if defined(_WIN32)
 #include <windows.h>
 #endif
 

Modified: libs/base/trunk/Source/NSBundle.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSBundle.m?rev=39453&r1=39452&r2=39453&view=diff
==============================================================================
--- libs/base/trunk/Source/NSBundle.m   (original)
+++ libs/base/trunk/Source/NSBundle.m   Fri Mar  4 16:02:07 2016
@@ -301,7 +301,7 @@
              result = [prefix stringByStandardizingPath];
              break;
            }
-#if defined(__WIN32__)
+#if defined(_WIN32)
          else
            {
              NSString  *extension = [path pathExtension];
@@ -1348,7 +1348,7 @@
          the executable name here - just in case it turns out it's a
          tool.  */
       NSString *toolName = [GSPrivateExecutablePath() lastPathComponent];
-#if defined(__WIN32__) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__CYGWIN__)
       toolName = [toolName stringByDeletingPathExtension];
 #endif
 

Modified: libs/base/trunk/Source/NSFileManager.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSFileManager.m?rev=39453&r1=39452&r2=39453&view=diff
==============================================================================
--- libs/base/trunk/Source/NSFileManager.m      (original)
+++ libs/base/trunk/Source/NSFileManager.m      Fri Mar  4 16:02:07 2016
@@ -92,7 +92,7 @@
 
 /* determine filesystem max path length */
 
-#if defined(_POSIX_VERSION) || defined(__WIN32__)
+#if defined(_POSIX_VERSION) || defined(_WIN32)
 # if defined(__MINGW__)
 #   include <sys/utime.h>
 # else
@@ -549,7 +549,7 @@
       BOOL             ok = NO;
       struct _STATB    sb;
 
-#if  defined(__WIN32__) || defined(_POSIX_VERSION)
+#if  defined(_WIN32) || defined(_POSIX_VERSION)
       struct _UTIMB ub;
 #else
       time_t ub[2];
@@ -559,7 +559,7 @@
        {
          ok = NO;
        }
-#if  defined(__WIN32__)
+#if  defined(_WIN32)
       else if (sb.st_mode & _S_IFDIR)
        {
          ok = YES;     // Directories don't have modification times.
@@ -567,7 +567,7 @@
 #endif
       else
        {
-#if  defined(__WIN32__) || defined(_POSIX_VERSION)
+#if  defined(_WIN32) || defined(_POSIX_VERSION)
          ub.actime = sb.st_atime;
          ub.modtime = [date timeIntervalSince1970];
          ok = (_UTIME(lpath, &ub) == 0);

Modified: libs/base/trunk/macosx/GNUstepBase/preface.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/macosx/GNUstepBase/preface.h?rev=39453&r1=39452&r2=39453&view=diff
==============================================================================
--- libs/base/trunk/macosx/GNUstepBase/preface.h        (original)
+++ libs/base/trunk/macosx/GNUstepBase/preface.h        Fri Mar  4 16:02:07 2016
@@ -27,26 +27,6 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <GNUstepBase/objc-gnu2next.h>
-
-#if     defined(__WIN32__) || defined(_WIN32) || defined(__MS_WIN32__)
-#ifndef __WIN32__
-#define __WIN32__
-#endif
-#endif
-
-#ifdef __MINGW32__
-#ifndef __MINGW__
-#define __MINGW__
-#endif
-#ifndef __WIN32__
-#define __WIN32__
-#endif
-#endif
-
-#if defined(__WIN32__)
-#include <windows.h>
-#define GNUSTEP_BASE_SOCKET_MESSAGE (WM_USER + 1)
-#endif
 
 #if NeXT_RUNTIME
  #include <objc/objc.h>
@@ -86,9 +66,7 @@
 #define        _C_ULNG_LNG     'Q'
 #endif
 
-#ifndef __WIN32__
 #include <sys/param.h> /* Hack to get rid of warning in GNU libc 2.0.3. */
-#endif
 
 /* The following group of lines maintained by the gstep-base configure */
 #define GNUSTEP_BASE_VERSION            @VERSION@


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to