-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Detect if afunix.h exists #2145
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
Conversation
@yhirose I'm not sure why the |
@p1-0tr you don't need to worry about the abidiff error. |
@@ -192,8 +192,11 @@ using ssize_t = long; | |||
#include <winsock2.h> | |||
#include <ws2tcpip.h> | |||
|
|||
#if __has_include(<afunix.h>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@p1-0tr this is not compatible with C++11.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it only got standardised as of c++17, but has been supported by all major compilers before that. I've added an additional check that should protect against errors on compilers that do not support that macro.
httplib.h
Outdated
// afunix.h uses types declared in winsock2.h, so has to be included after it. | ||
#include <afunix.h> | ||
#define HAVE_AFUNIX 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@p1-0tr could you please rename it to CPPHTTPLIB_HAVE_AFUNIX_H
?
Signed-off-by: Piotr Stankiewicz <[email protected]>
@p1-0tr thanks for the adjustments! |
Older versions of the windows 10 SDK may not have
afunix.h
. So add logic to detect if the header exists, and enableAF_UNIX
only on supported windows versions.