Skip to content

Fix 32-bit MSVC compiler error due to unknown command #warning #2202

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: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
* Platform compatibility check
*/

#if defined(_MSC_VER)
#if defined(_WIN32) && !defined(_WIN64)
#pragma message( \
"cpp-httplib doesn't support 32-bit Windows. Please use a 64-bit compiler.")
#endif
#else
#if defined(_WIN32) && !defined(_WIN64)
#warning \
Copy link
Owner

@yhirose yhirose Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it enough to change only this line to #pragma message(...)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I only fixed the compiler error and did not touch the warning case on purpose.

"cpp-httplib doesn't support 32-bit Windows. Please use a 64-bit compiler."
Expand All @@ -25,6 +31,7 @@
#warning \
"cpp-httplib doesn't support platforms where size_t is less than 64 bits."
#endif
#endif

#ifdef _WIN32
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0A00
Expand Down
Loading