emulator: opengl: Make render_api.h C-compatible
This change modifies the function declarations under
developement/tools/emulator/opengl/host/include/render_api.h
to make them callable from C.
This is preparation work for integrating the rendering library
into the emulator. The plan is to dlopen() the library dynamically
and using non-mangled function names makes using dlsym() both
easier and more portable.
Change-Id: I34656ea4618dbb989fb6ff78df43e9bfb38a7799
diff --git a/tools/emulator/opengl/host/include/libOpenglRender/render_api.h b/tools/emulator/opengl/host/include/libOpenglRender/render_api.h
index fa56316..324ae1f 100644
--- a/tools/emulator/opengl/host/include/libOpenglRender/render_api.h
+++ b/tools/emulator/opengl/host/include/libOpenglRender/render_api.h
@@ -16,7 +16,10 @@
#ifndef _OPENGL_RENDERER_RENDER_API_H
#define _OPENGL_RENDERER_RENDER_API_H
-#include "IOStream.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "render_api_platform_types.h"
//
@@ -41,14 +44,8 @@
//
bool stopOpenGLRenderer();
-//
-// createRenderThread - opens a new communication channel to the renderer
-// process and creates new rendering thread.
-// returns a pointer to IOStream through which command tokens are being sent
-// to the render thread for execution. 'p_stream_buffer_size' is the internal
-// stream buffer size.
-// The thread is destroyed when deleting the IOStream object.
-//
-IOStream *createRenderThread(int p_stream_buffer_size);
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/tools/emulator/opengl/host/libs/libOpenglRender/render_api.cpp b/tools/emulator/opengl/host/libs/libOpenglRender/render_api.cpp
index a9237af..c471981 100644
--- a/tools/emulator/opengl/host/libs/libOpenglRender/render_api.cpp
+++ b/tools/emulator/opengl/host/libs/libOpenglRender/render_api.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
#include "libOpenglRender/render_api.h"
+#include "IOStream.h"
#include "FrameBuffer.h"
#include "RenderServer.h"
#include "osProcess.h"
@@ -23,6 +24,8 @@
static RenderServer *s_renderThread = NULL;
static int s_renderPort = 0;
+static IOStream *createRenderThread(int p_stream_buffer_size);
+
#ifdef __APPLE__
#define RENDER_API_USE_THREAD
#endif