From 63e7a4c6e5bf51d8090046ebc5adcb4207448565 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 9 Nov 2011 10:20:51 +0000 Subject: mesa,glsl,mapi: Put extern "C" { ... } where appropriate. Probably a several places missing, but enough to cover all headers (in)directly included by uniform_query.cpp, and fix the MSVC build. --- src/mapi/glapi/glapi.h | 7 +++++-- src/mapi/glapi/glthread.h | 8 ++++++++ src/mapi/mapi/u_thread.h | 22 +++++++++++++++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) (limited to 'src/mapi') diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h index b9351d146d8..f6854754bbf 100644 --- a/src/mapi/glapi/glapi.h +++ b/src/mapi/glapi/glapi.h @@ -44,10 +44,14 @@ #ifndef _GLAPI_H #define _GLAPI_H +#include "glapi/glthread.h" + + #ifdef __cplusplus extern "C" { #endif + #ifdef _GLAPI_NO_EXPORTS # define _GLAPI_EXPORT #else /* _GLAPI_NO_EXPORTS */ @@ -75,8 +79,6 @@ extern "C" { #define _glapi_Context _mglapi_Context #endif -#include "glapi/glthread.h" - typedef void (*_glapi_proc)(void); struct _glapi_table; @@ -180,6 +182,7 @@ _glapi_noop_enable_warnings(unsigned char enable); _GLAPI_EXPORT void _glapi_set_warning_func(_glapi_proc func); + #ifdef __cplusplus } #endif diff --git a/src/mapi/glapi/glthread.h b/src/mapi/glapi/glthread.h index fc4ece7c338..1c3f4e2bf76 100644 --- a/src/mapi/glapi/glthread.h +++ b/src/mapi/glapi/glthread.h @@ -3,6 +3,10 @@ #include "mapi/u_thread.h" +#ifdef __cplusplus +extern "C" { +#endif + #define _glthread_DECLARE_STATIC_MUTEX(name) u_mutex_declare_static(name) #define _glthread_INIT_MUTEX(name) u_mutex_init(name) #define _glthread_DESTROY_MUTEX(name) u_mutex_destroy(name) @@ -17,4 +21,8 @@ typedef struct u_tsd _glthread_TSD; typedef u_mutex _glthread_Mutex; +#ifdef __cplusplus +} +#endif + #endif /* GLTHREAD_H */ diff --git a/src/mapi/mapi/u_thread.h b/src/mapi/mapi/u_thread.h index 4405ec9c509..7db22b7936a 100644 --- a/src/mapi/mapi/u_thread.h +++ b/src/mapi/mapi/u_thread.h @@ -44,12 +44,25 @@ #include "u_compiler.h" -#if defined(PTHREADS) || defined(WIN32) +#if defined(PTHREADS) +#include /* POSIX threads headers */ +#endif +#ifdef _WIN32 +#include +#endif + +#if defined(PTHREADS) || defined(_WIN32) #ifndef THREADS #define THREADS #endif #endif + +#ifdef __cplusplus +extern "C" { +#endif + + /* * POSIX threads. This should be your choice in the Unix world * whenever possible. When building with POSIX threads, be sure @@ -60,7 +73,6 @@ * proper compiling for MT-safe libc etc. */ #if defined(PTHREADS) -#include /* POSIX threads headers */ struct u_tsd { pthread_key_t key; @@ -86,7 +98,6 @@ typedef pthread_mutex_t u_mutex; * used! */ #ifdef WIN32 -#include struct u_tsd { DWORD key; @@ -142,4 +153,9 @@ u_tsd_get(struct u_tsd *tsd); void u_tsd_set(struct u_tsd *tsd, void *ptr); + +#ifdef __cplusplus +} +#endif + #endif /* _U_THREAD_H_ */ -- cgit v1.2.3