[Ecls-list] winsock.h or winsock2.h

Anton Vodonosov avodonosov at yandex.ru
Thu Aug 28 18:35:42 UTC 2008


on Wednesday, August 27, 2008, 11:26:27 AM Juan wrote:

> On Tue, Aug 26, 2008 at 2:36 AM, Anton Vodonosov <avodonosov at yandex.ru> wrote:
>> After I've added #define WIN32_LEAN_AND_MEAN 1 at the
>> top of ecl/config.h, usocket was compiled successfully.

> Thanks, I have added this flag to ecl.h, just before loading windows.h

> Juanjo

Hello, thanks.

But it has two site effects:
- The timeval structure used in scr/c/time.d is declared in winsock.h
- The WIN32_LEAN_AND_MEAN also prevents inclusion of shellapi.h where
  the CommandLineToArgvW function is declared (it is used in
  scr/c/main.d).

With the patch below I have build ECL successfully.

Best regards,
-Anton

Index: src/c/time.d
===================================================================
RCS file: /project/ecl/cvsroot/ecl/src/c/time.d,v
retrieving revision 1.34
diff -U8 -r1.34 time.d
--- src/c/time.d        1 Feb 2008 11:40:42 -0000       1.34
+++ src/c/time.d        28 Aug 2008 18:29:49 -0000
@@ -38,17 +38,17 @@
 #if defined(mingw32) || defined(_MSC_VER)
 #include <windows.h>
 #endif
 
 #ifdef darwin
 #undef HAVE_NANOSLEEP
 #endif
 
-#if !defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_GETRUSAGE) && !defined(_MSC_VER) && !defined(mingw32)
+#if !defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_GETRUSAGE) && !defined(mingw32)
 struct timeval {
        long tv_sec;
        long tv_usec;
 };
 #endif
 
 static struct timeval beginning;
 
Index: src/h/ecl.h
===================================================================
RCS file: /project/ecl/cvsroot/ecl/src/h/ecl.h,v
retrieving revision 1.35
diff -U8 -r1.35 ecl.h
--- src/h/ecl.h 27 Aug 2008 08:25:59 -0000      1.35
+++ src/h/ecl.h 28 Aug 2008 18:29:50 -0000
@@ -54,16 +54,17 @@
 # undef dlclose
 #endif
 #endif
 
 #ifdef ECL_THREADS
 # if defined(_MSC_VER) || defined(mingw32)
 #  define WIN32_LEAN_AND_MEAN 1 /* Do not include winsock.h */
 #  include <windows.h>
+#  include <shellapi.h>
    typedef HANDLE pthread_t;
    typedef HANDLE pthread_mutex_t;
    typedef HANDLE pthread_cond_t; /*Dummy, not really used*/
 #  undef ERROR
 #  ifdef GBC_BOEHM
 #   define CreateThread GC_CreateThread
 #  endif
 # endif






More information about the ecl-devel mailing list