sockaddr_un different casing in older windows sdks causes build failure
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12k
- Forks
- 3.5k
- Avg merge
- 12h 55m
- Merged PRs (30d)
- 6
Description
The current libevent master branch fails to build on slightly old windows 10 sdks due to the fact that sockaddr_un is used in evutil.c https://github.com/libevent/libevent/blob/112421c8fa4840acd73502f2ab6a674fc025de37/evutil.c#L300-L301
by only checking that the afunix.h header is present, rather than for the struct being present.
In the 10.0.16299.0 sdk for example, the struct is indeed present, but declared as
typedef struct _SOCKADDR_UN
{
ADDRESS_FAMILY Family;
wchar_t Path[63];
} SOCKADDR_UN, *PSOCKADDR_UN;
so the build errors out.
A possible fix for this would be to update the sockaddr_un check in the cmake to also check for a struct with different naming, and in case add an internal compatibility typedef so that the code will stay compatible with linux and more modern windows sdks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sockaddr_un use in evutil.c at lines 300-301 and inspect the CMake check that determines whether it is available. Reproduce the build with the Windows 10 SDK version described in the issue, then verify that the compatibility handling builds with older and newer SDKs without changing Linux support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake
- Domain
- build-system, networking, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100