From 7acf6a921e69c3382706c2cfc35e826d08004231 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 17 Mar 2005 12:43:15 +0000 Subject: [PATCH] Small fixes for compiling Cygwin (with --disable-sockets) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/msw/install.txt | 4 +++- include/wx/msw/gsockmsw.h | 2 +- include/wx/textctrl.h | 2 +- src/generic/dirctrlg.cpp | 1 + src/generic/helpext.cpp | 1 + src/generic/scrlwing.cpp | 1 + src/msw/utils.cpp | 6 +++--- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/msw/install.txt b/docs/msw/install.txt index 391ad16480..26eb31c899 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.txt @@ -326,7 +326,7 @@ Metrowerks CodeWarrior compilation Cygwin/MinGW compilation ------------------------ -wxWidgets 2 supports Cygwin (formerly GnuWin32) betas and +wxWidgets supports Cygwin (formerly GnuWin32) betas and releases, and MinGW. Cygwin can be downloaded from: http://sources.redhat.com/cygwin/ @@ -339,6 +339,8 @@ Both Cygwin and MinGW can be used with configure (assuming you have MSYS installed in case of MinGW). You will need new enough MinGW version, preferably MinGW 2.0 (ships with gcc3) or at least 1.0 (gcc-2.95.3). GCC versions older than 2.95.3 don't work; you can use wxWidgets 2.4 with them. +If using Cygwin, you must pass --disable-sockets to configure due to a header +conflict in Cygwin. NOTE: some notes specific to old Cygwin (< 1.1.x) are at the end of this section (see OLD VERSIONS) diff --git a/include/wx/msw/gsockmsw.h b/include/wx/msw/gsockmsw.h index 0fb678a3f0..346a23c4c1 100644 --- a/include/wx/msw/gsockmsw.h +++ b/include/wx/msw/gsockmsw.h @@ -23,7 +23,7 @@ #include "wx/msw/wrapwin.h" -#ifdef __WXWINCE__ +#if defined(__WXWINCE__) #include #endif diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index 29806404bd..f56d0197ad 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -282,7 +282,7 @@ public: virtual bool IsEditable() const = 0; // more readable flag testing methods - bool IsSingleLine() const { return !(GetWindowStyle() & wxTE_MULTILINE); } + bool IsSingleLine() const { return !HasFlag(wxTE_MULTILINE); } bool IsMultiLine() const { return !IsSingleLine(); } // If the return values from and to are the same, there is no selection. diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index d817f24c58..3a7e8ef87a 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -57,6 +57,7 @@ #ifdef __WXMSW__ #include +#include "wx/msw/winundef.h" // FIXME - Mingw32 1.0 has both _getdrive() and _chdrive(). For now, let's assume // older releases don't, but it should be verified and the checks modified diff --git a/src/generic/helpext.cpp b/src/generic/helpext.cpp index 9f4ef3d109..49dae623f0 100644 --- a/src/generic/helpext.cpp +++ b/src/generic/helpext.cpp @@ -45,6 +45,7 @@ #ifdef __WXMSW__ #include +#include "wx/msw/winundef.h" #endif // ---------------------------------------------------------------------------- diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index 606207d260..79b5717aec 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -48,6 +48,7 @@ #ifdef __WXMSW__ #include // for DLGC_WANTARROWS + #include "wx/msw/winundef.h" #endif #ifdef __WXMOTIF__ diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 154b699677..df79917cf4 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -40,8 +40,8 @@ #include "wx/msw/private.h" // includes #include "wx/msw/missing.h" // CHARSET_HANGUL -#if defined(__GNUWIN32_OLD__) || defined(__WXWINCE__) \ - || defined(__CYGWIN32__) +// Doesn't work with Cygwin at present +#if wxUSE_SOCKETS && (defined(__GNUWIN32_OLD__) || defined(__WXWINCE__) || defined(__CYGWIN32__)) // apparently we need to include winsock.h to get WSADATA and other stuff // used in wxGetFullHostName() with the old mingw32 versions #include @@ -148,7 +148,7 @@ bool wxGetHostName(wxChar *buf, int maxSize) // get full hostname (with domain name if possible) bool wxGetFullHostName(wxChar *buf, int maxSize) { -#if !defined( __WXMICROWIN__) && wxUSE_DYNAMIC_LOADER +#if !defined( __WXMICROWIN__) && wxUSE_DYNAMIC_LOADER && wxUSE_SOCKETS // TODO should use GetComputerNameEx() when available // we don't want to always link with Winsock DLL as we might not use it at -- 2.45.2