Hi all,

recently, I proposed a patch to fix a definition collision for "struct timeval" in src/c/time.d. While this fixed the build problem for the default settings in msvc/Makefile, apparently it broke the ECL_THREADS build - sorry for this!

src/h/ecl.h includes windows.h as follows:

#ifdef ECL_THREADS
# if defined(_MSC_VER) || defined(mingw32)
#  define WIN32_LEAN_AND_MEAN 1 /* Do not include winsock.h */
#  include <windows.h>
...

WIN32_LEAN_AND_MEAN is set to prevent windows.h from including WinSock.h. WinSock.h contains, among many other things, the declaration for "struct timeval". src/c/time.d needs this definition, and therefore includes windows.h, which in turn includes WinSock.h - but not if WIN32_LEAN_AND_MEAN is set! Hence, "struct timeval" is never defined, and time.d won't compile.

Setting WIN32_LEAN_AND_MEAN generally is a good idea because it reduces build times. Therefore, I didn't change ecl.h, but instead applied a local fix in src/c/time.d:

===================================================================
RCS file: /cvsroot/ecls/ecl/src/c/time.d,v
retrieving revision 1.36
diff -c -r1.36 time.d
*** src/c/time.d        19 Sep 2008 17:23:30 -0000      1.36
--- src/c/time.d        25 Sep 2008 20:21:32 -0000
***************
*** 36,42 ****
  #endif
  #include <ecl/internal.h>
  #if defined(mingw32) || defined(_MSC_VER)
! #include <windows.h>
  #endif

  #ifdef darwin
--- 36,43 ----
  #endif
  #include <ecl/internal.h>
  #if defined(mingw32) || defined(_MSC_VER)
! # include <windows.h>
! # include <WinSock.h>
  #endif


---

Claus

http://www.clausbrod.de/Blog