Hello,

 I'm attaching a small patch which moves the inclusion of wx/wx.h to the
top of all files which include it (bindings/wxwidgets/wxPLplotstream.cpp
and drivers/wxwidgets*.cpp), in particular before the include of plplotP.h
or plDevs.h. The reason for doing this is that wxWidgets may be built with
IPv6 support (wxUSE_IPV6=1) and in this case winsock.h must not be included
as IPv6 is only support by WinSock2 whose functions are defined in
winsock2.h. The trouble is that winsock2.h is incompatible with winsock.h
and only one of these headers may be included. And while wxWidgets itself
deals correctly with this by including either windows.h (which includes
winsock.h implicitly) or winsock2.h *before* including windows.h, plplotP.h
includes windows.h unconditionally (via dirent_msvc.h) and so you get
plenty of errors when winsock2.h is included later from wx/wx.h.

 I hope I managed to explain the problem but it's definitely somewhat
confusing so please let me know if you have any questions or suggestions.
But if it seems fine, please consider applying the patch below.

 Thanks in advance,
VZ

diff -r 418239c57d39 bindings/wxwidgets/wxPLplotstream.cpp
--- a/bindings/wxwidgets/wxPLplotstream.cpp     Tue Mar 10 16:33:23 2009 +0100
+++ b/bindings/wxwidgets/wxPLplotstream.cpp     Wed Mar 11 14:25:26 2009 +0100
@@ -19,11 +19,11 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */
 
+/* wxwidgets headers */
+#include "wx/wx.h"
+
 /* plplot headers */
 #include "plplotP.h" 
-
-/* wxwidgets headers */
-#include "wx/wx.h"
 
 #include "wxPLplotstream.h"
 
diff -r 418239c57d39 drivers/wxwidgets.cpp
--- a/drivers/wxwidgets.cpp     Tue Mar 10 16:33:23 2009 +0100
+++ b/drivers/wxwidgets.cpp     Wed Mar 11 14:25:26 2009 +0100
@@ -25,6 +25,11 @@
  * - NA
  */
 
+/* wxwidgets headers */
+#include <wx/wx.h>
+#include <wx/wfstream.h>
+#include <wx/except.h>
+
 #include "plDevs.h"
 
 /* plplot headers */
@@ -33,11 +38,6 @@
 
 /* C/C++ headers */
 #include <cstdio>
-
-/* wxwidgets headers */
-#include <wx/wx.h>
-#include <wx/wfstream.h>
-#include <wx/except.h>
 
 #include "wxwidgets.h"
 
diff -r 418239c57d39 drivers/wxwidgets_agg.cpp
--- a/drivers/wxwidgets_agg.cpp Tue Mar 10 16:33:23 2009 +0100
+++ b/drivers/wxwidgets_agg.cpp Wed Mar 11 14:25:26 2009 +0100
@@ -24,15 +24,15 @@
  *   is commented out, since there are problems with the affine transformation 
  */
 
+/* wxwidgets headers */
+#include <wx/wx.h>
+#include <wx/strconv.h>
+
 #include "plDevs.h"
 
 /* plplot headers */
 #include "plplotP.h"
 #include "plfci-truetype.h"
-
-/* wxwidgets headers */
-#include <wx/wx.h>
-#include <wx/strconv.h>
    
 /* std and driver headers */
 #include "wxwidgets.h"
diff -r 418239c57d39 drivers/wxwidgets_app.cpp
--- a/drivers/wxwidgets_app.cpp Tue Mar 10 16:33:23 2009 +0100
+++ b/drivers/wxwidgets_app.cpp Wed Mar 11 14:25:26 2009 +0100
@@ -23,6 +23,8 @@
  * - Add dialog to get width and height from user for plot size to save.
  */
 
+/* wxwidgets headers */
+#include "wx/wx.h"
 
 #include "plDevs.h"
 
@@ -33,9 +35,6 @@
 #include "drivers.h"
 #include "plevent.h"
 
-/* wxwidgets headers */
-#include "wx/wx.h"
-    
 /* std and driver headers */
 #include "wxwidgets.h"
 
diff -r 418239c57d39 drivers/wxwidgets_dc.cpp
--- a/drivers/wxwidgets_dc.cpp  Tue Mar 10 16:33:23 2009 +0100
+++ b/drivers/wxwidgets_dc.cpp  Wed Mar 11 14:25:26 2009 +0100
@@ -26,14 +26,14 @@
  * - implement AddToClipRegion for text correctly
  */
 
+/* wxwidgets headers */
+#include <wx/wx.h>
+
 #include "plDevs.h"
 
 /* plplot headers */
 #include "plplotP.h"
 
-/* wxwidgets headers */
-#include <wx/wx.h>
-    
 /* std and driver headers */
 #include <cmath>
 #include "wxwidgets.h"
diff -r 418239c57d39 drivers/wxwidgets_gc.cpp
--- a/drivers/wxwidgets_gc.cpp  Tue Mar 10 16:33:23 2009 +0100
+++ b/drivers/wxwidgets_gc.cpp  Wed Mar 11 14:25:26 2009 +0100
@@ -25,13 +25,13 @@
  * - implement AddToClipRegion for text correctly
  */
 
+/* wxwidgets headers */
+#include <wx/wx.h>
+
 #include "plDevs.h"
 
 /* plplot headers */
 #include "plplotP.h"
-
-/* wxwidgets headers */
-#include <wx/wx.h>
 
 /* std and driver headers */
 #include "wxwidgets.h"

Attachment: pgpoNm1Z3X2Sx.pgp
Description: PGP signature

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to