From 1d45c439b83565699a1fc220dc7f34c9ceb11a7e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 29 May 2014 04:22:30 -0700 Subject: [PATCH] Add extern "C" to common headers. --- include/atomic.h | 7 +++++++ include/rwlock.h | 8 ++++++++ include/threads.h | 7 +++++++ include/uintmap.h | 8 ++++++++ 4 files changed, 30 insertions(+) diff --git a/include/atomic.h b/include/atomic.h index 87a02f7b..4adb7a94 100644 --- a/include/atomic.h +++ b/include/atomic.h @@ -3,6 +3,9 @@ #include "static_assert.h" +#ifdef __cplusplus +extern "C" { +#endif typedef void *volatile XchgPtr; @@ -198,4 +201,8 @@ inline void *CompExchangePtr(XchgPtr *ptr, void *oldval, void *newval) #error "No atomic functions available on this platform!" #endif +#ifdef __cplusplus +} +#endif + #endif /* AL_ATOMIC_H */ diff --git a/include/rwlock.h b/include/rwlock.h index c3a275e6..03482515 100644 --- a/include/rwlock.h +++ b/include/rwlock.h @@ -4,6 +4,10 @@ #include "bool.h" #include "atomic.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { RefCount read_count; RefCount write_count; @@ -19,4 +23,8 @@ void ReadUnlock(RWLock *lock); void WriteLock(RWLock *lock); void WriteUnlock(RWLock *lock); +#ifdef __cplusplus +} +#endif + #endif /* AL_RWLOCK_H */ diff --git a/include/threads.h b/include/threads.h index 4a974b53..cde4b91f 100644 --- a/include/threads.h +++ b/include/threads.h @@ -3,6 +3,9 @@ #include +#ifdef __cplusplus +extern "C" { +#endif enum { althrd_success = 0, @@ -227,4 +230,8 @@ int altimespec_get(struct timespec *ts, int base); void al_nssleep(time_t sec, long nsec); +#ifdef __cplusplus +} +#endif + #endif /* AL_THREADS_H */ diff --git a/include/uintmap.h b/include/uintmap.h index 611ed39b..2c4c5e7a 100644 --- a/include/uintmap.h +++ b/include/uintmap.h @@ -4,6 +4,10 @@ #include "AL/al.h" #include "rwlock.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct UIntMap { struct { ALuint key; @@ -32,4 +36,8 @@ inline void LockUIntMapWrite(UIntMap *map) inline void UnlockUIntMapWrite(UIntMap *map) { WriteUnlock(&map->lock); } +#ifdef __cplusplus +} +#endif + #endif /* AL_UINTMAP_H */ -- 2.11.4.GIT