changeset 1842:123d1a900f54

More MINGW cleanups... eliminate a few more warnings and disable the unused-value warning due to unfixable warnings generated by the Win32 macros.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 20 Nov 2012 20:42:06 +0000
parents 7677754a1ca5
children 2fe7fca61236
files dwcompat.h makefile.mingw win/dw.c
diffstat 3 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/dwcompat.h	Tue Nov 20 05:09:30 2012 +0000
+++ b/dwcompat.h	Tue Nov 20 20:42:06 2012 +0000
@@ -175,6 +175,7 @@
 
 #ifdef MSVC
 #include "platform/dirent.h"
+#undef alloca
 #define alloca _alloca
 #ifdef __stat64
 #undef stat
--- a/makefile.mingw	Tue Nov 20 05:09:30 2012 +0000
+++ b/makefile.mingw	Tue Nov 20 20:42:06 2012 +0000
@@ -1,16 +1,15 @@
 
 # Dynamic Windows MINGW Makefile
 
-# make -C MingW32-gcc-3.4.0-DEBUG -f ../makefile.mingw DEBUG=Y > MingW32-gcc-3.4.0-DEBUG/make-out.log 2>&1
-# make -C MingW32-gcc-3.4.0-RELEASE -f ../makefile.mingw > MingW32-gcc-3.4.0-RELEASE/make-out.log 2>&1
-
 CC = gcc
 RM = del /f
 
 DEFS =
 LIBS =
 
-CFLAGS = -O -g -DMSVC -DWIN32 -D__WIN32__ -DGDIPLUS -DUNICODE -D_UNICODE -DISOLATION_AWARE_ENABLED=1 -I./win -I. -I./platform -Wall -mthreads -o $(@)
+# Had to disable -Wunused-value due to every Win32 macro generating this warning...
+# GCC has marked this as  WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
+CFLAGS = -O -g -DMSVC -DWIN32 -D__WIN32__ -DGDIPLUS -DUNICODE -D_UNICODE -DISOLATION_AWARE_ENABLED=1 -I./win -I. -I./platform -Wall -Wno-unused-value -mthreads -o $(@)
 LDFLAGS = -shared -mwindows -mthreads -lcomctl32 -lole32 -loleaut32 -luserenv -lmsimg32 -lgdiplus
 
 COMPATOBJECTS = dwcompat.o dirent.o
--- a/win/dw.c	Tue Nov 20 05:09:30 2012 +0000
+++ b/win/dw.c	Tue Nov 20 20:42:06 2012 +0000
@@ -1865,7 +1865,7 @@
                         WCHAR uc[2] = { 0 };
                         
                         uc[0] = (WCHAR)mp1;
-                        utf8 = WideToUTF8(uc);
+                        utf8 = WideToUTF8(&uc[0]);
 #endif                        
                         
                         if(GetAsyncKeyState(VK_SHIFT) & 0x8000)
@@ -9174,7 +9174,6 @@
 {
    int z;
    static HWND lasthwnd = NULL;
-   HIMAGELIST himl;
 
    /* We can't add an invalid handle */
    if(!hicon)
@@ -9194,12 +9193,12 @@
          ImageList_AddIcon(hLarge, hicon);
          if(type)
          {
-            himl = TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL);
+            TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL);
          }
          else
          {
-            himl = ListView_SetImageList(handle, hSmall, LVSIL_SMALL);
-            himl = ListView_SetImageList(handle, hLarge, LVSIL_NORMAL);
+            ListView_SetImageList(handle, hSmall, LVSIL_SMALL);
+            ListView_SetImageList(handle, hLarge, LVSIL_NORMAL);
          }
          lasthwnd = handle;
          return z;
@@ -9211,12 +9210,12 @@
          {
             if(type)
             {
-               himl = TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL);
+               TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL);
             }
             else
             {
-               himl = ListView_SetImageList(handle, hSmall, LVSIL_SMALL);
-               himl = ListView_SetImageList(handle, hLarge, LVSIL_NORMAL);
+               ListView_SetImageList(handle, hSmall, LVSIL_SMALL);
+               ListView_SetImageList(handle, hLarge, LVSIL_NORMAL);
             }
             lasthwnd = handle;
          }