From 6bd492fa7975b90a3be31c65ba1fbafdd0002f0f Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 19 Apr 2011 22:58:36 +0200 Subject: common: add extern "C" guards to headers Since some spice C++ code is using code from common/, the C functions need to be marked as such for the C++ compiler, otherwise we'll get linkage issues. --- common/mutex.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'common/mutex.h') diff --git a/common/mutex.h b/common/mutex.h index a2d35dec..6789b8f4 100644 --- a/common/mutex.h +++ b/common/mutex.h @@ -18,6 +18,11 @@ #ifndef _H_MUTEX #define _H_MUTEX + +#ifdef __cplusplus +extern "C" { +#endif + #ifdef _WIN32 #include typedef CRITICAL_SECTION mutex_t; @@ -32,4 +37,8 @@ typedef pthread_mutex_t mutex_t; #define MUTEX_UNLOCK(mutex) pthread_mutex_unlock(&mutex) #endif +#ifdef __cplusplus +} +#endif + #endif // _H_MUTEX -- cgit