Kaydet (Commit) 8c51ef52 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Don't use extern "C" for a function which return C++ types

Fix error: 'gltf_get_model_center_pos' has C-linkage specified, but returns
user-defined type 'glm::vec3' (aka 'tvec3<mediump_float>') which is
incompatible with C.

I don't really understand the reason for the extern "C" use in
libgltf.h. After all, the header clearly is intended to be included from C++
code (after all, the use of 'extern "C"' is unconditional and it is not valid
in C), and the implementation of the functions is in C++. Also, we build
libgltf as a static library, so it can't be the case that we would need to
look up its symbols dynamically (when unmangled names would be better). But
maybe I am missing something.

Change-Id: I19f025610301f8c535178a83f4ab2e58455bad57
üst e1bc856e
......@@ -27,6 +27,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libgltf,\
external/libgltf/patches/get_bitmap_new_syntax.patch \
external/libgltf/patches/remove_extra_include.patch \
external/libgltf/patches/fmod_error_handling.patch \
external/libgltf/patches/extern-C.patch \
))
# vim: set noet sw=4 ts=4:
--- libgltf/inc/libgltf.h
+++ libgltf/inc/libgltf.h
@@ -48,7 +48,6 @@
void gltf_get_camera_pos(glm::vec3 *pos,glm::vec3 *view,glm::vec3 *up);
/*get model center position information*/
-extern "C"
glm::vec3 gltf_get_model_center_pos();
/*get camera position information*/
extern "C"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment