Skip to content

Fix compilation error on windows #2118

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

Merged
merged 1 commit into from
Mar 25, 2025
Merged

Conversation

p1-0tr
Copy link
Contributor

@p1-0tr p1-0tr commented Mar 25, 2025

afunix.h uses types declared in winsock2.h, and so has to be included after it. Including afunix.h first will result in a somewhat unhelpful compilation error:

error C3646: 'sun_family': unknown override specifier

@yhirose
Copy link
Owner

yhirose commented Mar 25, 2025

@p1-0tr thanks for finding the problem! Could you please change the code as follows, so that clangformat can still sort include file entries in the block, and keep afunix.h out of the block. Thanks!

#include <io.h>
#include <winsock2.h>
#include <ws2tcpip.h>

// `afunix.h` uses types declared in winsock2.h, so has to be included after it.
#include <afunix.h>

afunix.h uses types declared in winsock2.h, and so has to be included
after it. Including afunix.h first will result in a somewhat unhelpful
compilation error:

error C3646: 'sun_family': unknown override specifier

Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
@p1-0tr p1-0tr force-pushed the ps-fix-compile-error branch from 7116a54 to 82a4c73 Compare March 25, 2025 11:57
@yhirose yhirose merged commit dbc4af8 into yhirose:master Mar 25, 2025
9 checks passed
@yhirose
Copy link
Owner

yhirose commented Mar 25, 2025

@p1-0tr thanks!

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