summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-11-09 10:20:51 +0000
committerJosé Fonseca <[email protected]>2011-11-09 10:24:37 +0000
commit63e7a4c6e5bf51d8090046ebc5adcb4207448565 (patch)
treeb701753960e53fe36889273def9d28e0059445d6 /src/mesa/main
parentf4b42aa5b7a3d11f839d5576b4c42406529131be (diff)
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.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.h9
-rw-r--r--src/mesa/main/core.h8
-rw-r--r--src/mesa/main/formats.h11
-rw-r--r--src/mesa/main/glheader.h10
-rw-r--r--src/mesa/main/mtypes.h9
-rw-r--r--src/mesa/main/shaderapi.h11
-rw-r--r--src/mesa/main/shaderobj.h3
-rw-r--r--src/mesa/main/simple_list.h8
-rw-r--r--src/mesa/main/uniform_query.cpp6
-rw-r--r--src/mesa/main/uniforms.h11
10 files changed, 75 insertions, 11 deletions
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index a9df0a866a7..a66dd507670 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -53,6 +53,11 @@
#include "mtypes.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct _glapi_table;
@@ -285,5 +290,9 @@ do { \
/*@}*/
+#ifdef __cplusplus
+}
+#endif
+
#endif /* CONTEXT_H */
diff --git a/src/mesa/main/core.h b/src/mesa/main/core.h
index 212f08527bc..c28a8af53e3 100644
--- a/src/mesa/main/core.h
+++ b/src/mesa/main/core.h
@@ -48,16 +48,8 @@
#include "main/mtypes.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/* for GLSL */
#include "program/prog_parameter.h"
-#ifdef __cplusplus
-}
-#endif
-
#endif /* CORE_H */
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index f24d52548de..b2cb750aa94 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -35,6 +35,12 @@
#include <GL/gl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* OpenGL doesn't have GL_UNSIGNED_BYTE_4_4, so we must define our own type
* for GL_LUMINANCE4_ALPHA4. */
#define MESA_UNSIGNED_BYTE_4_4 (GL_UNSIGNED_BYTE<<1)
@@ -322,4 +328,9 @@ GLboolean
_mesa_format_matches_format_and_type(gl_format gl_format,
GLenum format, GLenum type);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* FORMATS_H */
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index c4fb1570dae..7980111b52b 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -54,6 +54,11 @@
#include "GL/glext.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/**
* GL_FIXED is defined in glext.h version 64 but these typedefs aren't (yet).
*/
@@ -172,4 +177,9 @@ typedef void *GLeglImageOES;
#define GLX_DONT_CARE 0xFFFFFFFF
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GLHEADER_H */
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index ae6a33e0438..58dc9af0ff4 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -43,6 +43,11 @@
#include "main/formats.h" /* MESA_FORMAT_COUNT */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/**
* Stencil buffer data type.
*/
@@ -3454,4 +3459,8 @@ enum _debug
+#ifdef __cplusplus
+}
+#endif
+
#endif /* MTYPES_H */
diff --git a/src/mesa/main/shaderapi.h b/src/mesa/main/shaderapi.h
index bec448dee47..0ffebdb075f 100644
--- a/src/mesa/main/shaderapi.h
+++ b/src/mesa/main/shaderapi.h
@@ -29,6 +29,12 @@
#include "glheader.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct _glapi_table;
struct gl_context;
struct gl_shader_program;
@@ -194,4 +200,9 @@ _mesa_ActiveProgramEXT(GLuint program);
extern GLuint GLAPIENTRY
_mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SHADERAPI_H */
diff --git a/src/mesa/main/shaderobj.h b/src/mesa/main/shaderobj.h
index 941841d43ee..5470b51d7a0 100644
--- a/src/mesa/main/shaderobj.h
+++ b/src/mesa/main/shaderobj.h
@@ -32,9 +32,12 @@
#include "main/mtypes.h"
#include "program/ir_to_mesa.h"
+
#ifdef __cplusplus
extern "C" {
#endif
+
+
/**
* Internal functions
*/
diff --git a/src/mesa/main/simple_list.h b/src/mesa/main/simple_list.h
index ff7f8882382..9417108a07f 100644
--- a/src/mesa/main/simple_list.h
+++ b/src/mesa/main/simple_list.h
@@ -37,6 +37,10 @@
#ifndef _SIMPLE_LIST_H
#define _SIMPLE_LIST_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct simple_node {
struct simple_node *next;
struct simple_node *prev;
@@ -199,4 +203,8 @@ do { \
#define foreach_s(ptr, t, list) \
for(ptr=(list)->next,t=(ptr)->next; list != ptr; ptr=t, t=(t)->next)
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 388e81ae236..39aa5570eca 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -22,7 +22,9 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+
#include <stdlib.h>
+
#include "main/core.h"
#include "main/context.h"
#include "ir.h"
@@ -30,12 +32,10 @@
#include "program/hash_table.h"
#include "../glsl/program.h"
#include "../glsl/ir_uniform.h"
-
-extern "C" {
#include "main/shaderapi.h"
#include "main/shaderobj.h"
#include "uniforms.h"
-}
+
extern "C" void GLAPIENTRY
_mesa_GetActiveUniformARB(GLhandleARB program, GLuint index,
diff --git a/src/mesa/main/uniforms.h b/src/mesa/main/uniforms.h
index c73aab3c1d5..123d7b95423 100644
--- a/src/mesa/main/uniforms.h
+++ b/src/mesa/main/uniforms.h
@@ -30,6 +30,11 @@
#include "../glsl/glsl_types.h"
#include "../glsl/ir_uniform.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct gl_program;
struct _glapi_table;
@@ -281,4 +286,10 @@ _mesa_uniform_split_location_offset(GLint location, unsigned *base_location,
}
/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+
#endif /* UNIFORMS_H */