ecere: Fixes to support MinGW-w64
authorJerome St-Louis <jerome@ecere.com>
Sun, 10 Feb 2013 22:22:15 +0000 (17:22 -0500)
committerJerome St-Louis <jerome@ecere.com>
Sat, 16 Feb 2013 06:03:03 +0000 (01:03 -0500)
28 files changed:
deps/glext/GL/glext.h
ecere/ecere.epj
ecere/src/com/instance.c
ecere/src/gfx/bitmaps/JPEGFormat.ec
ecere/src/gfx/drivers/Direct3D8DisplayDriver.ec
ecere/src/gfx/drivers/Direct3D9DisplayDriver.ec
ecere/src/gfx/drivers/DirectDrawDisplayDriver.ec
ecere/src/gfx/drivers/GDIDisplayDriver.ec
ecere/src/gfx/drivers/LFBDisplayDriver.ec
ecere/src/gfx/drivers/OpenGLDisplayDriver.ec
ecere/src/gfx/drivers/Win32BitmapPrinterDisplayDriver.ec
ecere/src/gfx/drivers/Win32ConsoleDisplayDriver.ec
ecere/src/gfx/drivers/Win32PrinterDisplayDriver.ec
ecere/src/gui/GuiApplication.ec
ecere/src/gui/Window.ec
ecere/src/gui/drivers/Win32ConsoleInterface.ec
ecere/src/gui/drivers/Win32Interface.ec
ecere/src/gui/skins/WindowsSkin.ec
ecere/src/net/Service.ec
ecere/src/net/Socket.ec
ecere/src/net/dcom.ec
ecere/src/net/network.ec
ecere/src/sys/File.ec
ecere/src/sys/GlobalAppSettings.ec
ecere/src/sys/Semaphore.ec
ecere/src/sys/System.ec
ecere/src/sys/Thread.ec
ecere/src/sys/Time.ec

index 3d69d4e..b36225d 100644 (file)
@@ -5057,7 +5057,9 @@ typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target,
 GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
 GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
 #endif /* GL_GLEXT_PROTOTYPES */
+#ifndef _W64
 typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+#endif
 typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
 #endif
 
index 4529294..8b10c80 100644 (file)
                "ungif"
             ],
             "LibraryDirs" : [
-               "../deps/zlib/obj/release.$(PLATFORM)",
-               "../deps/jpeg-6b/obj/release.$(PLATFORM)",
-               "../deps/libpng-1.4.0/obj/release.$(PLATFORM)",
-               "../deps/libungif-4.1.1/obj/release.$(PLATFORM)",
-               "../deps/freetype-2.3.12/obj/release.$(PLATFORM)"
+               "../deps/zlib/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)",
+               "../deps/jpeg-6b/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)",
+               "../deps/libpng-1.4.0/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)",
+               "../deps/libungif-4.1.1/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)",
+               "../deps/freetype-2.3.12/obj/release.$(PLATFORM)$(COMPILER_SUFFIX)"
             ]
          }
       },
index c8b106a..37cf1eb 100644 (file)
@@ -283,8 +283,13 @@ void * Instance_Module_Load(char * name, void ** Load, void ** Unload)
    }
    if(library)
    {
+#ifdef _WIN64
+      *Load = (void *)GetProcAddress(library, "__ecereDll_Load");
+      *Unload = (void *)GetProcAddress(library, "__ecereDll_Unload");
+#else
       *Load = (void *)GetProcAddress(library, "__ecereDll_Load@4");
       *Unload = (void *)GetProcAddress(library, "__ecereDll_Unload@4");
+#endif
       if(!*Load)
          FreeLibrary(library);
    }
index d3fa701..43617f7 100644 (file)
@@ -4,7 +4,7 @@ import "Display"
 
 #include <setjmp.h>
 
-typedef uint size_t;
+typedef uintptr size_t; // For now, until we add uintsize
 
 #include "jpeglib.h"
 #include "jerror.h"
index 30995cb..362db21 100644 (file)
@@ -10,10 +10,14 @@ import "instance"
 #define uint _uint
 #define byte _byte
 #define int64 _int64
+#define String _String
+#define Mutex _Mutex
+#define Size _Size
+#define Platform _Platform
 
 #include <windows.h>
 
-#if defined(__MINGW32__)
+#if defined(__MINGW32__) && !defined(_W64)
 #undef DECLARE_INTERFACE
 #define DECLARE_INTERFACE(i) \
    interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; }; \
@@ -27,6 +31,10 @@ import "instance"
 #undef uint
 #undef byte
 #undef int64
+#undef String
+#undef Mutex
+#undef Size
+#undef Platform
 
 import "Display"
 
index f2a9d3c..20d9a13 100644 (file)
@@ -10,10 +10,14 @@ import "instance"
 #define uint _uint
 #define byte _byte
 #define int64 _int64
+#define String _String
+#define Mutex _Mutex
+#define Size _Size
+#define Platform _Platform
 
 #include <windows.h>
 
-#if defined(__MINGW32__)
+#if defined(__MINGW32__) && !defined(_W64)
 #undef DECLARE_INTERFACE
 #define DECLARE_INTERFACE(i) \
    interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; }; \
@@ -22,10 +26,15 @@ import "instance"
 #endif
 
 #include <d3d9.h>
+
 #undef Method
 #undef uint
 #undef byte
 #undef int64
+#undef String
+#undef Mutex
+#undef Size
+#undef Platform
 
 import "Display"
 
index a61a15b..a4235eb 100644 (file)
@@ -4,22 +4,23 @@ import "instance"
 
 #if defined(__WIN32__)
 
-#if defined(__MINGW32__)
+#define Method _Method
+#define uint _uint
+#define byte _byte
+#define int64 _int64
+#define String _String
+#define Mutex _Mutex
+#define Size _Size
+#define Platform _Platform
 
+#if defined(__MINGW32__) && !defined(_W64)
 #undef DECLARE_INTERFACE
-#  define DECLARE_INTERFACE(i) \
+#define DECLARE_INTERFACE(i) \
    interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; }; \
    typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \
    CONST_VTABLE struct i##Vtbl
-
 #endif
 
-// #define HRESULT int
-#define Method _Method
-#define uint _uint
-#define byte _byte
-#define int64 _int64
-
 #define UNICODE
 
 #include <ddraw.h>
@@ -28,6 +29,10 @@ import "instance"
 #undef uint
 #undef byte
 #undef int64
+#undef String
+#undef Mutex
+#undef Size
+#undef Platform
 
 import "Display"
 
index 1c77b37..581a7c3 100644 (file)
@@ -9,10 +9,12 @@ import "instance"
 #define _WIN32_WINNT 0x0500
 #define WIN32_LEAN_AND_MEAN
 #define Method _Method
+#define String _String
 
 #include <windows.h>
 
 #undef Method
+#undef String
 
 import "Display"
 import "Win32Interface"
index 0785698..bbcd190 100644 (file)
@@ -17,7 +17,9 @@ namespace gfx::drivers;
 
 #if defined(__WIN32__)
 #define WIN32_LEAN_AND_MEAN
+#define String _String
 #include <windows.h>
+#undef String
 #elif !defined(ECERE_NOTRUETYPE) && !defined(ECERE_NOFONTCONFIG)
 #define set _set
 #include <fontconfig/fontconfig.h>
index 38cba60..307655b 100644 (file)
@@ -69,7 +69,9 @@ namespace gfx::drivers;
 #if defined(__WIN32__)
 #define WIN32_LEAN_AND_MEAN
 #define _WIN32_WINNT 0x0500
+#define String Sting_
 #include <windows.h>
+#undef String
 #endif
 
 #if defined(__ANDROID__)
index 4e63e92..e91fcd6 100644 (file)
@@ -8,11 +8,13 @@ import "instance"
 #define WIN32_LEAN_AND_MEAN
 #define UNICODE
 #define Method _Method
+#define String _String
 
 #include <windows.h>
 #include <winspool.h>
 
 #undef Method
+#undef String
 
 default wchar_t *wcstok(wchar_t *strToken,const wchar_t *strDelimit);
 
index a60c5eb..6531683 100644 (file)
@@ -6,7 +6,9 @@ import "instance"
 
 #define WIN32_LEAN_AND_MEAN
 #define Method _Method
+#define String _String
 #include <windows.h>
+#undef String
 #undef Method
 
 import "Display"
index f335a0a..34c90f1 100644 (file)
@@ -8,9 +8,11 @@ import "instance"
 #define WIN32_LEAN_AND_MEAN
 #define UNICODE
 #define Method _Method
+#define String _String
 #include <windows.h>
 #include <winspool.h>
 #undef Method
+#undef String
 
 default wchar_t *wcstok(wchar_t *strToken,const wchar_t *strDelimit);
 
index f8863a2..8c66fc5 100644 (file)
@@ -35,7 +35,9 @@ namespace gui;
 #if defined(__WIN32__)
 
 #define WIN32_LEAN_AND_MEAN
+#define String _String
 #include <winsock.h>
+#undef String
 static WSADATA wsaData;
 
 #elif defined(__unix__) || defined(__APPLE__)
index a52f37f..d34d586 100644 (file)
@@ -4965,7 +4965,7 @@ private:
             }
             */
 
-            captionFont = guiApp.currentSkin.CaptionFont();
+            captionFont = guiApp.currentSkin ? guiApp.currentSkin.CaptionFont() : null;
             AddResource(captionFont);
 
             if(OnLoadGraphics())
index 638ccd4..c66c21b 100644 (file)
@@ -6,10 +6,12 @@ import "instance"
 
 #define WIN32_LEAN_AND_MEAN
 #define Method _Method
+#define String _String
 #include <windows.h>
 #include <mmsystem.h>
 
 #undef Method
+#undef String
 
 import "Display"
 
index 5d6429c..96ec348 100644 (file)
@@ -18,6 +18,9 @@ import "instance"
 #define Method _Method
 #define byte _byte
 #define int64 _int64
+#define String _String
+#define Mutex _Mutex
+#define Platform _Platform
 #include <windows.h>
 #include <wincon.h>
 #include <shellapi.h>
@@ -82,6 +85,9 @@ SetLayeredWindowAttributes(
 #undef Method
 #undef byte
 #undef int64
+#undef String
+#undef Mutex
+#undef Platform
 
 import "Window"
 
@@ -244,7 +250,7 @@ class Win32Interface : Interface
       if(time - lastAutoHideCheck > 1)
       {
          APPBARDATA appBarData = { 0 };
-         newTaskBarState = SHAppBarMessage(ABM_GETSTATE, &appBarData);
+         newTaskBarState = (int)SHAppBarMessage(ABM_GETSTATE, &appBarData);
          lastAutoHideCheck = time;
       }
 
@@ -430,7 +436,11 @@ class Win32Interface : Interface
    // --- Window procedure ---
    DWORD CALLBACK ::ApplicationWindow(HWND windowHandle, UINT msg, WPARAM wParam, LPARAM lParam)
    {
+#ifdef _WIN64
+      Window window = (Window)GetWindowLongPtr(windowHandle, GWLP_USERDATA);
+#else
       Window window = (Window)GetWindowLong(windowHandle, GWL_USERDATA);
+#endif
       static Point lastPos;
       if(window)
       {
@@ -470,21 +480,25 @@ class Win32Interface : Interface
                   {
                      HWND foreground;
                      DWORD id;
-                     uint windowLong;
+                     void * windowLong;
                      foreground = GetForegroundWindow();
                      if(foreground == windowHandle && lParam)
                         foreground = (HWND)lParam;
 
                      GetWindowThreadProcessId(foreground, &id);
 
-                     windowLong = GetWindowLong(foreground, GWL_WNDPROC);
+#ifdef _WIN64
+                     windowLong = (void*)GetWindowLongPtr(foreground, GWLP_WNDPROC);
+#else
+                     windowLong = (void*)GetWindowLong(foreground, GWL_WNDPROC);
+#endif
 #if !defined(ECERE_VANILLA) && !defined(ECERE_NO3D)
                      // The != ApplicationWindow check is for not recognizing the Console window as an Ecere Window
                      // That check causes a problem with the OpenGL driver which seems to popup a window of a different class
                      if(window.displaySystem && window.displaySystem.driver == class(OpenGLDisplayDriver))
-                        windowLong = (uint)ApplicationWindow;
+                        windowLong = (void *)ApplicationWindow;
 #endif
-                     if(id != GetCurrentProcessId() || windowLong != (LPARAM)ApplicationWindow)
+                     if(id != GetCurrentProcessId() || windowLong != (void *)ApplicationWindow)
                         window.ExternalActivate(false, true, window, null);
                      // DefWindowProc for WM_NCACTIVATE draws the decorations, make sure it's drawn in the right state
                      return (uint)DefWindowProc(windowHandle, msg, window.active, lParam);
@@ -540,11 +554,11 @@ class Win32Interface : Interface
                               SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOSIZE); //|SWP_NOREDRAW); 
                         */ 
                      }
-                     guiApp.SetAppFocus(wParam);
+                     guiApp.SetAppFocus((bool)wParam);
                   }
                }
                else 
-                  guiApp.SetAppFocus(wParam);
+                  guiApp.SetAppFocus((bool)wParam);
                break;
             case WM_PAINT:
             {
@@ -594,8 +608,8 @@ class Win32Interface : Interface
                static int lastRes = 0;
                if(lastBits != wParam || lastRes != lParam)
                {
-                  lastBits = wParam;
-                  lastRes = lParam;
+                  lastBits = (int)wParam;
+                  lastRes = (int)lParam;
                
                   externalDisplayChange = true;
                   if(guiApp.desktop.DisplayModeChanged())
@@ -638,7 +652,7 @@ class Win32Interface : Interface
                incref window;
                if(msg == WM_CHAR || msg == WM_DEADCHAR || PeekMessage(&charMsg, windowHandle, min, max, PM_REMOVE))
                {
-                  ch = (msg == WM_CHAR || msg == WM_DEADCHAR) ? wParam : (unichar)charMsg.wParam;
+                  ch = (msg == WM_CHAR || msg == WM_DEADCHAR) ? (unichar)wParam : (unichar)charMsg.wParam;
                   // TOCHECK: What is this for again? Fixing some obscure activation status?
                   // -- I believe this was somehow allowing 'unmaximizing', but was causing problems
                   // as there was no way to prevent AltEnter from doing so (e.g. when it is used for a node property)
@@ -714,7 +728,7 @@ class Win32Interface : Interface
                      font.lfOutPrecision = OUT_DEFAULT_PRECIS;
                      font.lfClipPrecision = CLIP_DEFAULT_PRECIS;
                      font.lfQuality = DEFAULT_QUALITY;
-                     font.lfPitchAndFamily = (byte)DEFAULT_PITCH|FF_DONTCARE; // TODO: Fix compiler 0 | 0 to produce byte, not int
+                     font.lfPitchAndFamily = (byte)(DEFAULT_PITCH|FF_DONTCARE); // TODO: Fix compiler 0 | 0 to produce byte, not int
                      UTF8toUTF16Buffer(res.faceName, font.lfFaceName, LF_FACESIZE);
 
                      ImmSetCompositionFont(ctx, &font);
@@ -1133,7 +1147,11 @@ class Win32Interface : Interface
       /// DRIVER IMPLEMENTATION /////////////
    ****************************************************************************/
 
+#ifdef _WIN64
+   void CALLBACK ::TimerProc(UINT uTimerID, UINT uMsg, uint64 dwUser, uint64 dw1, uint64 dw2)
+#else
    void CALLBACK ::TimerProc(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
+#endif
    {
       guiApp.SignalEvent();
    }
@@ -1391,7 +1409,11 @@ class Win32Interface : Interface
          }
       }
       delete text;
+#ifdef _WIN64
+      SetWindowLongPtr(windowHandle, GWLP_USERDATA, (int64)window);
+#else
       SetWindowLong(windowHandle, GWL_USERDATA, (DWORD)window);
+#endif
 
       return windowHandle;
    }
@@ -1404,12 +1426,20 @@ class Win32Interface : Interface
          guiApp.lockMutex.Release();
 
       oldIcon = (HICON)SendMessage(window.windowHandle, WM_GETICON, ICON_BIG, 0);
+#ifdef _WIN64
+      if(oldIcon && oldIcon != (HICON)GetClassLongPtr(window.windowHandle, GCLP_HICON))
+#else
       if(oldIcon && oldIcon != (HICON)GetClassLong(window.windowHandle, GCL_HICON))
+#endif
          DestroyIcon(oldIcon);
 
        ShowWindow(window.windowHandle, SW_HIDE);
 
+#ifdef _WIN64
+      SetWindowLongPtr(window.windowHandle, GWLP_USERDATA, (int64)null);
+#else
       SetWindowLong(window.windowHandle, GWL_USERDATA, 0);
+#endif
       DestroyWindow(window.windowHandle);
 
       for(c = 0; c < lockCount; c++)
@@ -1819,7 +1849,11 @@ class Win32Interface : Interface
          }
       }
 
+#ifdef _WIN64
+      if(oldIcon && oldIcon != (HICON)GetClassLongPtr(window.windowHandle, GCLP_HICON))
+#else
       if(oldIcon && oldIcon != (HICON)GetClassLong(window.windowHandle, GCL_HICON))
+#endif
       {
          DestroyIcon(oldIcon);
       }
index 6751a2d..f800d2a 100644 (file)
@@ -1,8 +1,10 @@
 #if defined(WIN32)
 #define WIN32_LEAN_AND_MEAN
+#define String _String
 #define Method _Method
 #include <windows.h>
 #undef Method
+#undef String
 #endif
 
 import "Window"
index 489bf51..5cd1d27 100644 (file)
@@ -7,7 +7,9 @@ namespace net;
 #if defined(__WIN32__)
 
 #define WIN32_LEAN_AND_MEAN
+#define String _String
 #include <winsock.h>
+#undef String
 static WSADATA wsaData;
 
 #elif defined(__unix__) || defined(__APPLE__)
@@ -93,7 +95,7 @@ public:
                FD_SET(s, &network.exceptSet);
                if(s >= network.ns) 
                {
-                  network.ns = s+1;
+                  network.ns = (int)(s+1);
                   network.socketsSemaphore.Release();
                }
                network.mutex.Release();
@@ -157,7 +159,7 @@ public:
          //FD_SET(s, &ws);
          FD_SET(s, &es);
 
-         selectResult = select(s+1, &rs, &ws, &es, &tvTO);
+         selectResult = select((int)(s+1), &rs, &ws, &es, &tvTO);
          if(selectResult > 0)
          {
             if(FD_ISSET(s, &rs))
index 4277782..e4e5b1d 100644 (file)
@@ -5,7 +5,9 @@ namespace net;
 #if defined(__WIN32__)
 
 #define WIN32_LEAN_AND_MEAN
+#define String _String
 #include <winsock.h>
+#undef String
 static WSADATA wsaData;
 
 #elif defined(__unix__) || defined(__APPLE__)
@@ -79,7 +81,7 @@ static class SocketConnectThread : Thread
                socket.inetPort = ntohs(socket.a.sin_port); 
                network.mutex.Release();
 
-               if(socket.OnEstablishConnection(socket.s))
+               if(socket.OnEstablishConnection((int)socket.s))
                {
                   network.mutex.Wait();
                   result = true;
@@ -164,7 +166,7 @@ public:
                FD_SET(s, &network.readSet);
                if(s >= network.ns) 
                {
-                  network.ns = s+1;
+                  network.ns = (int)(s+1);
                   network.socketsSemaphore.Release();
                }
                network.mutex.Release();
@@ -344,7 +346,7 @@ public:
 
    bool SendString(char * string)
    {
-      return Send(string, strlen(string));
+      return Send(string, (int)strlen(string));
    }
 
    bool Sendf(char * format, ...)
@@ -355,7 +357,7 @@ public:
       va_start(args, format);
       vsnprintf(string, sizeof(string), format, args);
       string[sizeof(string)-1] = 0;
-      result = Send(string, strlen(string));
+      result = Send(string, (int)strlen(string));
       va_end(args);
       return result;
    }
@@ -399,7 +401,7 @@ public:
             FD_SET(s, &network.exceptSet);
             if(s >= network.ns) 
             {
-               network.ns = s+1;
+               network.ns = (int)(s+1);
                network.socketsSemaphore.Release();
             }
             network.mutex.Release();
@@ -530,7 +532,7 @@ private:
          FD_SET(s, &network.writeSet);
          if(s >= network.ns && !processAlone) 
          {
-            network.ns = s+1;
+            network.ns = (int)(s+1);
             network.socketsSemaphore.Release();
          }
          connectThread = SocketConnectThread { socket = this };
@@ -722,7 +724,7 @@ private:
       //FD_SET(s, &ws);
       FD_SET(s, &es);
 
-      selectResult = select(s+1, &rs, &ws, &es, leftOver ? &tv : (timeOut ? &tvTO : null));
+      selectResult = select((int)(s+1), &rs, &ws, &es, leftOver ? &tv : (timeOut ? &tvTO : null));
       mutex.Wait();
       if(s != -1 && _refCount && (leftOver || selectResult))
       {
index d923e33..410f300 100644 (file)
@@ -3,7 +3,9 @@ namespace net;
 #if defined(__WIN32__)
 
 #define WIN32_LEAN_AND_MEAN
+#define String _String
 #include <winsock.h>
+#undef String
 static WSADATA wsaData;
 
 #elif defined(__unix__) || defined(__APPLE__)
index 87cf5bd..d8ab92f 100644 (file)
@@ -5,7 +5,9 @@ namespace net;
 #if defined(__WIN32__)
 
 #define WIN32_LEAN_AND_MEAN
+#define String _String
 #include <winsock.h>
+#undef String
 static WSADATA wsaData;
 
 #elif defined(__unix__) || defined(__APPLE__)
@@ -133,21 +135,21 @@ void Network_DetermineMaxSocket()
    network.ns = 0;
    for(socket = network.sockets.first; socket; socket = socket.next)
       if(!socket.processAlone && !socket.destroyed && socket.s >= network.ns)
-         network.ns = socket.s + 1;
+         network.ns = (int)(socket.s + 1);
    for(socket = network.connectSockets.first; socket; socket = socket.next)
       if(!socket.destroyed && socket.s >= network.ns)
-         network.ns = socket.s + 1;
+         network.ns = (int)(socket.s + 1);
 
    for(service = network.services.first; service; service = service.next)
    {
       if(!service.destroyed && !service.processAlone)
       {
          if(service.s >= network.ns)
-            network.ns = service.s + 1;
+            network.ns = (int)(service.s + 1);
       }
       for(socket = service.sockets.first; socket; socket = socket.next)
          if(!socket.destroyed && !socket.processAlone && socket.s >= network.ns)
-            network.ns = socket.s + 1;
+            network.ns = (int)(socket.s + 1);
    }
    network.mutex.Release();
 }
index 462f27f..58fef0f 100644 (file)
@@ -40,7 +40,9 @@ default:
 
 #if defined(__WIN32__)
 #define WIN32_LEAN_AND_MEAN
+#define String String_
 #include <windows.h>
+#undef String
 #include <io.h>
 
 BOOL WINAPI GetVolumePathName(LPCTSTR lpszFileName,LPTSTR lpszVolumePathName,DWORD cchBufferLength);
index bbfd933..f449cef 100644 (file)
@@ -3,7 +3,9 @@ namespace sys;
 #if defined(__WIN32__)
 #define WIN32_LEAN_AND_MEAN
 #define UNICODE
+#define String String_
 #include <windows.h>
+#undef String
 #endif
 
 import "System"
index d9c9a1d..f7b22a6 100644 (file)
@@ -8,7 +8,9 @@ namespace sys;
 // Platform includes
 #if defined(__WIN32__)
 #define WIN32_LEAN_AND_MEAN
+#define String String_
 #include <windows.h>
+#undef String
 #elif defined(__APPLE__)
 #define set _set
 #include <mach/mach.h>
index b7d0acd..94af6df 100644 (file)
@@ -15,7 +15,9 @@ default:
 #define WIN32_LEAN_AND_MEAN
 #define UNICODE
 #define GetFreeSpace _GetFreeSpace
+#define String String_
 #include <windows.h>
+#undef String
 #undef GetFreeSpace
 
 #elif defined(__unix__) || defined(__APPLE__)
index 4686ed5..3737214 100644 (file)
@@ -5,7 +5,11 @@ namespace sys;
 // Platform includes
 #if defined(__WIN32__)
 #define WIN32_LEAN_AND_MEAN
+#define String String_
+#define Thread Thread_
 #include <windows.h>
+#undef String
+#undef Thread
 #else
 #include <pthread.h>
 #ifndef __ANDROID__
index 15e2854..ecd3486 100644 (file)
@@ -17,7 +17,9 @@ namespace sys;
 
 #if defined(__WIN32__)
 #define WIN32_LEAN_AND_MEAN
+#define String String_
 #include <windows.h>
+#undef String
 #include <mmsystem.h>
 #elif defined(__unix__) || defined(__APPLE__)
 #include <sys/time.h>