Skip to content

Update thread_queue.h to remove conflict with windows headers #545

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mcgi5sr2
Copy link

Add parenthesis around MAX_CAPACITY evaluation to ensure it is not misinterpreted as a macro when using windows headers

First came across this when trying to compile with libcurl headers (curl/curl.h).

Add parenthesis around MAX_CAPACITY evaluation to ensure it is not misinterpreted as a macro when using windows headers
@fpagliughi
Copy link
Contributor

What is this colliding with? A max macro?

@mcgi5sr2
Copy link
Author

yes exactly that

@mcgi5sr2
Copy link
Author

mcgi5sr2 commented Mar 26, 2025

Apologies I have been hard at another project. The issue is given by VS studio as a warning:
Warning C4003 not enough arguments for function-like macro invocation 'max' mqtt_no_http ****\include\mqtt\thread_queue.h 96

followed by errors '(': illegal token on right side of'::' a couple of syntax errors about brackets and then:

missing type specifier - int assumed. Note: C++ does not support default-int

To reproduce I think it should be enough to include curl/curl.h in your simple subscriber example.

I get the PR isn't a tidy resolution but it seemed to be the simplest.

@fpagliughi
Copy link
Contributor

No worries; I'm busy on something else as well, but I will look into it as soon as I can.

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

Successfully merging this pull request may close these issues.

2 participants