recp / cglm

πŸ“½ Highly Optimized 2D / 3D Graphics Math (glm) for C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`I` macro is used as variable name in new vec_reflect / vec_refract functions

olifre opened this issue Β· comments

Including complex.h from standard C (see https://en.cppreference.com/w/c/numeric/complex ) defines the macro I, which causes issues with the variable name I used starting with CGLM 0.9.3.

See for example:

In file included from ../src/util/compat.h:13,
                 from ../src/taisei.h:13,
                 from ../src/boss.c:9:
../subprojects/cglm/include/cglm/vec2.h:725:23: error: expected β€˜)’ before β€˜__extension__’
  725 | glm_vec2_reflect(vec2 I, vec2 N, vec2 dest) {
      |                       ^
In file included from ../subprojects/cglm/include/cglm/cglm.h:12,
                 from ../src/util/glm.h:20,
                 from ../src/boss.c:17:
../subprojects/cglm/include/cglm/vec2.h:725:26: error: expected β€˜;’, β€˜,’ or β€˜)’ before β€˜vec2’
  725 | glm_vec2_reflect(vec2 I, vec2 N, vec2 dest) {
      |                          ^~~~

in one program using CGLM and including complex.h before.

Hi @olifre,

Wow, thanks for reporting this, I tried to fix this at #406 and new Release will be soon.

@olifre the PR is merged I think the issue was dissolved. v0.9.4 will be released soon which will contain this bugfix.

The issue is fixed at v0.9.4: https://github.com/recp/cglm/releases

Thanks for reporting this