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/
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)
#include "wx/msw/wrapwin.h"
-#ifdef __WXWINCE__
+#if defined(__WXWINCE__)
#include <winsock.h>
#endif
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.
#ifdef __WXMSW__
#include <windows.h>
+#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
#ifdef __WXMSW__
#include <windows.h>
+#include "wx/msw/winundef.h"
#endif
// ----------------------------------------------------------------------------
#ifdef __WXMSW__
#include <windows.h> // for DLGC_WANTARROWS
+ #include "wx/msw/winundef.h"
#endif
#ifdef __WXMOTIF__
#include "wx/msw/private.h" // includes <windows.h>
#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 <winsock.h>
// 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