Skip to content
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

resolve some C-preprocessor macros #1

Open
Brian-ED opened this issue Jan 22, 2024 · 4 comments
Open

resolve some C-preprocessor macros #1

Brian-ED opened this issue Jan 22, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@Brian-ED
Copy link
Owner

C macros cause errors if used for declaring functions and structs. It's rare, but rlgl.h in raylib does that.

My current idea on resolving this is having an argument for inputting if defines should be true or false and making a simple preprocessor for this purpose.

@Brian-ED Brian-ED added the enhancement New feature or request label Jan 22, 2024
@Brian-ED
Copy link
Owner Author

I can use cpp -p but it would include other files and code elsewhere. It'd also remove definition macros that define variables like the RLGL_VERSION string.

@Brian-ED
Copy link
Owner Author

idea: remove #includes before calling cpp -p. Also find #defines before calling it.

@Brian-ED
Copy link
Owner Author

cpp -p -E -CC raylib.h > out.txt worked, for including comments in output

@Brian-ED
Copy link
Owner Author

#define's value might rely on an #include

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant