diff options
author | rpj <rpj> | 2002-03-02 01:53:08 +0000 |
---|---|---|
committer | rpj <rpj> | 2002-03-02 01:53:08 +0000 |
commit | 44c245b3ed9e82cc44a5ade4a941c99f63174021 (patch) | |
tree | 4a7b209123299d176826442200de02fed08afb7d /pthread.h | |
parent | 8200f6ff1edca15756a22e6359f20836c4b5425b (diff) |
* 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.
Diffstat (limited to 'pthread.h')
-rw-r--r-- | pthread.h | 49 |
1 files changed, 39 insertions, 10 deletions
@@ -197,11 +197,32 @@ #include <setjmp.h> +/* + * 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 <errno.h> +#include <errno.h> #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 <sys/types.h> #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 /* |