]> Savannah Git Hosting - gnulib.git/commitdiff
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 7f9e391f619a12da054b9cf3c1db3bcd3667ac4c..7bacbfe8a1ed50cb024799af357241efd36d336a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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.
index dc976468a7a33020d60bbec467f7704d5a505577..e2050458a7f6512e675df1f00d4705e03eda6460 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 20954133aab33e8ccb71d40784135b01917ca30b..f764d141b04e21ca1005104b6bff7e0507c87d68 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 3d7f7601d100f5faf5eef721b46043a2d73a9346..be13ed972ce733210abe546bc9f2121d18e98765 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 0ef32c0171531eae45ce4f5a797eac564669da3a..4f3998690f42ef6d27b825ddbc00a46261431ae2 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 6911d02f2a42cfb18516dff77746873b9ab7f42c..04823151cc6072a65374c3610ca451a14c84c968 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 5a415ca714413797669b58a33b8999fa8f2864de..7caab1d45c6c3fa5e98151f0dc4f610edda6166d 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 9c9c4110baff7254d0a50d6c4248e3837cf7256b..f4b0143355a3276ae3cd83eb877b7274295230a3 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>]])
 ])