glthread/*, strsignal: Support for MSVC.
authorBruno Haible <bruno@clisp.org>
Mon, 3 Oct 2011 23:19:29 +0000 (01:19 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 3 Oct 2011 23:19:29 +0000 (01:19 +0200)
* lib/glthread/cond.h: Define WIN32_LEAN_AND_MEAN, so as to avoid
including <winsock.h> on MSVC 9.
* lib/glthread/lock.h: Likewise.
* lib/glthread/thread.h: Likewise.
* lib/glthread/tls.h: Likewise.
* lib/glthread/yield.h: Likewise.
* lib/strsignal.c: Include <string.h> first. Don't include <unistd.h>
if HAVE_UNISTD_H is false.
* m4/strsignal.m4 (gl_PREREQ_STRSIGNAL): Test for <unistd.h>.

ChangeLog
lib/glthread/cond.h
lib/glthread/lock.h
lib/glthread/thread.h
lib/glthread/tls.h
lib/glthread/yield.h
lib/strsignal.c
m4/strsignal.m4

index 7f9e391..7bacbfe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2011-10-03  Bruno Haible  <bruno@clisp.org>
 
+       glthread/*, strsignal: Support for MSVC.
+       * lib/glthread/cond.h: Define WIN32_LEAN_AND_MEAN, so as to avoid
+       including <winsock.h> on MSVC 9.
+       * lib/glthread/lock.h: Likewise.
+       * lib/glthread/thread.h: Likewise.
+       * lib/glthread/tls.h: Likewise.
+       * lib/glthread/yield.h: Likewise.
+       * lib/strsignal.c: Include <string.h> first. Don't include <unistd.h>
+       if HAVE_UNISTD_H is false.
+       * m4/strsignal.m4 (gl_PREREQ_STRSIGNAL): Test for <unistd.h>.
+
+2011-10-03  Bruno Haible  <bruno@clisp.org>
+
        nonblocking tests: Fix test failure on OpenBSD/SPARC64.
        * tests/test-nonblocking-socket.h (SOCKET_DATA_BLOCK_SIZE) [OpenBSD]:
        Set to 100000.
index dc97646..e205045 100644 (file)
@@ -271,6 +271,7 @@ extern int glthread_cond_timedwait_multithreaded (gl_cond_t *cond, gl_lock_t *lo
 
 #if USE_WIN32_THREADS
 
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
 # ifdef __cplusplus
index 2095413..f764d14 100644 (file)
@@ -616,6 +616,7 @@ extern int glthread_once_singlethreaded (gl_once_t *once_control);
 
 #if USE_WIN32_THREADS
 
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
 # ifdef __cplusplus
index 3d7f760..be13ed9 100644 (file)
@@ -292,6 +292,7 @@ typedef thread_t gl_thread_t;
 
 #if USE_WIN32_THREADS
 
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
 # ifdef __cplusplus
index 0ef32c0..4f39986 100644 (file)
@@ -222,6 +222,7 @@ extern void *glthread_tls_get_multithreaded (thread_key_t key);
 
 #if USE_WIN32_THREADS
 
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
 /* ------------------------- gl_tls_key_t datatype ------------------------- */
index 6911d02..0482315 100644 (file)
@@ -91,6 +91,7 @@ extern "C" {
 
 #if USE_WIN32_THREADS
 
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
 # ifdef __cplusplus
index 5a415ca..7caab1d 100644 (file)
 # include <config.h>
 #endif
 
+/* Specification.  */
+#include <string.h>
+
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #ifdef _LIBC
 # include <libintl.h>
@@ -54,7 +56,9 @@ extern const char *const _sys_siglist_internal[] attribute_hidden;
 #else /* !_LIBC */
 
 /* NetBSD declares sys_siglist in unistd.h. */
-# include <unistd.h>
+# if HAVE_UNISTD_H
+#  include <unistd.h>
+# endif
 
 # define INTUSE(x) (x)
 
index 9c9c411..f4b0143 100644 (file)
@@ -1,4 +1,4 @@
-# strsignal.m4 serial 7
+# strsignal.m4 serial 8
 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -53,6 +53,7 @@ AC_DEFUN([gl_FUNC_STRSIGNAL],
 
 # Prerequisites of lib/strsignal.c.
 AC_DEFUN([gl_PREREQ_STRSIGNAL], [
+  AC_CHECK_HEADERS_ONCE([unistd.h])
   AC_REQUIRE([AC_DECL_SYS_SIGLIST])
   AC_CHECK_DECLS([_sys_siglist], [], [], [[#include <signal.h>]])
 ])