From e3b9cdb19f2384bbcbd443c14c2e9fad36d73b25 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 7 Sep 2009 08:47:09 +0000 Subject: [PATCH] 2009-09-07 10:46 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/hbsocket.c ! fixed compilation with WATT-32 in OpenWatcom DOS builds --- harbour/ChangeLog | 4 ++++ harbour/source/rtl/hbsocket.c | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0a02782392..60e51d55c0 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,10 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-07 10:46 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/hbsocket.c + ! fixed compilation with WATT-32 in OpenWatcom DOS builds + 2009-09-07 09:03 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL + Added "Embarcadero" to Borland compiler description. diff --git a/harbour/source/rtl/hbsocket.c b/harbour/source/rtl/hbsocket.c index 19c342d4cc..044cf7f4e7 100644 --- a/harbour/source/rtl/hbsocket.c +++ b/harbour/source/rtl/hbsocket.c @@ -163,6 +163,10 @@ #else # include # if defined( HB_OS_DOS ) +# if defined( __WATCOMC__ ) + /* workaround for declaration conflicts in tcp.h */ +# define _GETOPT_H +# endif # include # elif defined( HB_OS_OS2 ) # if defined( __WATCOMC__ ) @@ -172,7 +176,9 @@ # include # include # endif -# include +# if !( defined( HB_OS_DOS ) && defined( __WATCOMC__ ) ) +# include +# endif # include # include # include @@ -184,6 +190,7 @@ # include # include # if defined( HB_OS_DOS ) +# include # define select select_s # endif #endif @@ -2298,6 +2305,12 @@ int hb_socketSetBlockingIO( HB_SOCKET sd, BOOL fBlocking ) hb_socketSetOsError( ret != -1 ? 0 : HB_SOCK_GETERROR() ); if( ret == 0 ) ret = 1; +#elif defined( HB_OS_DOS ) + int mode = fBlocking ? 0 : 1; + ret = ioctlsocket( sd, FIONBIO, ( char * ) &mode ); + hb_socketSetOsError( ret != -1 ? 0 : HB_SOCK_GETERROR() ); + if( ret == 0 ) + ret = 1; #elif defined( O_NONBLOCK ) ret = fcntl( sd, F_GETFL, 0 ); if( ret != -1 )