Martin Storsjö (@mstorsjo) commented about libs/ldap/include/portable.h:
+/* #undef HAVE_GETHOSTBYADDR_R */
+/* Define to 1 if you have the `gethostbyname_r' function. */ +/* #undef HAVE_GETHOSTBYNAME_R */
+/* Define to 1 if you have the `gethostname' function. */ +#define HAVE_GETHOSTNAME 1
+/* Define to 1 if you have the `getnameinfo' function. */ +#define HAVE_GETNAMEINFO 1
+/* Define to 1 if you have the `getopt' function. */ +#define HAVE_GETOPT 1
+/* Define to 1 if you have the <getopt.h> header file. */ +#define HAVE_GETOPT_H 1
This ends up including getopt.h in PE builds, while that header isn't provided by wine itself (and isn't available if building with Clang in MSVC mode). See https://bugs.winehq.org/show_bug.cgi?id=53930 for a full bug report on this issue.