Ensure OpenGL ES 2.0 C functions use C signatures in C++ builds (fixes VS builds) bug235_bringup_0 tip
authorMatt Plumtree <matt.plumtree@nokia.com>
Mon, 15 Nov 2010 09:56:25 +0000
branchbug235_bringup_0
changeset 77 b0395290e61f
parent 76 24381b61de5c
Ensure OpenGL ES 2.0 C functions use C signatures in C++ builds (fixes VS builds)
hostsupport/hostopengles20/src/buffer.h
hostsupport/hostopengles20/src/fbo.h
hostsupport/hostopengles20/src/half.h
hostsupport/hostopengles20/src/hgl.h
hostsupport/hostopengles20/src/object.h
hostsupport/hostopengles20/src/platform.h
hostsupport/hostopengles20/src/program.h
hostsupport/hostopengles20/src/shader.h
hostsupport/hostopengles20/src/texture.h
hostsupport/hostopengles20/src/util.h
hostsupport/hostopengles20/src/vertex.h
--- a/hostsupport/hostopengles20/src/buffer.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/buffer.h	Mon Nov 15 09:56:25 2010 +0000
@@ -41,7 +41,16 @@
 	GLenum usage;
 } DGLBuffer;
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 DGLBuffer*	DGLBuffer_create(GLuint name);
 void		DGLBuffer_destroy(DGLBuffer* buffer);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* BUFFER_H_ */
--- a/hostsupport/hostopengles20/src/fbo.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/fbo.h	Mon Nov 15 09:56:25 2010 +0000
@@ -36,7 +36,16 @@
 	GLeglImageOES egl_image; // EGLimage this renderbuffer is a sibling of.
 } DGLRenderbuffer;
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 DGLRenderbuffer*	DGLRenderbuffer_create(GLuint name);
 void				DGLRenderbuffer_destroy(DGLRenderbuffer* buffer);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif // FBO_H_
--- a/hostsupport/hostopengles20/src/half.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/half.h	Mon Nov 15 09:56:25 2010 +0000
@@ -31,6 +31,15 @@
 
 #include "common.h"
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 GLfloat dglConvertHalfToFloat(khronos_int16_t half);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* HALF_H_ */
--- a/hostsupport/hostopengles20/src/hgl.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/hgl.h	Mon Nov 15 09:56:25 2010 +0000
@@ -219,7 +219,17 @@
 #ifndef HGL_NO_VARIABLES
 extern HGL hgl;
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 extern int hglLoad(HGL* hgl);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif // HGL_NO_VARIABLES
 
 #endif // HGL_H_
--- a/hostsupport/hostopengles20/src/object.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/object.h	Mon Nov 15 09:56:25 2010 +0000
@@ -37,8 +37,17 @@
 	struct DGLObject* next;
 } DGLObject;
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 void		DGLObject_insert(DGLObject** root, DGLObject* object);
 DGLObject*	DGLObject_remove(DGLObject** root, GLuint name);
 DGLObject*	DGLObject_find(DGLObject* root, GLuint name);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* OBJECT_H_ */
--- a/hostsupport/hostopengles20/src/platform.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/platform.h	Mon Nov 15 09:56:25 2010 +0000
@@ -40,8 +40,17 @@
 	typedef pthread_mutex_t DGLES2_LOCK;
 #endif
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 void dglGetLock(void);
 void dglReleaseLock(void);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif /* PLATFORM_H_ */
 
--- a/hostsupport/hostopengles20/src/program.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/program.h	Mon Nov 15 09:56:25 2010 +0000
@@ -37,7 +37,16 @@
 	GLboolean	validate_status;
 } DGLProgram;
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 DGLProgram*	DGLProgram_create(GLuint name);
 void		DGLProgram_destroy(DGLProgram* program);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif // PROGRAM_H_
--- a/hostsupport/hostopengles20/src/shader.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/shader.h	Mon Nov 15 09:56:25 2010 +0000
@@ -37,8 +37,17 @@
 	GLsizei length;
 } DGLShader;
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 DGLShader*	DGLShader_create(GLuint name);
 void		DGLShader_destroy(DGLShader* shader);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif // SHADER_H_
 
--- a/hostsupport/hostopengles20/src/texture.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/texture.h	Mon Nov 15 09:56:25 2010 +0000
@@ -56,6 +56,11 @@
 	GLeglImageOES egl_image[6]; // EGLimage this texture is a sibling of.
 } DGLTexture;
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 DGLTexture*			DGLTexture_create(GLuint name, DGLTextureType type, GLint num_levels);
 void				DGLTexture_destroy(DGLTexture* texture);
 GLboolean			DGLTexture_isComplete(const DGLTexture* texture);
@@ -67,4 +72,8 @@
 void				DGLTexture_setEGLImage(DGLTexture* texture, GLenum target, GLeglImageOES image);
 void				DGLTexture_generateMipmap(DGLTexture* texture);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif // TEXTURE_H_
--- a/hostsupport/hostopengles20/src/util.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/util.h	Mon Nov 15 09:56:25 2010 +0000
@@ -29,8 +29,17 @@
 #ifndef UTIL_H_
 #define UTIL_H_
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 int dglLog2(unsigned int x);
 int dglMin(int a, int b);
 int dglMax(int a, int b);
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif  // UTIL_H_
--- a/hostsupport/hostopengles20/src/vertex.h	Fri Nov 12 17:56:05 2010 +0000
+++ b/hostsupport/hostopengles20/src/vertex.h	Mon Nov 15 09:56:25 2010 +0000
@@ -47,7 +47,16 @@
 	struct DGLBuffer* buffer;	// Buffer binding.
 } DGLVertexArray;
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
 extern void dglVertexFinish();
 
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
 #endif // VERTEX_H_