https://bugs.winehq.org/show_bug.cgi?id=53930
--- Comment #4 from Martin Storsjö martin@martin.st --- (In reply to Hans Leidekker from comment #3)
Created attachment 73490 [details] getopt-compat.h
Here's the header. I can also take a look if you show me how you configure Wine for Clang/MSVC.
Thanks! With this header, and removing those defines from portable.h, the build proceeds, but then hits another error; libs/ldap/libldap/init.c does a call to atexit() when built in !defined(__GNUC__) mode, and none of the import libs linked here provide atexit.
To configure Wine for Clang/MSVC, just configure with --with-mingw=clang, and it will try to execute clang with "-target <arch>-windows" (which implies MSVC mode). If you otherwise have all the Clang/lld/llvm-dlltool executables available, this should work and produce a successful build (I test it daily in aarch64 configurations, but x86_64 should probably work just as well).