From 44c245b3ed9e82cc44a5ade4a941c99f63174021 Mon Sep 17 00:00:00 2001 From: rpj Date: Sat, 2 Mar 2002 01:53:08 +0000 Subject: * errno.c: Compiler directive was incorrectly including code. * pthread.h: Conditionally added some #defines from config.h needed when not building the library. e.g. NEED_ERRNO, NEED_SEM. (PTW32_DLLPORT): Now only defined if _DLL defined. (_errno): Compiler directive was incorrectly including prototype. * sched.h: Conditionally added some #defines from config.h needed when not building the library. * semaphore.h: Replace an instance of NEED_SEM that should have been NEED_ERRNO. This change currently has nil effect. * GNUmakefile: Correct some recent changes. * Makefile: Add rule to generate pre-processor output. --- pthread.h | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) (limited to 'pthread.h') diff --git a/pthread.h b/pthread.h index e197ebe..3e37f81 100644 --- a/pthread.h +++ b/pthread.h @@ -197,11 +197,32 @@ #include +/* + * This is a duplicate of what is in the autoconf config.h, + * which is only used when building the pthread-win32 libraries. + */ + +#ifndef PTW32_CONFIG_H +# if defined(WINCE) +# define NEED_ERRNO +# define NEED_SEM +# endif +# if defined(_UWIN) || defined(__MINGW32__) +# define HAVE_MODE_T +# endif +#endif + +/* + * + */ + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX #ifdef NEED_ERRNO -# include "need_errno.h" +#include "need_errno.h" #else -# include +#include #endif +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ /* * Several systems don't define ENOTSUP. If not, we use @@ -447,13 +468,14 @@ extern "C" * do NOT define PTW32_BUILD, and then the variables/functions will * be imported correctly. */ -#ifdef PTW32_BUILD -# define PTW32_DLLPORT __declspec (dllexport) -#else -# define PTW32_DLLPORT __declspec (dllimport) +#ifdef _DLL +# ifdef PTW32_BUILD +# define PTW32_DLLPORT __declspec (dllexport) +# else +# define PTW32_DLLPORT __declspec (dllimport) +# endif #endif - #if defined(_UWIN) && PTW32_LEVEL >= PTW32_LEVEL_MAX # include #else @@ -1104,9 +1126,16 @@ PTW32_DLLPORT int pthreadCancelableTimedWait (HANDLE waitHandle, * Thread-Safe C Runtime Library Mappings. */ #ifndef _UWIN -#if (! defined(HAVE_ERRNO)) && (! defined(_REENTRANT)) && (! defined(_MT)) -PTW32_DLLPORT int * _errno( void ); -#endif +# if defined(NEED_ERRNO) + PTW32_DLLPORT int * _errno( void ); +# else +# ifndef errno +# if (defined(_MT) || defined(_DLL)) + __declspec(dllimport) extern int * __cdecl _errno(void); +# define errno (*_errno()) +# endif +# endif +# endif #endif /* -- cgit v1.2.3