From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22222 invoked by alias); 26 Aug 2005 00:06:56 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 22207 invoked by uid 22791); 26 Aug 2005 00:06:49 -0000 Received: from plunder.dreamhost.com (HELO plunder.dreamhost.com) (66.33.213.13) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 26 Aug 2005 00:06:49 +0000 Received: from midnight (dib.dreamhost.com [66.33.213.17]) by plunder.dreamhost.com (Postfix) with ESMTP id 057CC86265 for ; Thu, 25 Aug 2005 17:06:46 -0700 (PDT) Date: Fri, 26 Aug 2005 00:06:00 -0000 From: "Daniel Richard G." To: pthreads-win32@sources.redhat.com Subject: [PATCH] Quash CPP build warnings Message-ID: <20050826000633.GA16530@mail.iskunk.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline User-Agent: Mutt/1.5.9i X-SW-Source: 2005/txt/msg00116.txt.bz2 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 609 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) --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ptw32-warnings.patch" Content-length: 2646 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 #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 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 --lrZ03NoBR/3+SXJZ--