public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Quash CPP build warnings
@ 2005-08-26  0:06 Daniel Richard G.
  0 siblings, 0 replies; only message in thread
From: Daniel Richard G. @ 2005-08-26  0:06 UTC (permalink / raw)
  To: pthreads-win32

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

The attached patch, against pthread.h and sched.h, eliminates a number of 
warnings of the form

	...\pthread.h(950) : warning C4668: 'PTW32_LEVEL' is not defined as
	  a preprocessor macro, replacing with '0' for '#if/#elif'

when compiling with the MSVC toolchain and "-W4 -Wall".


--Daniel


-- 
NAME   = Daniel Richard G.       ##  Remember, skunks       _\|/_  meef?
EMAIL1 = skunk@iskunk.org        ##  don't smell bad---    (/o|o\) /
EMAIL2 = skunk@alum.mit.edu      ##  it's the people who   < (^),>
WWW    = http://www.******.org/  ##  annoy them that do!    /   \
--
(****** = site not yet online)

[-- Attachment #2: ptw32-warnings.patch --]
[-- Type: text/plain, Size: 2646 bytes --]

Index: pthread.h
===================================================================
RCS file: /cvs/pthreads-win32/pthreads/pthread.h,v
retrieving revision 1.134
diff -u -b -r1.134 pthread.h
--- pthread.h	3 Jun 2005 08:36:28 -0000	1.134
+++ pthread.h	25 Aug 2005 23:26:21 -0000
@@ -210,7 +210,7 @@
  * -----------------
  */
 
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
@@ -220,7 +220,7 @@
 /* use native WIN32 time API */
 #endif /* NEED_FTIME */
 
-#if HAVE_SIGNAL_H
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
 #endif /* HAVE_SIGNAL_H */
 
@@ -523,7 +523,7 @@
 #define SEM_VALUE_MAX                           INT_MAX
 
 
-#if __GNUC__ && ! defined (__declspec)
+#if defined (__GNUC__) && ! defined (__declspec)
 # error Please upgrade your GNU compiler to one that supports __declspec.
 #endif
 
@@ -947,7 +947,7 @@
 PTW32_DLLPORT int PTW32_CDECL pthread_once (pthread_once_t * once_control,
                           void (*init_routine) (void));
 
-#if PTW32_LEVEL >= PTW32_LEVEL_MAX
+#if defined(PTW32_LEVEL) && PTW32_LEVEL >= PTW32_LEVEL_MAX
 PTW32_DLLPORT ptw32_cleanup_t * PTW32_CDECL ptw32_pop_cleanup (int execute);
 
 PTW32_DLLPORT void PTW32_CDECL ptw32_push_cleanup (ptw32_cleanup_t * cleanup,
@@ -1122,7 +1122,7 @@
 PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr,
                                            int pshared);
 
-#if PTW32_LEVEL >= PTW32_LEVEL_MAX - 1
+#if defined(PTW32_LEVEL) && PTW32_LEVEL >= PTW32_LEVEL_MAX - 1
 
 /*
  * Signal Functions. Should be defined in <signal.h> but MSVC and MinGW32
@@ -1176,9 +1176,9 @@
  */
 PTW32_DLLPORT void * PTW32_CDECL pthread_timechange_handler_np(void *);
 
-#endif /*PTW32_LEVEL >= PTW32_LEVEL_MAX - 1 */
+#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX - 1 */
 
-#if PTW32_LEVEL >= PTW32_LEVEL_MAX
+#if defined(PTW32_LEVEL) && PTW32_LEVEL >= PTW32_LEVEL_MAX
 
 /*
  * Returns the Win32 HANDLE for the POSIX thread.
@@ -1276,7 +1276,7 @@
 
 #endif
 
-#if PTW32_LEVEL >= PTW32_LEVEL_MAX
+#if defined(PTW32_LEVEL) && PTW32_LEVEL >= PTW32_LEVEL_MAX
 
 /* FIXME: This is only required if the library was built using SEH */
 /*
Index: sched.h
===================================================================
RCS file: /cvs/pthreads-win32/pthreads/sched.h,v
retrieving revision 1.16
diff -u -b -r1.16 sched.h
--- sched.h	1 Apr 2005 00:55:21 -0000	1.16
+++ sched.h	25 Aug 2005 23:26:21 -0000
@@ -66,7 +66,7 @@
 #endif
 
 
-#if __GNUC__ && ! defined (__declspec)
+#if defined (__GNUC__) && ! defined (__declspec)
 # error Please upgrade your GNU compiler to one that supports __declspec.
 #endif
 

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

only message in thread, other threads:[~2005-08-26  0:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-26  0:06 [PATCH] Quash CPP build warnings Daniel Richard G.

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).