public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* #define WIN32_LEAN_AND_MEAN
@ 2005-06-20  8:16 Steffen Goeldner
  0 siblings, 0 replies; only message in thread
From: Steffen Goeldner @ 2005-06-20  8:16 UTC (permalink / raw)
  To: pthreads-win32

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

To speed the build process, avoid possible name clashes etc.,
one #includes only necessary header files.
However, once you need <windows.h>, it opens the floodgates.

To exclude rarely-used Windows header files, I added

    #define WIN32_LEAN_AND_MEAN 1

to implement.h, pthread.h and various test files - see

    <http://support.microsoft.com/default.aspx?scid=kb;en-us;166474>

for details.
Now, we have to be explicit if we need additional Windows header
files, e.g. <winsock.h> in cancel9.c.
Similar for <stdlib.h>.


Steffen Goeldner

[-- Attachment #2: pthreads-w32-2-7-0-release.diff --]
[-- Type: text/plain, Size: 2827 bytes --]

diff -ubr pthreads-w32-2-7-0-release-orig/implement.h pthreads-w32-2-7-0-release/implement.h
--- pthreads-w32-2-7-0-release-orig/implement.h	Fri Jun 03 10:36:27 2005
+++ pthreads-w32-2-7-0-release/implement.h	Fri Jun 17 15:02:14 2005
@@ -43,6 +43,7 @@
 #endif
 #define _WIN32_WINNT 0x400

+#define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>

 /*
diff -ubr pthreads-w32-2-7-0-release-orig/pthread.h pthreads-w32-2-7-0-release/pthread.h
--- pthreads-w32-2-7-0-release-orig/pthread.h	Fri Jun 03 10:36:28 2005
+++ pthreads-w32-2-7-0-release/pthread.h	Fri Jun 17 15:02:50 2005
@@ -195,6 +195,7 @@
 #endif

 #ifdef PTW32_INCLUDE_WINDOWS_H
+#define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>
 #endif

diff -ubr pthreads-w32-2-7-0-release-orig/tests/benchlib.c pthreads-w32-2-7-0-release/tests/benchlib.c
--- pthreads-w32-2-7-0-release-orig/tests/benchlib.c	Sat Jan 01 15:36:18 2005
+++ pthreads-w32-2-7-0-release/tests/benchlib.c	Fri Jun 17 15:39:36 2005
@@ -37,8 +37,10 @@
 #include "pthread.h"
 #include "sched.h"
 #include "semaphore.h"
+#define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>
 #include <stdio.h>
+#include <stdlib.h>

 #ifdef __GNUC__
 #include <stdlib.h>
diff -ubr pthreads-w32-2-7-0-release-orig/tests/cancel9.c pthreads-w32-2-7-0-release/tests/cancel9.c
--- pthreads-w32-2-7-0-release-orig/tests/cancel9.c	Wed May 18 16:34:19 2005
+++ pthreads-w32-2-7-0-release/tests/cancel9.c	Fri Jun 17 15:33:07 2005
@@ -73,7 +73,9 @@
  */

 #include "test.h"
+#define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>
+#include <winsock.h>


 void *
diff -ubr pthreads-w32-2-7-0-release-orig/tests/test.h pthreads-w32-2-7-0-release/tests/test.h
--- pthreads-w32-2-7-0-release-orig/tests/test.h	Thu Apr 28 06:41:29 2005
+++ pthreads-w32-2-7-0-release/tests/test.h	Fri Jun 17 15:27:55 2005
@@ -42,8 +42,10 @@
 #include "sched.h"
 #include "semaphore.h"

+#define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>
 #include <stdio.h>
+#include <stdlib.h>

 #define PTW32_THREAD_NULL_ID {NULL,0}

diff -ubr pthreads-w32-2-7-0-release-orig/tests/tryentercs.c pthreads-w32-2-7-0-release/tests/tryentercs.c
--- pthreads-w32-2-7-0-release-orig/tests/tryentercs.c	Sat Jan 01 15:36:19 2005
+++ pthreads-w32-2-7-0-release/tests/tryentercs.c	Fri Jun 17 15:13:15 2005
@@ -37,6 +37,7 @@
  * Does not use any part of pthreads.
  */

+#define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>
 #include <process.h>
 #include <stdio.h>
diff -ubr pthreads-w32-2-7-0-release-orig/tests/tryentercs2.c pthreads-w32-2-7-0-release/tests/tryentercs2.c
--- pthreads-w32-2-7-0-release-orig/tests/tryentercs2.c	Sat Jan 01 15:36:19 2005
+++ pthreads-w32-2-7-0-release/tests/tryentercs2.c	Fri Jun 17 15:13:23 2005
@@ -37,6 +37,7 @@
  * Does not use any part of pthreads.
  */

+#define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>
 #include <process.h>
 #include <stdio.h>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-06-20  8:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-20  8:16 #define WIN32_LEAN_AND_MEAN Steffen Goeldner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).