From 3e5f183a8d849cd6df0e224e75190a023c296d04 Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Fri, 8 Sep 2006 17:52:58 +0000 Subject: [PATCH] use LOKI_* macros to check for the including of windows.h/pthread.h git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@700 7ec92016-0320-0410-acc4-a06ded1c099a --- include/loki/Threads.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/loki/Threads.h b/include/loki/Threads.h index e6f78ff..61358e2 100644 --- a/include/loki/Threads.h +++ b/include/loki/Threads.h @@ -68,8 +68,10 @@ #if defined(_WIN32) || defined(_WIN64) #include + #define LOKI_WINDOWS_H #else #include + #define LOKI_PTHREAD_H #endif #else @@ -83,7 +85,7 @@ #define LOKI_DEFAULT_MUTEX ::Loki::Mutex #endif -#if defined(_WINDOWS_) || defined(_WINDOWS_H) +#ifdef LOKI_WINDOWS_H #define LOKI_THREADS_MUTEX(x) CRITICAL_SECTION (x); #define LOKI_THREADS_MUTEX_INIT(x) ::InitializeCriticalSection (x) @@ -107,7 +109,7 @@ -#elif defined(_PTHREAD_H) || defined(_POSIX_PTHREAD_H) //POSIX threads (pthread.h) +#elif defined(LOKI_PTHREAD_H) #define LOKI_THREADS_MUTEX(x) pthread_mutex_t (x); @@ -242,7 +244,7 @@ namespace Loki }; -#if defined(_WINDOWS_) || defined(_WINDOWS_H) || defined(_PTHREAD_H) || defined(_POSIX_PTHREAD_H) +#if defined(LOKI_WINDOWS_H) || defined(LOKI_PTHREAD_H) //////////////////////////////////////////////////////////////////////////////// /// \class ObjectLevelLockable @@ -306,7 +308,7 @@ namespace Loki }; -#if defined(_PTHREAD_H) || defined(_POSIX_PTHREAD_H) +#ifdef LOKI_PTHREAD_H template pthread_mutex_t ObjectLevelLockable::atomic_mutex_ = PTHREAD_MUTEX_INITIALIZER; #endif @@ -391,7 +393,7 @@ namespace Loki }; -#if defined(_PTHREAD_H) || defined(_POSIX_PTHREAD_H) +#ifdef LOKI_PTHREAD_H template pthread_mutex_t ClassLevelLockable::atomic_mutex_ = PTHREAD_MUTEX_INITIALIZER; #endif @@ -400,7 +402,7 @@ namespace Loki typename ClassLevelLockable< Host, MutexPolicy >::Initializer ClassLevelLockable< Host, MutexPolicy >::initializer_; -#endif // defined(_WINDOWS_) || defined(_WINDOWS_H) || defined(_PTHREAD_H) || defined(_POSIX_PTHREAD_H) +#endif // #if defined(LOKI_WINDOWS_H) || defined(LOKI_PTHREAD_H) } // namespace Loki @@ -416,6 +418,9 @@ namespace Loki #endif // $Log$ +// Revision 1.33 2006/09/08 17:52:58 syntheticpp +// use LOKI_* macros to check for the including of windows.h/pthread.h +// // Revision 1.32 2006/07/03 08:43:35 syntheticpp // add docu about missing recursive mutex support when using pthreads //