emulator: opengl: Make render_api.h C-compatible

This change modifies the function declarations under
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 @@
-#include "IOStream.h"
+#ifdef __cplusplus
+extern "C" {
 #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
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__