Patch #2560 2008-09-09 02:51

stahta01

wxSmith: improved win32 header define bug fix
Download
2560-wxSmith_improv.patch (2.3 KB)
Category
Plugin::Refinement
Status
Closed
Close date
2008-10-06 19:38
Assigned to
 
Index: src/plugins/contrib/wxSmith/wxwidgets/wxsitemresdata.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/wxsitemresdata.cpp    (revision 5202)
+++ src/plugins/contrib/wxSmith/wxwidgets/wxsitemresdata.cpp    (working copy)
@@ -33,6 +33,11 @@
 #include <wx/clipbrd.h>
 #include <tinyxml/tinywxuni.h>
 
+#if defined(__WXMSW__) && defined(LoadImage)
+    // Fix Windows winuser.h Header define of LoadImage.
+    #undef LoadImage
+#endif
+
 using namespace wxsFlags;
 
 namespace
Index: src/plugins/contrib/wxSmith/wxsresourcetree.h
===================================================================
--- src/plugins/contrib/wxSmith/wxsresourcetree.h    (revision 5202)
+++ src/plugins/contrib/wxSmith/wxsresourcetree.h    (working copy)
@@ -23,15 +23,15 @@
 #ifndef WXSRESOURCETREE_H
 #define WXSRESOURCETREE_H
 
-#ifndef WX_PRECOMP
-#   ifdef __WXMSW__
-#       include <wx/msw/wrapwin.h>  // Needed to prevent LoadImage define bug.
-#   endif
-#endif
 
 #include <wx/treectrl.h>
 #include "wxsresourcetreeitemdata.h"
 
+#if defined(__WXMSW__) && defined(LoadImage)
+    // Fix Windows winuser.h Header define of LoadImage.
+    #undef LoadImage
+#endif
+
 class wxsResource;
 class wxsProject;
 
Index: src/plugins/contrib/wxSmith/wxwidgets/wxsitemfactory.h
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/wxsitemfactory.h    (revision 5203)
+++ src/plugins/contrib/wxSmith/wxwidgets/wxsitemfactory.h    (working copy)
@@ -33,6 +33,11 @@
 
 #include <configmanager.h>
 
+#if defined(__WXMSW__) && defined(LoadImage)
+    // Fix Windows winuser.h Header define of LoadImage.
+    #undef LoadImage
+#endif
+
 class wxsItem;
 class wxsItemResData;
 
Index: src/plugins/contrib/wxSmith/wxsresourcetree.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxsresourcetree.cpp    (revision 5203)
+++ src/plugins/contrib/wxSmith/wxsresourcetree.cpp    (working copy)
@@ -30,6 +30,12 @@
 #include "configmanager.h"
 #include "globals.h"
 
+#if defined(__WXMSW__) && defined(LoadImage)
+    // Fix Windows winuser.h Header define of LoadImage.
+    #undef LoadImage
+#endif
+
+
 namespace
 {
     class wxsResourceTreeProjectData: public wxsResourceTreeItemData
stahta01 2008-09-09 02:53

This is an simpler fix for Windows winuser.h Header define of LoadImage as LoadImageW.

killerbot 2008-10-06 19:38

applied it, but it seems that the change to wxsresourcetree.cpp was not needed.

Does it work for you ?