Skip to content

Commit 75f5313

Browse files
committed
Revert "recipes ask whether a header is there instead of inferring it from the platform"
This reverts commit 080ce77.
1 parent 080ce77 commit 75f5313

2 files changed

Lines changed: 17 additions & 93 deletions

File tree

‎pkgs/c/compat.c-ares.lua‎

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,9 +1030,7 @@ package = {
10301030
#define HAVE_BOOL_T
10311031
10321032
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
1033-
#if __has_include(<time.h>) && !defined(_WIN32)
1034-
#define HAVE_CLOCK_GETTIME_MONOTONIC 1
1035-
#endif
1033+
/* #undef HAVE_CLOCK_GETTIME_MONOTONIC */
10361034
10371035
/* Define to 1 if you have the closesocket function. */
10381036
#define HAVE_CLOSESOCKET
@@ -1089,12 +1087,7 @@ package = {
10891087
/* #undef HAVE_GETSERVBYPORT_R */
10901088
10911089
/* Define to 1 if you have the `gettimeofday' function. */
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
1090+
/* #undef HAVE_GETTIMEOFDAY */
10981091
10991092
/* Define to 1 if you have the `if_indextoname' function. */
11001093
/* #undef HAVE_IF_INDEXTONAME */
@@ -1212,22 +1205,10 @@ package = {
12121205
#define HAVE_STDLIB_H
12131206
12141207
/* Define to 1 if you have the strcasecmp function. */
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 */
1208+
/* #undef HAVE_STRCASECMP */
12261209
12271210
/* Define to 1 if you have the strcmpi function. */
1228-
#if !__has_include(<strings.h>)
12291211
#define HAVE_STRCMPI
1230-
#endif
12311212
12321213
/* Define to 1 if you have the strdup function. */
12331214
#define HAVE_STRDUP
@@ -1248,9 +1229,7 @@ package = {
12481229
/* #undef HAVE_STRNCMPI */
12491230
12501231
/* Define to 1 if you have the strnicmp function. */
1251-
#if !__has_include(<strings.h>)
12521232
#define HAVE_STRNICMP
1253-
#endif
12541233
12551234
/* Define to 1 if you have the <stropts.h> header file. */
12561235
/* #undef HAVE_STROPTS_H */
@@ -1297,42 +1276,23 @@ package = {
12971276
/* Define to 1 if you have the <time.h> header file. */
12981277
#define HAVE_TIME_H
12991278
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>)
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. */
13191283
#define HAVE_WINDOWS_H
1320-
#endif
13211284
1322-
#if __has_include(<winsock2.h>)
1285+
/* Define to 1 if you have the winsock2.h header file. */
13231286
#define HAVE_WINSOCK2_H
1324-
#endif
13251287
1326-
#if __has_include(<winsock.h>)
1288+
/* Define to 1 if you have the winsock.h header file. */
13271289
#define HAVE_WINSOCK_H
1328-
#endif
13291290
13301291
/* Define to 1 if you have the writev function. */
13311292
/* #undef HAVE_WRITEV */
13321293
1333-
#if __has_include(<ws2tcpip.h>)
1294+
/* Define to 1 if you have the ws2tcpip.h header file. */
13341295
#define HAVE_WS2TCPIP_H
1335-
#endif
13361296
13371297
/* Define if __system_property_get exists. */
13381298
/* #undef HAVE___SYSTEM_PROPERTY_GET */

‎pkgs/c/compat.curl.lua‎

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -248,56 +248,20 @@ package = {
248248
#if defined(__linux__)
249249
250250
#define CURL_OS "Linux"
251-
252-
/* `__linux__` ANSWERS "WHICH KERNEL", NOT "WHICH USERSPACE IS INSTALLED", and
253-
* this block used to read it as the second. Every entry below that names a
254-
* HEADER now asks whether that header is reachable, which is the question
255-
* being asked and is standard C; every entry that names a GLIBC extension
256-
* asks for glibc.
257-
*
258-
* Measured: over openkal-musl on x86_64-linux-gnu the kernel is Linux, so
259-
* `__linux__` is correct, and `#define HAVE_LINUX_TCP_H 1` then sent
260-
* `lib/setopt.c:31` to a uapi header that C library does not carry ---
261-
* `fatal error: 'linux/tcp.h' file not found`, one of the failures in this
262-
* repository's own compatibility measurement. */
263-
#if __has_include(<linux/tcp.h>)
264-
#define HAVE_LINUX_TCP_H 1
265-
#endif
266-
/* `__has_include` ANSWERS ABOUT THE HEADER, NOT ABOUT THE FUNCTION, and those
267-
* two come apart here. openkal-musl CARRIES `sys/eventfd.h` and declares
268-
* `eventfd` absent in its `[c-abi-absent]` table, so defining `HAVE_EVENTFD`
269-
* from the header's presence produced a link that mcpp explained by name:
270-
*
271-
* the C library in this graph (musl) declares that it does not supply
272-
* the following, and the link has just asked for it:
273-
* eventfd as timerfd_create
274-
*
275-
* Neither is declared: curl has a poll-based path and takes it. A header
276-
* test cannot stand in for a symbol test. */
277-
#if __has_include(<termio.h>)
278-
#define HAVE_TERMIO_H 1
279-
#endif
280-
#if __has_include(<sys/xattr.h>)
281-
#define HAVE_FSETXATTR 1
282-
#define HAVE_FSETXATTR_5 1
283-
#endif
284-
285-
/* WHICH `strerror_r`, AND EXACTLY ONE OF THEM. glibc's returns `char*`,
286-
* POSIX's returns `int`, and `strerr.c:30` refuses a configuration that names
287-
* neither or both. Asking `__linux__` answered "glibc" for musl, which is the
288-
* wrong one; leaving it out answered "neither", which is also refused. */
289-
#if defined(__GLIBC__)
251+
/* glibc's strerror_r returns char*, not int — curl needs to know which */
290252
#define HAVE_GLIBC_STRERROR_R 1
291-
#else
292-
#define HAVE_POSIX_STRERROR_R 1
293-
#endif
294-
295253
#define HAVE_GETHOSTBYNAME_R 1
296254
#define HAVE_GETHOSTBYNAME_R_6 1
297255
#define HAVE_ACCEPT4 1
298256
#define HAVE_PIPE2 1
257+
#define HAVE_EVENTFD 1
258+
#define HAVE_SYS_EVENTFD_H 1
299259
#define HAVE_SENDMMSG 1
300260
#define HAVE_MEMRCHR 1
261+
#define HAVE_FSETXATTR 1
262+
#define HAVE_FSETXATTR_5 1
263+
#define HAVE_LINUX_TCP_H 1
264+
#define HAVE_TERMIO_H 1
301265
#define HAVE_CLOCK_GETTIME_MONOTONIC_RAW 1
302266
/* Debian/Fedora layout; overridable at runtime with CURLOPT_CAINFO or the
303267
* SSL_CERT_FILE environment variable. */

0 commit comments

Comments
 (0)