-
-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preface all types with glm to prevent naming conflicts #451
Comments
What are your naming conflicts? Any examples? |
I don't believe You could try something like this: #define vec2 glm_vec2
#include "cglm/cglm.h"
#undef vec2 |
I don't know of your particular case, but have you ever heard about sed? Requiring for everyone to change definitions is not an easy pill to swallow, you probably ain't going to get much love from a request like that. Although vec3 might be a very common type, it'll probably 99% of the cases be the same "typedef float vec3[3];"; so it's not a reasonable request (just because there is no typedef conflict). Just consider using "sed -ri -e 's%\b((vec|mat)[234])%cglm_\1%g' $(find ./ -type f)" after a pull from the cglm repository; that way you can use any custom type prefix you want without forcing everybody to do the same thing exactly as you do. |
@appybara13 @mghcoder I guess it can be applied to type names as well since it is implemented by macros. But this might break the original design. So, not sure the configurable names can be expanded everywhere. |
As it is, this only applies to struct functions names, not even struct types names can have a custom prefix or suffix defined. Defining custom macros before
Just have a look at macro Another alternative: |
vec2, vec3, mat4 are pretty common names.
I would like for the types to be prefaced with glm_ to prevent naming conflicts.
the functions have it so why not the types?
The text was updated successfully, but these errors were encountered: