From 3fc817734ff83015607472a25a64db2bc4047048 Mon Sep 17 00:00:00 2001 From: Lingfeng Yang Date: Mon, 27 Feb 2017 09:41:28 -0800 Subject: unconditionally extern "C", update guest encoder Change-Id: Ia1cc789acd1ec4d00b83950e0125de4e7957d097 --- host/commands/emugen/ApiGen.cpp | 4 +--- host/commands/emugen/tests/t.001/expected/encoder/foo_entry.cpp | 2 -- .../emugen/tests/t.001/expected/wrapper/foo_wrapper_entry.cpp | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) (limited to 'host') diff --git a/host/commands/emugen/ApiGen.cpp b/host/commands/emugen/ApiGen.cpp index 0c1d078f3..5d8851dd0 100644 --- a/host/commands/emugen/ApiGen.cpp +++ b/host/commands/emugen/ApiGen.cpp @@ -241,14 +241,12 @@ int ApiGen::genEntryPoints(const std::string & filename, SideType side) fprintf(fp, "#include \"%s_%s_context.h\"\n", m_basename.c_str(), sideString(side)); fprintf(fp, "\n"); - fprintf(fp, "#ifndef GL_TRUE\n"); fprintf(fp, "extern \"C\" {\n"); for (size_t i = 0; i < size(); i++) { fprintf(fp, "\t"); at(i).print(fp, false); fprintf(fp, ";\n"); } fprintf(fp, "};\n\n"); - fprintf(fp, "#endif\n"); fprintf(fp, "#ifndef GET_CONTEXT\n"); fprintf(fp, "static %s_%s_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;\n", @@ -911,7 +909,7 @@ int ApiGen::genContextImpl(const std::string &filename, SideType side) fprintf(fp, "int %s::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)\n{\n", classname.c_str()); for (size_t i = 0; i < n; i++) { EntryPoint *e = &at(i); - if (e->customDecoder() && !e->notApi()) { + if (side == SERVER_SIDE && e->customDecoder() && !e->notApi()) { fprintf(fp, "\t%s = (%s_dec_%s_proc_t) getProc(\"%s\", userData);\n", e->name().c_str(), e->name().c_str(), diff --git a/host/commands/emugen/tests/t.001/expected/encoder/foo_entry.cpp b/host/commands/emugen/tests/t.001/expected/encoder/foo_entry.cpp index b91129c03..05bf3bb6e 100644 --- a/host/commands/emugen/tests/t.001/expected/encoder/foo_entry.cpp +++ b/host/commands/emugen/tests/t.001/expected/encoder/foo_entry.cpp @@ -4,7 +4,6 @@ #include #include "foo_client_context.h" -#ifndef GL_TRUE extern "C" { void fooAlphaFunc(FooInt func, FooFloat ref); FooBoolean fooIsBuffer(void* stuff); @@ -13,7 +12,6 @@ extern "C" { void fooTakeConstVoidPtrConstPtr(const void* const* param); }; -#endif #ifndef GET_CONTEXT static foo_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL; void foo_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; } diff --git a/host/commands/emugen/tests/t.001/expected/wrapper/foo_wrapper_entry.cpp b/host/commands/emugen/tests/t.001/expected/wrapper/foo_wrapper_entry.cpp index 7591393c1..284c1c855 100644 --- a/host/commands/emugen/tests/t.001/expected/wrapper/foo_wrapper_entry.cpp +++ b/host/commands/emugen/tests/t.001/expected/wrapper/foo_wrapper_entry.cpp @@ -4,7 +4,6 @@ #include #include "foo_wrapper_context.h" -#ifndef GL_TRUE extern "C" { void fooAlphaFunc(FooInt func, FooFloat ref); FooBoolean fooIsBuffer(void* stuff); @@ -13,7 +12,6 @@ extern "C" { void fooTakeConstVoidPtrConstPtr(const void* const* param); }; -#endif #ifndef GET_CONTEXT static foo_wrapper_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL; void foo_wrapper_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; } -- cgit v1.2.3