aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-03-23 12:10:58 +0100
committerlemon <lsof@mailbox.org>2026-03-23 12:10:58 +0100
commit4f2fb9ba5f529890b2a341e30a1c0c978a882e3a (patch)
tree96470481c074deeb856731a14be2045d297b730a
parentc1267dbfeb153c782e9690de8962aaf176ed0cdd (diff)
<iso646.h>, test for libc headers
-rw-r--r--src/a_embedfilesdir.c14
-rw-r--r--src/u_io.c4
-rw-r--r--test/19-libc-headers.c48
3 files changed, 62 insertions, 4 deletions
diff --git a/src/a_embedfilesdir.c b/src/a_embedfilesdir.c
index 64189ef..d07bb87 100644
--- a/src/a_embedfilesdir.c
+++ b/src/a_embedfilesdir.c
@@ -85,6 +85,20 @@ typedef __builtin_va_list __gnuc_va_list;\n\
#define LDBL_TRUE_MIN 4.94066e-324\n\
")},
+{"iso646.h", S("\
+#define and &&\
+#define and_eq &=\
+#define bitand &\
+#define bitor |\
+#define compl ~\
+#define not !\
+#define not_eq !=\
+#define or ||\
+#define or_eq |=\
+#define xor ^\
+#define xor_eq ^=\
+")},
+
{"stdnoreturn.h", S("\
#define noreturn _Noreturn\n\
")},
diff --git a/src/u_io.c b/src/u_io.c
index f376c98..1dccb9d 100644
--- a/src/u_io.c
+++ b/src/u_io.c
@@ -857,10 +857,6 @@ openfile(const char **err, MemFile **pf, const char *path)
size_t h, id, n = countof(fileht);
if (*path == '@' && path[1] == ':') {
- /* fast path to rule out filenames we know for sure aren't builtin */
- /* !KEEP SYNC with embedfilesdir */
- if (path[2] != 's' /* std*.h */
- && path[2] != 'f' /* float.h */) return -1;
uid.dev = -1;
uid.str = path;
h = hashs(0, path+2);
diff --git a/test/19-libc-headers.c b/test/19-libc-headers.c
new file mode 100644
index 0000000..2c8db38
--- /dev/null
+++ b/test/19-libc-headers.c
@@ -0,0 +1,48 @@
+/* EXPECT:
+*/
+
+/* C89 */
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <float.h>
+#include <limits.h>
+#include <locale.h>
+#include <math.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <wchar.h>
+#include <wctype.h>
+#include <iso646.h>
+
+/* C99 */
+#include <complex.h>
+#include <fenv.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <uchar.h>
+
+/* C11 */
+#include <stdalign.h>
+#ifndef __STDC_NO_ATOMICS__
+#include <stdatomic.h>
+#endif
+#include <threads.h>
+#include <stdnoreturn.h>
+#include <stdbit.h>
+
+/* C23 */
+// #include <stdbit.h>
+// #include <stdckdint.h>
+// #include <tgmath.h>
+
+int main(void) {
+ return 0;
+}