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

Macro conflict with RESERVED #973

Open
mike919192 opened this issue Nov 11, 2024 · 2 comments
Open

Macro conflict with RESERVED #973

mike919192 opened this issue Nov 11, 2024 · 2 comments

Comments

@mike919192
Copy link
Contributor

Hi,

I ran into a macro conflict recently between one of my C system libraries and etl. My C library has RESERVED defined and that name is also used these 2 files. In both cases it looks to be used only internally

  • queue_spsc_atomic.h
  • bip_buffer_spsc_atomic.h

I have temporarily worked around the issue by

//workaround for macro conflict
#ifdef RESERVED
#undef RESERVED
#endif
#include "etl/queue_spsc_atomic.h"

Would it be possible to either change the case of the variable or give it an ETL_ prefix? I can make a PR if either one is acceptable.

Thanks

@jwellbelove
Copy link
Contributor

I have a long term plan to change all of the constants to This_Style_Case to remove the chance of clashes with C macros.

@mike919192
Copy link
Contributor Author

OK thanks, would you want a PR for the 2 files I listed? It looks like there are maybe some other internal constants (RESERVED_SIZE) that could also be updated. There is also (MAX_SIZE) but that is public and would be breaking change.

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

No branches or pull requests

2 participants