aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
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
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')
-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
-rw-r--r--src/mesa/math/m_matrix.h9
-rw-r--r--src/mesa/program/hash_table.h9
-rw-r--r--src/mesa/program/ir_to_mesa.h15
-rw-r--r--src/mesa/program/prog_parameter.h9
-rw-r--r--src/mesa/program/prog_statevars.h11
15 files changed, 117 insertions, 22 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 */
diff --git a/src/mesa/math/m_matrix.h b/src/mesa/math/m_matrix.h
index a69afb8589a..e8e48aab75a 100644
--- a/src/mesa/math/m_matrix.h
+++ b/src/mesa/math/m_matrix.h
@@ -35,6 +35,11 @@
#include "main/glheader.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/**
* \name Symbolic names to some of the entries in the matrix
*
@@ -209,4 +214,8 @@ _mesa_transform_vector(GLfloat u[4], const GLfloat v[4], const GLfloat m[16]);
/*@}*/
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/mesa/program/hash_table.h b/src/mesa/program/hash_table.h
index 47c37ae40ec..bcf65df7d89 100644
--- a/src/mesa/program/hash_table.h
+++ b/src/mesa/program/hash_table.h
@@ -37,16 +37,17 @@
#include <limits.h>
#include <assert.h>
-struct hash_table;
struct string_to_uint_map;
-typedef unsigned (*hash_func_t)(const void *key);
-typedef int (*hash_compare_func_t)(const void *key1, const void *key2);
-
#ifdef __cplusplus
extern "C" {
#endif
+struct hash_table;
+
+typedef unsigned (*hash_func_t)(const void *key);
+typedef int (*hash_compare_func_t)(const void *key1, const void *key2);
+
/**
* Hash table constructor
*
diff --git a/src/mesa/program/ir_to_mesa.h b/src/mesa/program/ir_to_mesa.h
index 2891682ba7a..aa053d9c8e3 100644
--- a/src/mesa/program/ir_to_mesa.h
+++ b/src/mesa/program/ir_to_mesa.h
@@ -21,24 +21,23 @@
* DEALINGS IN THE SOFTWARE.
*/
-#include "main/glheader.h"
+#pragma once
-struct gl_context;
-struct gl_shader;
-struct gl_shader_program;
+#include "main/glheader.h"
#ifdef __cplusplus
extern "C" {
#endif
+struct gl_context;
+struct gl_shader;
+struct gl_shader_program;
+
void _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *sh);
void _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
GLboolean _mesa_ir_compile_shader(struct gl_context *ctx, struct gl_shader *shader);
GLboolean _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
-#ifdef __cplusplus
-}
-
void
_mesa_generate_parameters_list_for_uniforms(struct gl_shader_program
*shader_program,
@@ -50,4 +49,6 @@ _mesa_associate_uniform_storage(struct gl_context *ctx,
struct gl_shader_program *shader_program,
struct gl_program_parameter_list *params);
+#ifdef __cplusplus
+}
#endif
diff --git a/src/mesa/program/prog_parameter.h b/src/mesa/program/prog_parameter.h
index a6793d0d866..3c6dc8cf996 100644
--- a/src/mesa/program/prog_parameter.h
+++ b/src/mesa/program/prog_parameter.h
@@ -35,6 +35,11 @@
#include "prog_statevars.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/**
* Program parameter flags
*/
@@ -178,4 +183,8 @@ _mesa_num_parameters_of_type(const struct gl_program_parameter_list *list,
gl_register_file type);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PROG_PARAMETER_H */
diff --git a/src/mesa/program/prog_statevars.h b/src/mesa/program/prog_statevars.h
index 04af3f4cf3a..8b731e12bbe 100644
--- a/src/mesa/program/prog_statevars.h
+++ b/src/mesa/program/prog_statevars.h
@@ -25,8 +25,15 @@
#ifndef PROG_STATEVARS_H
#define PROG_STATEVARS_H
+
#include "main/glheader.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct gl_context;
struct gl_program_parameter_list;
@@ -145,4 +152,8 @@ extern void
_mesa_load_tracked_matrices(struct gl_context *ctx);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PROG_STATEVARS_H */