Skip to content

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

Open
mcgi5sr2 wants to merge 1 commit intoeclipse-paho:developfrom
mcgi5sr2:patch-1
Open

Update thread_queue.h to remove conflict with windows headers#545
mcgi5sr2 wants to merge 1 commit intoeclipse-paho:developfrom
mcgi5sr2:patch-1

Conversation

@mcgi5sr2
Copy link
Copy Markdown

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
Copy Markdown
Contributor

What is this colliding with? A max macro?

@mcgi5sr2
Copy link
Copy Markdown
Author

yes exactly that

@mcgi5sr2
Copy link
Copy Markdown
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
Copy Markdown
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