On 22/10/2012 18:49, Yaakov (Cygwin/X) wrote:
> On Mon, 2012-10-22 at 16:07 +0100, Jon TURNEY wrote:
>> diff --git a/src/TextAction.c b/src/TextAction.c
>> index 7b87ce4..74446d6 100644
>> --- a/src/TextAction.c
>> +++ b/src/TextAction.c
>> @@ -47,6 +47,10 @@ in this Software without prior written authorization from 
>> The Open Group.
>>  #include "Private.h"
>>  #include "XawI18n.h"
>>  
>> +#ifdef _WIN32
>> +#include <X11/Xwinsock.h>
>> +#endif
>> +
>>  #define SrcScan                     XawTextSourceScan
>>  #define FindDist            XawTextSinkFindDistance
>>  #define FindPos                     XawTextSinkFindPosition
> 
> This also requires adding -lws2_32 as with libXt.

I was planning to do another set of patches which to add dl/pthread/ws2_32
where needed, but I suppose it makes sense here to add it with this.








>From 35916ef68bb7bd41e25c2fd9f0ea1812854a000e Mon Sep 17 00:00:00 2001
From: Ryan Pavlik <rpav...@iastate.edu>
Date: Mon, 2 Jan 2012 03:11:59 +0000
Subject: [PATCH lib/libXaw] Include winsock header on WIN32 to provide fd_set
 etc.

v2: also link with ws2_32 on MinGW

Signed-off-by: Ryan Pavlik <rpav...@iastate.edu>
Reviewed-by: Jon TURNEY <jon.tur...@dronecode.org.uk>
---
 configure.ac     |    9 +++++++++
 src/TextAction.c |    4 ++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3ed625e..d6b4fba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,6 +98,15 @@ AC_CHECK_HEADERS([wctype.h wchar.h widec.h])
 # Checks for functions
 AC_CHECK_FUNCS([iswalnum getpagesize])
 
+# Link with winsock if mingw target
+case $host_os in
+       *mingw*)
+               AC_CHECK_LIB([ws2_32],[main])
+       ;;
+       *)
+       ;;
+esac
+
 AC_CONFIG_FILES([Makefile
                include/Makefile
                man/Makefile
diff --git a/src/TextAction.c b/src/TextAction.c
index 7b87ce4..74446d6 100644
--- a/src/TextAction.c
+++ b/src/TextAction.c
@@ -47,6 +47,10 @@ in this Software without prior written authorization from 
The Open Group.
 #include "Private.h"
 #include "XawI18n.h"
 
+#ifdef _WIN32
+#include <X11/Xwinsock.h>
+#endif
+
 #define SrcScan                        XawTextSourceScan
 #define FindDist               XawTextSinkFindDistance
 #define FindPos                        XawTextSinkFindPosition
-- 
1.7.9

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to