@@ -1030,7 +1030,9 @@ package = {
10301030#define HAVE_BOOL_T
10311031
10321032/* Define to 1 if you have the clock_gettime function and monotonic timer. */
1033- /* #undef HAVE_CLOCK_GETTIME_MONOTONIC */
1033+ #if __has_include(<time.h>) && !defined(_WIN32)
1034+ #define HAVE_CLOCK_GETTIME_MONOTONIC 1
1035+ #endif
10341036
10351037/* Define to 1 if you have the closesocket function. */
10361038#define HAVE_CLOSESOCKET
@@ -1087,7 +1089,12 @@ package = {
10871089/* #undef HAVE_GETSERVBYPORT_R */
10881090
10891091/* Define to 1 if you have the `gettimeofday' function. */
1090- /* #undef HAVE_GETTIMEOFDAY */
1092+ /* SUB-SECOND TIME. `ares_timeval.c:93` refuses a configuration that names no
1093+ * source of it, and the Win32 one (`GetTickCount64`) needs `windows.h`. A
1094+ * POSIX-presenting target has `clock_gettime`, which `time.h` declares. */
1095+ #if __has_include(<time.h>) && !defined(_WIN32)
1096+ #define HAVE_GETTIMEOFDAY 1
1097+ #endif
10911098
10921099/* Define to 1 if you have the `if_indextoname' function. */
10931100/* #undef HAVE_IF_INDEXTONAME */
@@ -1205,10 +1212,22 @@ package = {
12051212#define HAVE_STDLIB_H
12061213
12071214/* Define to 1 if you have the strcasecmp function. */
1208- /* #undef HAVE_STRCASECMP */
1215+ /* WIN32 CRT NAMES vs POSIX NAMES, decided by what the C environment
1216+ * presents rather than by the platform. This block is the Windows branch of a
1217+ * recipe that branches on the PLATFORM; over openkal the target is PE and the
1218+ * C environment is POSIX, so the CRT spellings are the ones that are absent.
1219+ * `__has_builtin` cannot answer for library functions, so these ask the same
1220+ * question the headers do: `strings.h` carries the POSIX pair. */
1221+ #if __has_include(<strings.h>)
1222+ #define HAVE_STRCASECMP 1
1223+ #define HAVE_STRNCASECMP 1
1224+ #endif
1225+ /* #undef HAVE_STRCASECMP_ORIGINAL */
12091226
12101227/* Define to 1 if you have the strcmpi function. */
1228+ #if !__has_include(<strings.h>)
12111229#define HAVE_STRCMPI
1230+ #endif
12121231
12131232/* Define to 1 if you have the strdup function. */
12141233#define HAVE_STRDUP
@@ -1229,7 +1248,9 @@ package = {
12291248/* #undef HAVE_STRNCMPI */
12301249
12311250/* Define to 1 if you have the strnicmp function. */
1251+ #if !__has_include(<strings.h>)
12321252#define HAVE_STRNICMP
1253+ #endif
12331254
12341255/* Define to 1 if you have the <stropts.h> header file. */
12351256/* #undef HAVE_STROPTS_H */
@@ -1276,23 +1297,42 @@ package = {
12761297/* Define to 1 if you have the <time.h> header file. */
12771298#define HAVE_TIME_H
12781299
1279- /* Define to 1 if you have the <unistd.h> header file. */
1280- /* #undef HAVE_UNISTD_H */
1281-
1282- /* Define to 1 if you have the windows.h header file. */
1300+ /* THESE ASK WHETHER A HEADER IS THERE, SO THEY ASK THE COMPILER.
1301+ *
1302+ * This block is the Windows branch of a recipe that branches on the PLATFORM,
1303+ * and it used to define all four unconditionally. That was true of every
1304+ * Windows target this index had until a C library began presenting POSIX on
1305+ * one: over openkal the target is still PE, still Win64, and there is no
1306+ * `windows.h` --- `ares_setup.h:81` then reached for it and this repository's
1307+ * own compatibility measurement recorded
1308+ *
1309+ * ares_setup.h:81:12: fatal error: 'windows.h' file not found
1310+ *
1311+ * `__has_include` is standard C and asks the question actually being asked.
1312+ * `HAVE_UNISTD_H` gets the same treatment for the same reason, from the other
1313+ * side: a POSIX-presenting Windows target HAS it. */
1314+ #if __has_include(<unistd.h>)
1315+ #define HAVE_UNISTD_H 1
1316+ #endif
1317+
1318+ #if __has_include(<windows.h>)
12831319#define HAVE_WINDOWS_H
1320+ #endif
12841321
1285- /* Define to 1 if you have the winsock2.h header file. */
1322+ # if __has_include(< winsock2.h>)
12861323#define HAVE_WINSOCK2_H
1324+ #endif
12871325
1288- /* Define to 1 if you have the winsock.h header file. */
1326+ # if __has_include(< winsock.h>)
12891327#define HAVE_WINSOCK_H
1328+ #endif
12901329
12911330/* Define to 1 if you have the writev function. */
12921331/* #undef HAVE_WRITEV */
12931332
1294- /* Define to 1 if you have the ws2tcpip.h header file. */
1333+ # if __has_include(< ws2tcpip.h>)
12951334#define HAVE_WS2TCPIP_H
1335+ #endif
12961336
12971337/* Define if __system_property_get exists. */
12981338/* #undef HAVE___SYSTEM_PROPERTY_GET */
0 commit comments