]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixes & Hacks to make sockets compile on CYGWIN with windows enabled
authorRyan Norton <wxprojects@comcast.net>
Sun, 10 Apr 2005 06:33:26 +0000 (06:33 +0000)
committerRyan Norton <wxprojects@comcast.net>
Sun, 10 Apr 2005 06:33:26 +0000 (06:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h
include/wx/msw/gsockmsw.h
include/wx/sckaddr.h

index 23155b313e1786961d3617bb4bff7b784cdd8297..dd50006e2d1c8db99cfdb978a134d110352b2645 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "wx/platform.h"
 
-/*  RN - only double-check the environment when building in C++
-    Shouldn't configure pass the environment to all sub-libs too? */
 #ifdef __cplusplus
 /*  Make sure the environment is set correctly */
 #   if defined(__WXMSW__) && defined(__X__)
@@ -2248,6 +2246,15 @@ enum wxUpdateUI
 #   define wxALL_FILES           gettext_noop("All files (*)|*")
 #endif
 
+#   if wxUSE_STL || defined(wxUSE_STD_STRING)
+         //NASTY HACK because the gethostname in sys/unistd.h which the gnu stl includes
+         //and wx builds with by default clash with each other (windows version
+         //2nd param is int, sys/unistd.h version is unsigned int).  
+#        define gethostname gethostnameHACK
+#        include <unistd.h>
+#        undef gethostname
+#   endif
+
 /*  --------------------------------------------------------------------------- */
 /*  macros that enable wxWidgets apps to be compiled in absence of the */
 /*  sytem headers, although some platform specific types are used in the */
index 346a23c4c1335be8b84b483f1dcacaba493de408..60573eeda0754536113429648c6bfda016fc9b57 100644 (file)
 
 #include "wx/msw/wrapwin.h"
 
-#if defined(__WXWINCE__)
+#if defined(__CYGWIN__)
+    //CYGWIN gives annoying warning about runtime stuff if we don't do this
+#   define USE_SYS_TYPES_FD_SET
+#   include <sys/types.h>
+#endif
+
+#if defined(__WXWINCE__) || defined(__CYGWIN__)
 #include <winsock.h>
 #endif
 
index 4f71207fd303cfc923a23d68fea81e8b65b1f2bd..b0bc278ffe853e2e37659e129018b6a197d2217b 100644 (file)
@@ -160,7 +160,7 @@ public:
 
 #endif // wxUSE_IPV6
 
-#if defined(__UNIX__) && !defined(__WINE__) && (!defined(__WXMAC__) || defined(__DARWIN__))
+#if defined(__UNIX__) && !defined(__WINE__) && (!defined(__WXMAC__) || defined(__DARWIN__)) && !defined(__CYGWIN__)
 #include <sys/socket.h>
 #ifndef __VMS__
 # include <sys/un.h>