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.
This commit is contained in:
José Fonseca
2011-11-09 10:20:51 +00:00
parent f4b42aa5b7
commit 63e7a4c6e5
20 changed files with 158 additions and 33 deletions
+3 -3
View File
@@ -29,13 +29,13 @@
#include <string.h>
#include <assert.h>
struct _mesa_glsl_parse_state;
struct glsl_symbol_table;
#ifdef __cplusplus
extern "C" {
#endif
struct _mesa_glsl_parse_state;
struct glsl_symbol_table;
extern void
_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state);
+6 -3
View File
@@ -25,15 +25,18 @@
#ifndef IR_UNIFORM_H
#define IR_UNIFORM_H
#ifdef __cplusplus
extern "C" {
#endif
/* stdbool.h is necessary because this file is included in both C and C++ code.
*/
#include <stdbool.h>
#include "program/prog_parameter.h" /* For union gl_constant_value. */
#ifdef __cplusplus
extern "C" {
#endif
enum gl_uniform_driver_format {
uniform_native = 0, /**< Store data in the native format. */
uniform_int_float, /**< Store integer data as floats. */
+5 -2
View File
@@ -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
+8
View File
@@ -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 */
+19 -3
View File
@@ -44,12 +44,25 @@
#include "u_compiler.h"
#if defined(PTHREADS) || defined(WIN32)
#if defined(PTHREADS)
#include <pthread.h> /* POSIX threads headers */
#endif
#ifdef _WIN32
#include <windows.h>
#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 <pthread.h> /* POSIX threads headers */
struct u_tsd {
pthread_key_t key;
@@ -86,7 +98,6 @@ typedef pthread_mutex_t u_mutex;
* used!
*/
#ifdef WIN32
#include <windows.h>
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_ */
+9
View File
@@ -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 */
-8
View File
@@ -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 */
+11
View File
@@ -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 */
+10
View File
@@ -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 */
+9
View File
@@ -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 */
+11
View File
@@ -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 */
+3
View File
@@ -32,9 +32,12 @@
#include "main/mtypes.h"
#include "program/ir_to_mesa.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Internal functions
*/
+8
View File
@@ -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
+3 -3
View File
@@ -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,
+11
View File
@@ -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 */
+9
View File
@@ -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
+5 -4
View File
@@ -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
*
+8 -7
View File
@@ -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
+9
View File
@@ -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 */
+11
View File
@@ -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 */