diff options
author | Chris Robinson <[email protected]> | 2007-11-30 03:04:10 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2007-11-30 03:04:10 -0800 |
commit | 29edd5c7ee08790f5a90ce5d6c52577578de74ef (patch) | |
tree | 1d0ef34b24ac150830134eb1abdb77a1d801aa70 | |
parent | 87242c6ab35de42c4842e30ae70b433e108741bd (diff) |
Fix use of assert() to properly handle NDEBUG
-rw-r--r-- | OpenAL32/Include/alMain.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 9957a741..4c63ef6b 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -22,27 +22,37 @@ typedef pthread_mutex_t CRITICAL_SECTION; static inline void EnterCriticalSection(CRITICAL_SECTION *cs) { - assert(pthread_mutex_lock(cs) == 0); + int ret; + ret = pthread_mutex_lock(cs); + assert(ret == 0); } static inline void LeaveCriticalSection(CRITICAL_SECTION *cs) { - assert(pthread_mutex_unlock(cs) == 0); + int ret; + ret = pthread_mutex_unlock(cs); + assert(ret == 0); } static inline void InitializeCriticalSection(CRITICAL_SECTION *cs) { pthread_mutexattr_t attrib; + int ret; - assert(pthread_mutexattr_init(&attrib) == 0); + ret = pthread_mutexattr_init(&attrib); + assert(ret == 0); - assert(pthread_mutexattr_settype(&attrib, PTHREAD_MUTEX_RECURSIVE) == 0); - assert(pthread_mutex_init(cs, &attrib) == 0); + ret = pthread_mutexattr_settype(&attrib, PTHREAD_MUTEX_RECURSIVE); + assert(ret == 0); + ret = pthread_mutex_init(cs, &attrib); + assert(ret == 0); pthread_mutexattr_destroy(&attrib); } static inline void DeleteCriticalSection(CRITICAL_SECTION *cs) { - assert(pthread_mutex_destroy(cs) == 0); + int ret; + ret = pthread_mutex_destroy(cs); + assert(ret == 0); } #define min(x,y) (((x)<(y))?(x):(y)) |