Fix Cygwin 1.7 build.

Avoid using Cygwin sockets as our code assumes that we use WinSock API under
Windows currently (this might change in the future) by defining
__USE_W32_SOCKETS.

Use new, safer and more efficient cygwin_conv_path() function.

Use t_str() instead of fn_str() with Windows API taking file names, under
Cygwin they are different and using fn_str() is incorrect.

A few other minor fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-07-23 23:32:46 +00:00
parent 3d4e20dd0b
commit 715e4f7e3e
15 changed files with 67 additions and 28 deletions

View File

@@ -497,7 +497,7 @@ protected:
wxDECLARE_NO_COPY_CLASS(wxAppConsoleBase);
};
#if defined(__UNIX__)
#if defined(__UNIX__) && !defined(__CYGWIN__)
#include "wx/unix/app.h"
#else
// this has to be a class and not a typedef as we forward declare it

View File

@@ -193,6 +193,12 @@
#define va_list __gnuc_va_list
#endif /* HP-UX */
/* Prevents conflicts between sys/types.h and winsock.h with Cygwin, */
/* when using Windows sockets. */
#if defined(__CYGWIN__) && (__WXMSW__)
#define __USE_W32_SOCKETS
#endif
/* ---------------------------------------------------------------------------- */
/* check for native bool type and TRUE/FALSE constants */
/* ---------------------------------------------------------------------------- */

View File

@@ -17,7 +17,7 @@
// TODO: implement wxEventLoopSource for MSW (it should wrap a HANDLE and be
// monitored using MsgWaitForMultipleObjects())
#if defined(__WXOSX__) || defined(__UNIX__)
#if defined(__WXOSX__) || (defined(__UNIX__) && !defined(__CYGWIN__))
#define wxUSE_EVENTLOOP_SOURCE 1
#else
#define wxUSE_EVENTLOOP_SOURCE 0
@@ -310,7 +310,7 @@ protected:
#endif // wxUSE_GUI
// include the header defining wxConsoleEventLoop for Unix systems
#if defined(__UNIX__)
#if defined(__UNIX__) && !defined(__CYGWIN__)
#include "wx/unix/evtloop.h"
#endif

View File

@@ -578,7 +578,8 @@ inline int wxLstat(const wxString& path, wxStructStat *buf)
{ return wxCRT_Lstat(path.fn_str(), buf); }
inline int wxRmDir(const wxString& path)
{ return wxCRT_RmDir(path.fn_str()); }
#if defined(__WINDOWS__) || (defined(__OS2__) && defined(__WATCOMC__))
#if (defined(__WINDOWS__) && !defined(__CYGWIN__)) \
|| (defined(__OS2__) && defined(__WATCOMC__))
inline int wxMkDir(const wxString& path, mode_t WXUNUSED(mode) = 0)
{ return wxCRT_MkDir(path.fn_str()); }
#else