|
From: <ai...@us...> - 2014-01-12 02:53:59
|
Revision: 12933
http://sourceforge.net/p/plplot/code/12933
Author: airwin
Date: 2014-01-12 02:53:54 +0000 (Sun, 12 Jan 2014)
Log Message:
-----------
Fix build errors on MinGW.
Modified Paths:
--------------
trunk/bindings/tk/pltkd.h
trunk/bindings/tk/tcpip.c
Modified: trunk/bindings/tk/pltkd.h
===================================================================
--- trunk/bindings/tk/pltkd.h 2014-01-12 02:18:40 UTC (rev 12932)
+++ trunk/bindings/tk/pltkd.h 2014-01-12 02:53:54 UTC (rev 12933)
@@ -21,8 +21,9 @@
#include <dp.h>
#endif
-// Define the type pid_t - a dummy for the moment - for MS Windows
-#if defined ( __WIN32__ )
+// typedef the type pid_t - a dummy for the moment - for MS Windows
+// platforms other than those (e.g., MinGW) that typedef it already.
+#if defined ( __WIN32__ ) && !defined ( __MINGW32__ )
typedef unsigned int pid_t;
#endif
Modified: trunk/bindings/tk/tcpip.c
===================================================================
--- trunk/bindings/tk/tcpip.c 2014-01-12 02:18:40 UTC (rev 12932)
+++ trunk/bindings/tk/tcpip.c 2014-01-12 02:53:54 UTC (rev 12933)
@@ -110,6 +110,19 @@
#endif
#include <errno.h>
+#if defined ( __WIN32__ )
+// This is the source of the WSAEWOULDBLOCK macro on Windows platforms.
+ #include <winerror.h>
+#endif
+
+#if defined ( EWOULDBLOCK )
+ #define PLPLOT_EWOULDBLOCK EWOULDBLOCK
+#elif defined ( WSAEWOULDBLOCK )
+ #define PLPLOT_EWOULDBLOCK WSAEWOULDBLOCK
+#else
+ #error broken system where neither EWOULDBLOCK nor WSAEWOULDBLOCK macros are #defined
+#endif
+
// Supply dummy macros for the low-level I/O functions - Windows
#if defined ( __WIN32__ )
#define read( a, b, c ) 0
@@ -561,7 +574,7 @@
// return a null string.
//
- if ( errno == EWOULDBLOCK || errno == EAGAIN )
+ if ( errno == PLPLOT_EWOULDBLOCK || errno == EAGAIN )
{
Tcl_ResetResult( interp );
return TCL_OK;
@@ -686,7 +699,7 @@
if ( (unsigned) numSent != packetLen )
{
- if ( ( errno == 0 ) || ( errno == EWOULDBLOCK || errno == EAGAIN ) )
+ if ( ( errno == 0 ) || ( errno == PLPLOT_EWOULDBLOCK || errno == EAGAIN ) )
{
//
// Non-blocking I/O: return number of bytes actually sent.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|