recp / cglm

📽 Highly Optimized 2D / 3D Graphics Math (glm) for C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CGLM_OMIT_NS_FROM_STRUCT_API breaks compilation

FrostKiwi opened this issue · comments

I want to switch my project over to the struct API, but fail to compile when specifying CGLM_OMIT_NS_FROM_STRUCT_API in addition to #include "cglm/struct.h".

In file included from inc/cglm/struct.h:25:
inc/cglm/struct/box.h:36:3: error: call to undeclared function 'glms_vec3_pack'; ISO C99 and
      later do not support implicit function declarations [-Wimplicit-function-declaration]
  glms_vec3_pack(dest, rawDest, 2);
Version of emscripten/emsdk
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.38 (9eff02bc816c50ab0e3b70a3bd5b72a8dc2893a2)
clang version 17.0.0 (https://github.com/llvm/llvm-project 004bf170c6cbaa049601bcf92f86a9459aec2dc2)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: C:\<redacted>\min\home\artsimow\build\emsdk\upstream\bin

Hi @FrostKiwi,

adec2ee should fix this,

thanks for reporting the issue

Compiled successfully and works now.

Not sure how I feel about somethings not having glms_ removed and thus having a mix of both, like glms_translate() not becoming translate() I guess this is to avoid collisions?

Yes to avoid collisions I kept glms for root namespace. Another option like CGLM_OMIT_ROOTNS_FROM_STRUCT_API could be added for who want to remove glms_ from glms_translate() like functions maybe.