summaryrefslogtreecommitdiff
path: root/libc/conform/data
diff options
context:
space:
mode:
Diffstat (limited to 'libc/conform/data')
-rw-r--r--libc/conform/data/complex.h-data31
-rw-r--r--libc/conform/data/inttypes.h-data288
-rw-r--r--libc/conform/data/iso646.h-data2
-rw-r--r--libc/conform/data/math.h-data2
-rw-r--r--libc/conform/data/pthread.h-data20
-rw-r--r--libc/conform/data/stdalign.h-data6
-rw-r--r--libc/conform/data/stdbool.h-data10
-rw-r--r--libc/conform/data/stdint.h-data107
-rw-r--r--libc/conform/data/stdlib.h-data4
-rw-r--r--libc/conform/data/stdnoreturn.h-data3
-rw-r--r--libc/conform/data/sys/mman.h-data20
-rw-r--r--libc/conform/data/sys/stat.h-data2
-rw-r--r--libc/conform/data/sys/types.h-data6
-rw-r--r--libc/conform/data/tgmath.h-data363
-rw-r--r--libc/conform/data/time.h-data2
-rw-r--r--libc/conform/data/uchar.h-data2
-rw-r--r--libc/conform/data/wchar.h-data25
-rw-r--r--libc/conform/data/wctype.h-data14
18 files changed, 336 insertions, 571 deletions
diff --git a/libc/conform/data/complex.h-data b/libc/conform/data/complex.h-data
index 8abfb507b..7de888f81 100644
--- a/libc/conform/data/complex.h-data
+++ b/libc/conform/data/complex.h-data
@@ -79,4 +79,35 @@ macro-function {double complex} CMPLX (double, double)
macro-function {float complex} CMPLXF (float, float)
macro-function {long double complex} CMPLXL (long double, long double)
# endif
+
+allow cerf
+allow cerfc
+allow cexp2
+allow cexpm1
+allow clog10
+allow clog1p
+allow clog2
+allow clgamma
+allow ctgamma
+
+allow cerff
+allow cerfcf
+allow cexp2f
+allow cexpm1f
+allow clog10f
+allow clog1pf
+allow clog2f
+allow clgammaf
+allow ctgammaf
+
+allow cerfl
+allow cerfcl
+allow cexp2l
+allow cexpm1l
+allow clog10l
+allow clog1pl
+allow clog2l
+allow clgammal
+allow ctgammal
+
#endif
diff --git a/libc/conform/data/inttypes.h-data b/libc/conform/data/inttypes.h-data
index 5ef54f6eb..8c076dff8 100644
--- a/libc/conform/data/inttypes.h-data
+++ b/libc/conform/data/inttypes.h-data
@@ -1,14 +1,5 @@
#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
-type int8_t
-type int16_t
-type int32_t
-type int64_t
-type uint8_t
-type uint16_t
-type uint32_t
-type uint64_t
-type intptr_t
-type uintptr_t
+#include "stdint.h-data"
type imaxdiv_t
element imaxdiv_t intmax_t rem
@@ -21,125 +12,166 @@ function uintmax_t strtoumax (const char*, char**, int)
function intmax_t wcstoimax (const __gwchar_t*, __gwchar_t**, int)
function uintmax_t wcstoumax (const __gwchar_t*, __gwchar_t**, int)
-allow PRI*
-allow SCN*
-allow *_t
+macro PRId8
+macro PRIi8
+macro PRIo8
+macro PRIu8
+macro PRIx8
+macro PRIX8
+macro SCNd8
+macro SCNi8
+macro SCNo8
+macro SCNu8
+macro SCNx8
+macro PRIdLEAST8
+macro PRIiLEAST8
+macro PRIoLEAST8
+macro PRIuLEAST8
+macro PRIxLEAST8
+macro PRIXLEAST8
+macro SCNdLEAST8
+macro SCNiLEAST8
+macro SCNoLEAST8
+macro SCNuLEAST8
+macro SCNxLEAST8
+macro PRIdFAST8
+macro PRIiFAST8
+macro PRIoFAST8
+macro PRIuFAST8
+macro PRIxFAST8
+macro PRIXFAST8
+macro SCNdFAST8
+macro SCNiFAST8
+macro SCNoFAST8
+macro SCNuFAST8
+macro SCNxFAST8
+
+macro PRId16
+macro PRIi16
+macro PRIo16
+macro PRIu16
+macro PRIx16
+macro PRIX16
+macro SCNd16
+macro SCNi16
+macro SCNo16
+macro SCNu16
+macro SCNx16
+macro PRIdLEAST16
+macro PRIiLEAST16
+macro PRIoLEAST16
+macro PRIuLEAST16
+macro PRIxLEAST16
+macro PRIXLEAST16
+macro SCNdLEAST16
+macro SCNiLEAST16
+macro SCNoLEAST16
+macro SCNuLEAST16
+macro SCNxLEAST16
+macro PRIdFAST16
+macro PRIiFAST16
+macro PRIoFAST16
+macro PRIuFAST16
+macro PRIxFAST16
+macro PRIXFAST16
+macro SCNdFAST16
+macro SCNiFAST16
+macro SCNoFAST16
+macro SCNuFAST16
+macro SCNxFAST16
+
+macro PRId32
+macro PRIi32
+macro PRIo32
+macro PRIu32
+macro PRIx32
+macro PRIX32
+macro SCNd32
+macro SCNi32
+macro SCNo32
+macro SCNu32
+macro SCNx32
+macro PRIdLEAST32
+macro PRIiLEAST32
+macro PRIoLEAST32
+macro PRIuLEAST32
+macro PRIxLEAST32
+macro PRIXLEAST32
+macro SCNdLEAST32
+macro SCNiLEAST32
+macro SCNoLEAST32
+macro SCNuLEAST32
+macro SCNxLEAST32
+macro PRIdFAST32
+macro PRIiFAST32
+macro PRIoFAST32
+macro PRIuFAST32
+macro PRIxFAST32
+macro PRIXFAST32
+macro SCNdFAST32
+macro SCNiFAST32
+macro SCNoFAST32
+macro SCNuFAST32
+macro SCNxFAST32
+
+macro PRId64
+macro PRIi64
+macro PRIo64
+macro PRIu64
+macro PRIx64
+macro PRIX64
+macro SCNd64
+macro SCNi64
+macro SCNo64
+macro SCNu64
+macro SCNx64
+macro PRIdLEAST64
+macro PRIiLEAST64
+macro PRIoLEAST64
+macro PRIuLEAST64
+macro PRIxLEAST64
+macro PRIXLEAST64
+macro SCNdLEAST64
+macro SCNiLEAST64
+macro SCNoLEAST64
+macro SCNuLEAST64
+macro SCNxLEAST64
+macro PRIdFAST64
+macro PRIiFAST64
+macro PRIoFAST64
+macro PRIuFAST64
+macro PRIxFAST64
+macro PRIXFAST64
+macro SCNdFAST64
+macro SCNiFAST64
+macro SCNoFAST64
+macro SCNuFAST64
+macro SCNxFAST64
+
+macro PRIdMAX
+macro PRIiMAX
+macro PRIoMAX
+macro PRIuMAX
+macro PRIxMAX
+macro PRIXMAX
+macro SCNdMAX
+macro SCNiMAX
+macro SCNoMAX
+macro SCNuMAX
+macro SCNxMAX
+
+macro PRIdPTR
+macro PRIiPTR
+macro PRIoPTR
+macro PRIuPTR
+macro PRIxPTR
+macro PRIXPTR
+macro SCNdPTR
+macro SCNiPTR
+macro SCNoPTR
+macro SCNuPTR
+macro SCNxPTR
-// Now the content of <stdint.h>. Update this whenever <stdint.h> changed.
-type int8_t
-type int16_t
-type int32_t
-type int64_t
-type uint8_t
-type uint16_t
-type uint32_t
-type uint64_t
-
-type int_least8_t
-type int_least16_t
-type int_least32_t
-type int_least64_t
-type uint_least8_t
-type uint_least16_t
-type uint_least32_t
-type uint_least64_t
-
-type int_fast8_t
-type int_fast16_t
-type int_fast32_t
-type int_fast64_t
-type uint_fast8_t
-type uint_fast16_t
-type uint_fast32_t
-type uint_fast64_t
-
-type intptr_t
-type uintptr_t
-
-type intmax_t
-type uintmax_t
-
-constant INT8_MIN == -128
-constant INT8_MAX == 127
-constant INT16_MIN == -32768
-constant INT16_MAX == 32767
-constant INT32_MIN == -2147483647-1
-constant INT32_MAX == 2147483647
-constant INT64_MIN == -9223372036854775807LL-1
-constant INT64_MAX == 9223372036854775807LL
-
-constant UINT8_MAX == 255
-constant UINT16_MAX == 65535
-constant UINT32_MAX == 4294967295U
-constant UINT64_MAX == 18446744073709551615ULL
-
-constant INT_LEAST8_MIN <= -128
-constant INT_LEAST8_MAX >= 127
-constant INT_LEAST16_MIN <= -32768
-constant INT_LEAST16_MAX >= 32767
-constant INT_LEAST32_MIN <= -2147483647-1
-constant INT_LEAST32_MAX >= 2147483647
-constant INT_LEAST64_MIN <= -9223372036854775807LL-1
-constant INT_LEAST64_MAX >= 9223372036854775807LL
-
-constant UINT_LEAST8_MAX >= 255
-constant UINT_LEAST16_MAX >= 65535
-constant UINT_LEAST32_MAX >= 4294967295U
-constant UINT_LEAST64_MAX >= 18446744073709551615ULL
-
-constant INT_FAST8_MIN <= -128
-constant INT_FAST8_MAX >= 127
-constant INT_FAST16_MIN <= -32768
-constant INT_FAST16_MAX >= 32767
-constant INT_FAST32_MIN <= -2147483647-1
-constant INT_FAST32_MAX >= 2147483647
-constant INT_FAST64_MIN <= -9223372036854775807LL-1
-constant INT_FAST64_MAX >= 9223372036854775807LL
-
-constant UINT_FAST8_MAX >= 255
-constant UINT_FAST16_MAX >= 65535
-constant UINT_FAST32_MAX >= 4294967295U
-constant UINT_FAST64_MAX >= 18446744073709551615ULL
-
-constant INTPTR_MIN <= -32768
-constant INTPTR_MAX >= 32767
-
-constant UINTPTR_MAX >= 65535
-
-constant INTMAX_MIN <= -9223372036854775807LL-1
-constant INTMAX_MAX >= 9223372036854775807LL
-
-constant UINTMAX_MAX >= 18446744073709551615ULL
-
-constant PTRDIFF_MIN <= -65535
-constant PTRDIFF_MAX >= 65535
-
-constant SIG_ATOMIC_MIN <= -127
-constant SIG_ATOMIC_MAX >= 127
-
-constant SIZE_MAX >= 65535
-
-constant WCHAR_MIN <= -127
-constant WCHAR_MAX >= 127
-
-constant WINT_MIN <= -127
-constant WINT_MAX >= 127
-
-macro INT8_C
-macro INT16_C
-macro INT32_C
-macro INT64_C
-macro UINT8_C
-macro UINT16_C
-macro UINT32_C
-macro UINT64_C
-macro INTMAX_C
-macro UINTMAX_C
-
-// The following expressions are not entirely correct but the current
-// poorfnmatch implementation doesn't grok the right form.
-allow INT*
-allow UINT*
allow PRI[Xa-z]*
allow SCN[Xa-z]*
#endif
diff --git a/libc/conform/data/iso646.h-data b/libc/conform/data/iso646.h-data
index 7ac7d09ab..d4afaa579 100644
--- a/libc/conform/data/iso646.h-data
+++ b/libc/conform/data/iso646.h-data
@@ -11,5 +11,7 @@ macro or_eq
macro xor
macro xor_eq
+#if !defined ISO && !defined ISO99 && !defined ISO11
allow *_t
#endif
+#endif
diff --git a/libc/conform/data/math.h-data b/libc/conform/data/math.h-data
index 0d9246d8b..0a05b8dc5 100644
--- a/libc/conform/data/math.h-data
+++ b/libc/conform/data/math.h-data
@@ -18,7 +18,7 @@ type float_t
type double_t
# endif
# if defined XPG3 || defined XPG4 || defined UNIX98
-function double isnan (double)
+function int isnan (double)
# endif
# if !defined ISO99 && !defined ISO11 && !defined POSIX2008
diff --git a/libc/conform/data/pthread.h-data b/libc/conform/data/pthread.h-data
index 4af4d05b5..292b12520 100644
--- a/libc/conform/data/pthread.h-data
+++ b/libc/conform/data/pthread.h-data
@@ -1,4 +1,4 @@
-#if !defined ISO && !defined ISO99 && !defined ISO11
+#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG3 && !defined XPG4
constant PTHREAD_CANCEL_ASYNCHRONOUS
constant PTHREAD_CANCEL_ENABLE
constant PTHREAD_CANCEL_DEFERRED
@@ -31,7 +31,7 @@ constant PTHREAD_MUTEX_STALLED
# endif
type pthread_attr_t
-# if !defined POSIX
+# if !defined POSIX && !defined UNIX98
type pthread_barrier_t
type pthread_barrierattr_t
# endif
@@ -44,6 +44,8 @@ type pthread_once_t
# if !defined POSIX
type pthread_rwlock_t
type pthread_rwlockattr_t
+# endif
+# if !defined POSIX && !defined UNIX98
type pthread_spinlock_t
# endif
type pthread_t
@@ -70,7 +72,7 @@ function int pthread_attr_setschedpolicy (pthread_attr_t*, int)
function int pthread_attr_setscope (pthread_attr_t*, int)
function int pthread_attr_setstackaddr (pthread_attr_t*, void*)
function int pthread_attr_setstacksize (pthread_attr_t*, size_t)
-# if !defined POSIX
+# if !defined POSIX && !defined UNIX98
function int pthread_barrier_destroy (pthread_barrier_t*)
function int pthread_barrier_init (pthread_barrier_t*, const pthread_barrierattr_t*, unsigned int)
function int pthread_barrier_wait (pthread_barrier_t*)
@@ -107,7 +109,7 @@ function void pthread_exit (void*)
# if !defined POSIX && !defined POSIX2008
function int pthread_getconcurrency (void)
# endif
-# if !defined POSIX
+# if !defined POSIX && !defined UNIX98
function int pthread_getcpuclockid (pthread_t, clockid_t*)
# endif
function int pthread_getschedparam (pthread_t, int*, struct sched_param*)
@@ -120,7 +122,7 @@ optional-function int pthread_mutex_getprioceiling (const pthread_mutex_t*, int*
function int pthread_mutex_init (pthread_mutex_t*, const pthread_mutexattr_t*)
function int pthread_mutex_lock (pthread_mutex_t*)
optional-function int pthread_mutex_setprioceiling (pthread_mutex_t*, int, int*)
-# if !defined POSIX
+# if !defined POSIX && !defined UNIX98
function int pthread_mutex_timedlock (pthread_mutex_t*, const struct timespec*)
# endif
function int pthread_mutex_trylock (pthread_mutex_t*)
@@ -143,8 +145,12 @@ function int pthread_once (pthread_once_t*, void (*) (void))
# if !defined POSIX
function int pthread_rwlock_init (pthread_rwlock_t*, const pthread_rwlockattr_t*)
function int pthread_rwlock_rdlock (pthread_rwlock_t*)
+# endif
+# if !defined POSIX && !defined UNIX98
function int pthread_rwlock_timedrdlock (pthread_rwlock_t*, const struct timespec*)
function int pthread_rwlock_timedwrlock (pthread_rwlock_t*, const struct timespec*)
+# endif
+# if !defined POSIX
function int pthread_rwlock_tryrdlock (pthread_rwlock_t*)
function int pthread_rwlock_trywrlock (pthread_rwlock_t*)
function int pthread_rwlock_unlock (pthread_rwlock_t*)
@@ -162,10 +168,10 @@ function int pthread_setconcurrency (int)
# endif
function int pthread_setschedparam (pthread_t, int, const struct sched_param*)
function int pthread_setspecific (pthread_key_t, const void*)
-# if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
+# if !defined POSIX && !defined UNIX98 && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
function int pthread_sigmask (int, const sigset_t*, sigset_t*)
# endif
-# if !defined POSIX
+# if !defined POSIX && !defined UNIX98
function int pthread_spin_destroy (pthread_spinlock_t*)
function int pthread_spin_init (pthread_spinlock_t*, int)
function int pthread_spin_lock (pthread_spinlock_t*)
diff --git a/libc/conform/data/stdalign.h-data b/libc/conform/data/stdalign.h-data
new file mode 100644
index 000000000..edc2310e9
--- /dev/null
+++ b/libc/conform/data/stdalign.h-data
@@ -0,0 +1,6 @@
+#if defined ISO11
+macro alignas
+macro alignof
+macro-int-constant __alignas_is_defined {int} == 1
+macro-int-constant __alignof_is_defined {int} == 1
+#endif
diff --git a/libc/conform/data/stdbool.h-data b/libc/conform/data/stdbool.h-data
new file mode 100644
index 000000000..9ef218c5e
--- /dev/null
+++ b/libc/conform/data/stdbool.h-data
@@ -0,0 +1,10 @@
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
+macro bool
+macro-int-constant true {int} == 1
+macro-int-constant false {int} == 0
+macro-int-constant __bool_true_false_are_defined {int} == 1
+
+#if !defined ISO && !defined ISO99 && !defined ISO11
+allow *_t
+#endif
+#endif
diff --git a/libc/conform/data/stdint.h-data b/libc/conform/data/stdint.h-data
index 99bdf22ac..f6689513c 100644
--- a/libc/conform/data/stdint.h-data
+++ b/libc/conform/data/stdint.h-data
@@ -1,4 +1,5 @@
#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
+// The requirements for some types and corresponding macros are from POSIX.
type int8_t
type int16_t
type int32_t
@@ -32,71 +33,71 @@ type uintptr_t
type intmax_t
type uintmax_t
-constant INT8_MIN == -128
-constant INT8_MAX == 127
-constant INT16_MIN == -32768
-constant INT16_MAX == 32767
-constant INT32_MIN == -2147483647-1
-constant INT32_MAX == 2147483647
-constant INT64_MIN == -9223372036854775807LL-1
-constant INT64_MAX == 9223372036854775807LL
+macro-int-constant INT8_MIN {promoted:int8_t} == -128
+macro-int-constant INT8_MAX {promoted:int8_t} == 127
+macro-int-constant INT16_MIN {promoted:int16_t} == -32768
+macro-int-constant INT16_MAX {promoted:int16_t} == 32767
+macro-int-constant INT32_MIN {promoted:int32_t} == -2147483647-1
+macro-int-constant INT32_MAX {promoted:int32_t} == 2147483647
+macro-int-constant INT64_MIN {promoted:int64_t} == -9223372036854775807LL-1
+macro-int-constant INT64_MAX {promoted:int64_t} == 9223372036854775807LL
-constant UINT8_MAX == 255
-constant UINT16_MAX == 65535
-constant UINT32_MAX == 4294967295U
-constant UINT64_MAX == 18446744073709551615ULL
+macro-int-constant UINT8_MAX {promoted:uint8_t} == 255
+macro-int-constant UINT16_MAX {promoted:uint16_t} == 65535
+macro-int-constant UINT32_MAX {promoted:uint32_t} == 4294967295U
+macro-int-constant UINT64_MAX {promoted:uint64_t} == 18446744073709551615ULL
-constant INT_LEAST8_MIN <= -128
-constant INT_LEAST8_MAX >= 127
-constant INT_LEAST16_MIN <= -32768
-constant INT_LEAST16_MAX >= 32767
-constant INT_LEAST32_MIN <= -2147483647-1
-constant INT_LEAST32_MAX >= 2147483647
-constant INT_LEAST64_MIN <= -9223372036854775807LL-1
-constant INT_LEAST64_MAX >= 9223372036854775807LL
+macro-int-constant INT_LEAST8_MIN {promoted:int_least8_t} <= -128
+macro-int-constant INT_LEAST8_MAX {promoted:int_least8_t} >= 127
+macro-int-constant INT_LEAST16_MIN {promoted:int_least16_t} <= -32768
+macro-int-constant INT_LEAST16_MAX {promoted:int_least16_t} >= 32767
+macro-int-constant INT_LEAST32_MIN {promoted:int_least32_t} <= -2147483647-1
+macro-int-constant INT_LEAST32_MAX {promoted:int_least32_t} >= 2147483647
+macro-int-constant INT_LEAST64_MIN {promoted:int_least64_t} <= -9223372036854775807LL-1
+macro-int-constant INT_LEAST64_MAX {promoted:int_least64_t} >= 9223372036854775807LL
-constant UINT_LEAST8_MAX >= 255
-constant UINT_LEAST16_MAX >= 65535
-constant UINT_LEAST32_MAX >= 4294967295U
-constant UINT_LEAST64_MAX >= 18446744073709551615ULL
+macro-int-constant UINT_LEAST8_MAX {promoted:uint_least8_t} >= 255
+macro-int-constant UINT_LEAST16_MAX {promoted:uint_least16_t} >= 65535
+macro-int-constant UINT_LEAST32_MAX {promoted:uint_least32_t} >= 4294967295U
+macro-int-constant UINT_LEAST64_MAX {promoted:uint_least64_t} >= 18446744073709551615ULL
-constant INT_FAST8_MIN <= -128
-constant INT_FAST8_MAX >= 127
-constant INT_FAST16_MIN <= -32768
-constant INT_FAST16_MAX >= 32767
-constant INT_FAST32_MIN <= -2147483647-1
-constant INT_FAST32_MAX >= 2147483647
-constant INT_FAST64_MIN <= -9223372036854775807LL-1
-constant INT_FAST64_MAX >= 9223372036854775807LL
+macro-int-constant INT_FAST8_MIN {promoted:int_fast8_t} <= -128
+macro-int-constant INT_FAST8_MAX {promoted:int_fast8_t} >= 127
+macro-int-constant INT_FAST16_MIN {promoted:int_fast16_t} <= -32768
+macro-int-constant INT_FAST16_MAX {promoted:int_fast16_t} >= 32767
+macro-int-constant INT_FAST32_MIN {promoted:int_fast32_t} <= -2147483647-1
+macro-int-constant INT_FAST32_MAX {promoted:int_fast32_t} >= 2147483647
+macro-int-constant INT_FAST64_MIN {promoted:int_fast64_t} <= -9223372036854775807LL-1
+macro-int-constant INT_FAST64_MAX {promoted:int_fast64_t} >= 9223372036854775807LL
-constant UINT_FAST8_MAX >= 255
-constant UINT_FAST16_MAX >= 65535
-constant UINT_FAST32_MAX >= 4294967295U
-constant UINT_FAST64_MAX >= 18446744073709551615ULL
+macro-int-constant UINT_FAST8_MAX {promoted:uint_fast8_t} >= 255
+macro-int-constant UINT_FAST16_MAX {promoted:uint_fast16_t} >= 65535
+macro-int-constant UINT_FAST32_MAX {promoted:uint_fast32_t} >= 4294967295U
+macro-int-constant UINT_FAST64_MAX {promoted:uint_fast64_t} >= 18446744073709551615ULL
-constant INTPTR_MIN <= -32768
-constant INTPTR_MAX >= 32767
+macro-int-constant INTPTR_MIN {promoted:intptr_t} <= -32768
+macro-int-constant INTPTR_MAX {promoted:intptr_t} >= 32767
-constant UINTPTR_MAX >= 65535
+macro-int-constant UINTPTR_MAX {promoted:uintptr_t} >= 65535
-constant INTMAX_MIN <= -9223372036854775807LL-1
-constant INTMAX_MAX >= 9223372036854775807LL
+macro-int-constant INTMAX_MIN {promoted:intmax_t} <= -9223372036854775807LL-1
+macro-int-constant INTMAX_MAX {promoted:intmax_t} >= 9223372036854775807LL
-constant UINTMAX_MAX >= 18446744073709551615ULL
+macro-int-constant UINTMAX_MAX {promoted:uintmax_t} >= 18446744073709551615ULL
-constant PTRDIFF_MIN <= -65535
-constant PTRDIFF_MAX >= 65535
+macro-int-constant PTRDIFF_MIN {promoted:__PTRDIFF_TYPE__} <= -65535
+macro-int-constant PTRDIFF_MAX {promoted:__PTRDIFF_TYPE__} >= 65535
-constant SIG_ATOMIC_MIN <= -127
-constant SIG_ATOMIC_MAX >= 127
+macro-int-constant SIG_ATOMIC_MIN {promoted:__SIG_ATOMIC_TYPE__}
+macro-int-constant SIG_ATOMIC_MAX {promoted:__SIG_ATOMIC_TYPE__} >= 127
-constant SIZE_MAX >= 65535
+macro-int-constant SIZE_MAX {promoted:__SIZE_TYPE__} >= 65535
-constant WCHAR_MIN <= -127
-constant WCHAR_MAX >= 127
+macro-int-constant WCHAR_MIN {promoted:__WCHAR_TYPE__}
+macro-int-constant WCHAR_MAX {promoted:__WCHAR_TYPE__} >= 127
-constant WINT_MIN <= -127
-constant WINT_MAX >= 127
+macro-int-constant WINT_MIN {promoted:__WINT_TYPE__}
+macro-int-constant WINT_MAX {promoted:__WINT_TYPE__} >= 127
macro INT8_C
macro INT16_C
@@ -110,7 +111,9 @@ macro INTMAX_C
macro UINTMAX_C
// The following expressions are not entirely correct but the current
-// fnamtch implementation doesn't grok the right form.
+// poorfnmatch implementation doesn't grok the right forms (INT*_MAX,
+// INT*_MIN, INT*_C, UINT*_MAX, UINT*_MIN, UINT*_C, int*_t, uint*_t).
allow INT*
allow UINT*
+allow *_t
#endif
diff --git a/libc/conform/data/stdlib.h-data b/libc/conform/data/stdlib.h-data
index 0b8dc3d12..382fff66b 100644
--- a/libc/conform/data/stdlib.h-data
+++ b/libc/conform/data/stdlib.h-data
@@ -138,7 +138,7 @@ function {void*} realloc (void*, size_t)
function {char*} realpath (const char*, char*)
function {unsigned short int*} seed48 (unsigned short int[3])
#endif
-#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
+#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
function int setenv (const char*, const char*, int)
#endif
#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008
@@ -168,7 +168,7 @@ function int ttyslot (void)
#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008
function int unlockpt (int)
#endif
-#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
+#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
function int unsetenv (const char*)
#endif
#if defined XPG3 || defined XPG4 || defined UNIX98
diff --git a/libc/conform/data/stdnoreturn.h-data b/libc/conform/data/stdnoreturn.h-data
new file mode 100644
index 000000000..77b9a589d
--- /dev/null
+++ b/libc/conform/data/stdnoreturn.h-data
@@ -0,0 +1,3 @@
+#if defined ISO11
+macro noreturn
+#endif
diff --git a/libc/conform/data/sys/mman.h-data b/libc/conform/data/sys/mman.h-data
index 21be6ff59..62f8f4b32 100644
--- a/libc/conform/data/sys/mman.h-data
+++ b/libc/conform/data/sys/mman.h-data
@@ -17,25 +17,31 @@ constant MCL_FUTURE
constant MAP_FAILED
-#ifndef POSIX
+# if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
constant POSIX_MADV_NORMAL
constant POSIX_MADV_SEQUENTIAL
constant POSIX_MADV_RANDOM
constant POSIX_MADV_WILLNEED
constant POSIX_MADV_DONTNEED
-#endif
optional-constant POSIX_TYPED_MEM_ALLOCATE
optional-constant POSIX_TYPED_MEM_ALLOCATE_CONTIG
optional-constant POSIX_TYPED_MEM_MAP_ALLOCATABLE
-type size_t
-type off_t
type mode_t
optional-type {struct posix_typedmem_info}
optional-element {struct posix_typedmem_info} size_t posix_tmi_length
+function int posix_madvise (void*, size_t, int)
+optional-function int posix_mem_offset (const void*, size_t, off_t*, size_t*, int*)
+optional-function int posix_typed_mem_get_info (int, struct posix_typed_mem_info*)
+optional-function int posix_typed_mem_open (const char*, int, int)
+# endif
+
+type size_t
+type off_t
+
function int mlock (const void*, size_t)
function int mlockall (int)
function {void*} mmap (void*, size_t, int, int, int, off_t)
@@ -44,12 +50,6 @@ function int msync (void*, size_t, int)
function int munlock (const void*, size_t)
function int munlockall (void)
function int munmap (void*, size_t)
-#ifndef POSIX
-function int posix_madvise (void*, size_t, int)
-#endif
-optional-function int posix_mem_offset (const void*, size_t, off_t*, size_t*, int*)
-optional-function int posix_typed_mem_get_info (int, struct posix_typed_mem_info*)
-optional-function int posix_typed_mem_open (const char*, int, int)
function int shm_open (const char*, int, mode_t)
function int shm_unlink (const char*)
diff --git a/libc/conform/data/sys/stat.h-data b/libc/conform/data/sys/stat.h-data
index a7db93f57..2a5c3bf34 100644
--- a/libc/conform/data/sys/stat.h-data
+++ b/libc/conform/data/sys/stat.h-data
@@ -122,6 +122,8 @@ function int mkfifoat (int, const char*, mode_t)
# endif
# if !defined POSIX && !defined POSIX2008
function int mknod (const char*, mode_t, dev_t)
+# endif
+# ifdef XOPEN2K8
function int mknodat (int, const char*, mode_t, dev_t)
# endif
function int stat (const char*, struct stat*)
diff --git a/libc/conform/data/sys/types.h-data b/libc/conform/data/sys/types.h-data
index 824392d49..cda19548a 100644
--- a/libc/conform/data/sys/types.h-data
+++ b/libc/conform/data/sys/types.h-data
@@ -22,8 +22,9 @@ type mode_t
type nlink_t
type off_t
type pid_t
+#if !defined XPG3 && !defined XPG4
type pthread_attr_t
-#if !defined POSIX
+#if !defined POSIX && !defined UNIX98
type pthread_barrier_t
type pthread_barrierattr_t
#endif
@@ -36,9 +37,12 @@ type pthread_once_t
#if !defined POSIX
type pthread_rwlock_t
type pthread_rwlockattr_t
+#endif
+#if !defined POSIX && !defined UNIX98
type pthread_spinlock_t
#endif
type pthread_t
+#endif
type size_t
type ssize_t
# if !defined POSIX && !defined POSIX2008
diff --git a/libc/conform/data/tgmath.h-data b/libc/conform/data/tgmath.h-data
index ce4f301de..5f7250219 100644
--- a/libc/conform/data/tgmath.h-data
+++ b/libc/conform/data/tgmath.h-data
@@ -1,364 +1,7 @@
-#if defined XOPEN2K || defined POSIX2008
-// <math.h>
-macro fpclassify
-macro isfinite
-macro isinf
-macro isnan
-macro isnormal
-macro signbit
-macro isgreater
-macro isgreaterequal
-macro isless
-macro islessequal
-macro islessgreater
-macro isunordered
+#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
+#include "math.h-data"
+#include "complex.h-data"
-#ifndef POSIX2008
-constant M_E
-constant M_LOG2E
-constant M_LOG10E
-constant M_LN2
-constant M_LN10
-constant M_PI
-constant M_PI_2
-constant M_PI_4
-constant M_1_PI
-constant M_2_PI
-constant M_2_SQRTPI
-constant M_SQRT2
-constant M_SQRT1_2
-
-constant MAXFLOAT
-#endif
-constant HUGE_VAL
-constant HUGE_VALF
-constant HUGE_VALL
-constant INFINITY
-constant NAN
-
-macro FP_INFINITE
-macro FP_NAN
-macro FP_NORMAL
-macro FP_SUBNORMAL
-macro FP_ZERO
-
-optional-macro FP_FAST_FMA
-optional-macro FP_FAST_FMAF
-optional-macro FP_FAST_FMAL
-
-constant FP_ILOGB0
-constant FP_ILOGBNAN
-
-macro MATH_ERRNO == 1
-macro MATH_ERREXCEPT == 2
-
-macro math_errhandling
-
-function double acos (double)
-function double asin (double)
-function double atan (double)
-function double atan2 (double, double)
-function double ceil (double)
-function double copysign (double, double)
-function double cos (double)
-function double cosh (double)
-function double exp (double)
-function double exp2 (double)
-function double fabs (double)
-function double floor (double)
-function double fmod (double, double)
-function double frexp (double, int*)
-function double ldexp (double, int)
-function double log (double)
-function double log10 (double)
-function double log2 (double)
-function double modf (double, double*)
-function double pow (double, double)
-function double sin (double)
-function double sinh (double)
-function double sqrt (double)
-function double tan (double)
-function double tanh (double)
-function double erf (double)
-function double erfc (double)
-#if defined XPG3 || defined XPG4 || defined UNIX98
-function double gamma (double)
-#endif
-function double hypot (double, double)
-#if !defined POSIX && !defined POSIX2008
-function double j0 (double)
-function double j1 (double)
-function double jn (int, double)
-#endif
-function double lgamma (double)
-function double tgamma (double)
-#if !defined POSIX && !defined POSIX2008
-function double y0 (double)
-function double y1 (double)
-function double yn (int, double)
-#endif
-function double acosh (double)
-function double asinh (double)
-function double atanh (double)
-function double cbrt (double)
-function double expm1 (double)
-function int ilogb (double)
-function double log1p (double)
-function double logb (double)
-function double nextafter (double, double)
-function double nexttoward (double, long double)
-function double nearbyint (double)
-function double remainder (double, double)
-function double rint (double)
-function double round (double)
-function double trunc (double)
-function long lrint (double)
-function {long long} llrint (double)
-function long lround (double)
-function {long long} llround (double)
-function double remquo (double, double, int*)
-#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
-function double scalb (double, double)
-#endif
-function double scalbn (double, int)
-function double scalbln (double, long)
-function double fdim (double, double)
-function double fmax (double, double)
-function double fmin (double, double)
-function double fma (double, double, double)
-function double nan (const char*)
-
-// variable signgam
-allow signgam
-
-function float acosf (float)
-function float asinf (float)
-function float atanf (float)
-function float atan2f (float, float)
-function float ceilf (float)
-function float copysignf (float, float)
-function float cosf (float)
-function float coshf (float)
-function float expf (float)
-function float exp2f (float)
-function float fabsf (float)
-function float floorf (float)
-function float fmodf (float, float)
-function float frexpf (float, int*)
-function float ldexpf (float, int)
-function float logf (float)
-function float log10f (float)
-function float log2f (float)
-function float modff (float, float*)
-function float powf (float, float)
-function float sinf (float)
-function float sinhf (float)
-function float sqrtf (float)
-function float tanf (float)
-function float tanhf (float)
-function float erff (float)
-function float erfcf (float)
-#if defined XPG3 || defined XPG4 || defined UNIX98
-function float gammaf (float)
-#endif
-function float hypotf (float, float)
-#if !defined POSIX && !defined POSIX2008
-function float j0f (float)
-function float j1f (float)
-function float jnf (int, float)
-#endif
-function float lgammaf (float)
-function float tgammaf (float)
-#if !defined POSIX && !defined POSIX2008
-function float y0f (float)
-function float y1f (float)
-function float ynf (int, float)
-#endif
-function float acoshf (float)
-function float asinhf (float)
-function float atanhf (float)
-function float cbrtf (float)
-function float expm1f (float)
-function int ilogbf (float)
-function float log1pf (float)
-function float logbf (float)
-function float nextafterf (float, float)
-function float nexttowardf (float, long double)
-function float nearbyintf (float)
-function float remainderf (float, float)
-function float rintf (float)
-function float roundf (float)
-function float truncf (float)
-function long lrintf (float)
-function {long long} llrintf (float)
-function long lroundf (float)
-function {long long} llroundf (float)
-function float remquof (float, float, int*)
-#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
-function float scalbf (float, float)
-#endif
-function float scalbnf (float, int)
-function float scalblnf (float, long)
-function float fdimf (float, float)
-function float fmaxf (float, float)
-function float fminf (float, float)
-function float fmaf (float, float, float)
-function float nanf (const char*)
-
-function {long double} acosl (long double)
-function {long double} asinl (long double)
-function {long double} atanl (long double)
-function {long double} atan2l (long double, long double)
-function {long double} ceill (long double)
-function {long double} copysignl (long double, long double)
-function {long double} cosl (long double)
-function {long double} coshl (long double)
-function {long double} expl (long double)
-function {long double} exp2l (long double)
-function {long double} fabsl (long double)
-function {long double} floorl (long double)
-function {long double} fmodl (long double, long double)
-function {long double} frexpl (long double, int*)
-function {long double} ldexpl (long double, int)
-function {long double} logl (long double)
-function {long double} log10l (long double)
-function {long double} log2l (long double)
-function {long double} modfl (long double, long double*)
-function {long double} powl (long double, long double)
-function {long double} sinl (long double)
-function {long double} sinhl (long double)
-function {long double} sqrtl (long double)
-function {long double} tanl (long double)
-function {long double} tanhl (long double)
-function {long double} erfl (long double)
-function {long double} erfcl (long double)
-#if defined XPG3 || defined XPG4 || defined UNIX98
-function {long double} gammal (long double)
-#endif
-function {long double} hypotl (long double, long double)
-#if !defined POSIX && !defined POSIX2008
-function {long double} j0l (long double)
-function {long double} j1l (long double)
-function {long double} jnl (int, long double)
-#endif
-function {long double} lgammal (long double)
-function {long double} tgammal (long double)
-#if !defined POSIX && !defined POSIX2008
-function {long double} y0l (long double)
-function {long double} y1l (long double)
-function {long double} ynl (int, long double)
-#endif
-function {long double} acoshl (long double)
-function {long double} asinhl (long double)
-function {long double} atanhl (long double)
-function {long double} cbrtl (long double)
-function {long double} expm1l (long double)
-function int ilogbl (long double)
-function {long double} log1pl (long double)
-function {long double} logbl (long double)
-function {long double} nextafterl (long double, long double)
-function {long double} nexttowardl (long double, long double)
-function {long double} nearbyintl (long double)
-function {long double} remainderl (long double, long double)
-function {long double} rintl (long double)
-function {long double} roundl (long double)
-function {long double} truncl (long double)
-function long lrintl (long double)
-function {long long} llrintl (long double)
-function long lroundl (long double)
-function {long long} llroundl (long double)
-function {long double} remquol (long double, long double, int*)
-#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
-function {long double} scalbl (long double, long double)
-#endif
-function {long double} scalbnl (long double, int)
-function {long double} scalblnl (long double, long)
-function {long double} fdiml (long double, long double)
-function {long double} fmaxl (long double, long double)
-function {long double} fminl (long double, long double)
-function {long double} fmal (long double, long double, long double)
-function {long double} nanl (const char*)
-
-allow *_t
-allow FP_*
-
-// <complex.h>
-macro complex
-macro _Complex_I
-optional-macro imaginary
-optional-macro _Imaginary_I
-macro I
-
-function double cabs (double complex)
-function {double complex} cacos (double complex)
-function {double complex} cacosh (double complex)
-function double carg (double complex)
-function {double complex} casin (double complex)
-function {double complex} casinh (double complex)
-function {double complex} catan (double complex)
-function {double complex} catanh (double complex)
-function {double complex} ccos (double complex)
-function {double complex} ccosh (double complex)
-function {double complex} cexp (double complex)
-function double cimag (double complex)
-function {double complex} clog (double complex)
-function {double complex} conj (double complex)
-function {double complex} cpow (double complex, double complex)
-function {double complex} cproj (double complex)
-function double creal (double complex)
-function {double complex} csin (double complex)
-function {double complex} csinh (double complex)
-function {double complex} csqrt (double complex)
-function {double complex} ctan (double complex)
-function {double complex} ctanh (double complex)
-
-function float cabsf (float complex)
-function {float complex} cacosf (float complex)
-function {float complex} cacoshf (float complex)
-function float cargf (float complex)
-function {float complex} casinf (float complex)
-function {float complex} casinhf (float complex)
-function {float complex} catanf (float complex)
-function {float complex} catanhf (float complex)
-function {float complex} ccosf (float complex)
-function {float complex} ccoshf (float complex)
-function {float complex} cexpf (float complex)
-function float cimagf (float complex)
-function {float complex} clogf (float complex)
-function {float complex} conjf (float complex)
-function {float complex} cpowf (float complex, float complex)
-function {float complex} cprojf (float complex)
-function float crealf (float complex)
-function {float complex} csinf (float complex)
-function {float complex} csinhf (float complex)
-function {float complex} csqrtf (float complex)
-function {float complex} ctanf (float complex)
-function {float complex} ctanhf (float complex)
-
-function {long double} cabsl (long double complex)
-function {long double complex} cacosl (long double complex)
-function {long double complex} cacoshl (long double complex)
-function {long double} cargl (long double complex)
-function {long double complex} casinhl (long double complex)
-function {long double complex} casinl (long double complex)
-function {long double complex} catanhl (long double complex)
-function {long double complex} catanl (long double complex)
-function {long double complex} ccoshl (long double complex)
-function {long double complex} ccosl (long double complex)
-function {long double complex} cexpl (long double complex)
-function {long double} cimagl (long double complex)
-function {long double complex} clogl (long double complex)
-function {long double complex} conjl (long double complex)
-function {long double complex} cpowl (long double complex, long double complex)
-function {long double complex} cprojl (long double complex)
-function {long double} creall (long double complex)
-function {long double complex} csinhl (long double complex)
-function {long double complex} csinl (long double complex)
-function {long double complex} csqrtl (long double complex)
-function {long double complex} ctanhl (long double complex)
-function {long double complex} ctanl (long double complex)
-
-// <tgmath.h>
macro acos
macro asin
macro atan
diff --git a/libc/conform/data/time.h-data b/libc/conform/data/time.h-data
index 8ed2b4a68..31d5e7dd5 100644
--- a/libc/conform/data/time.h-data
+++ b/libc/conform/data/time.h-data
@@ -42,7 +42,7 @@ function int timespec_get (struct timespec *, int)
#endif
#if !defined ISO && !defined ISO99 && !defined ISO11
-# if !defined XOPEN21K && !defined XOPEN2K8 && !defined POSIX2008
+# if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
symbol CLK_TCK
# endif
constant CLOCK_PROCESS_CPUTIME_ID
diff --git a/libc/conform/data/uchar.h-data b/libc/conform/data/uchar.h-data
index 487d755fd..ef27617bc 100644
--- a/libc/conform/data/uchar.h-data
+++ b/libc/conform/data/uchar.h-data
@@ -5,7 +5,7 @@ type char16_t
type char32_t
function size_t mbrtoc16 (char16_t *, const char *, size_t, mbstate_t *)
-function size_t c16rtomb (char *, char16_t, mbstate_t *)16
+function size_t c16rtomb (char *, char16_t, mbstate_t *)
function size_t mbrtoc32 (char32_t *, const char *, size_t, mbstate_t *)
function size_t c32rtomb (char *, char32_t, mbstate_t *)
diff --git a/libc/conform/data/wchar.h-data b/libc/conform/data/wchar.h-data
index fdb68d03b..805cbe6e1 100644
--- a/libc/conform/data/wchar.h-data
+++ b/libc/conform/data/wchar.h-data
@@ -14,6 +14,7 @@ type size_t
# if defined XOPEN2K8 || defined POSIX2008
type locale_t
# endif
+tag {struct tm}
function wint_t btowc (int)
function int fwprintf (FILE*, const wchar_t*, ...)
@@ -104,9 +105,19 @@ function size_t wcsrtombs (char*, const wchar_t**, size_t, mbstate_t*)
function size_t wcsspn (const wchar_t*, const wchar_t*)
function {wchar_t*} wcsstr (const wchar_t*, const wchar_t*)
function double wcstod (const wchar_t*, wchar_t**)
+# ifndef UNIX98
+function float wcstof (const wchar_t*, wchar_t**)
+function {long double} wcstold (const wchar_t*, wchar_t**)
+# endif
function {wchar_t*} wcstok (wchar_t*, const wchar_t*, wchar_t**)
function {long int} wcstol (const wchar_t*, wchar_t**, int)
+# ifndef UNIX98
+function {long long int} wcstoll (const wchar_t*, wchar_t**, int)
+# endif
function {unsigned long int} wcstoul (const wchar_t*, wchar_t**, int)
+# ifndef UNIX98
+function {unsigned long long int} wcstoull (const wchar_t*, wchar_t**, int)
+# endif
# if defined UNIX98 || defined XOPEN2K
function {wchar_t*} wcswcs (const wchar_t*, const wchar_t*)
# endif
@@ -130,11 +141,12 @@ function {wchar_t*} wmemset (wchar_t*, wchar_t, size_t)
function int wprintf (const wchar_t*, ...)
function int wscanf (const wchar_t*, ...)
-macro WCHAR_MAX
-macro WCHAR_MIN
-macro WEOF
-macro NULL
+macro-int-constant WCHAR_MIN {promoted:wchar_t}
+macro-int-constant WCHAR_MAX {promoted:wchar_t} >= 127
+macro-constant WEOF {wint_t}
+macro-constant NULL == 0
+#if !defined ISO && !defined ISO99 && !defined ISO11
allow-header ctype.h
allow-header stdio.h
allow-header stdarg.h
@@ -142,7 +154,10 @@ allow-header stdlib.h
allow-header string.h
allow-header stddef.h
allow-header time.h
+#endif
-allow wcs*
+allow wcs[abcdefghijklmnopqrstuvwxyz]*
+#if !defined ISO && !defined ISO99 && !defined ISO11
allow *_t
#endif
+#endif
diff --git a/libc/conform/data/wctype.h-data b/libc/conform/data/wctype.h-data
index cbd1dac28..91638e61d 100644
--- a/libc/conform/data/wctype.h-data
+++ b/libc/conform/data/wctype.h-data
@@ -8,6 +8,9 @@ type locale_t
function int iswalnum (wint_t)
function int iswalpha (wint_t)
+# ifndef UNIX98
+function int iswblank (wint_t)
+# endif
function int iswcntrl (wint_t)
function int iswdigit (wint_t)
function int iswgraph (wint_t)
@@ -26,6 +29,7 @@ function wctype_t wctype (const char*)
# if defined XOPEN2K8 || defined POSIX2008
function int iswalnum_l (wint_t, locale_t)
function int iswalpha_l (wint_t, locale_t)
+function int iswblank_l (wint_t, locale_t)
function int iswcntrl_l (wint_t, locale_t)
function int iswdigit_l (wint_t, locale_t)
function int iswgraph_l (wint_t, locale_t)
@@ -43,8 +47,9 @@ function wctrans_t wctrans_l (const char*, locale_t)
function wctype_t wctype_l (const char*, locale_t)
# endif
-macro WEOF
+macro-constant WEOF {wint_t}
+#if !defined ISO && !defined ISO99 && !defined ISO11
allow-header ctype.h
allow-header stdio.h
allow-header stdarg.h
@@ -53,8 +58,11 @@ allow-header string.h
allow-header stddef.h
allow-header time.h
allow-header wchar.h
+#endif
-allow is*
-allow to*
+allow is[abcdefghijklmnopqrstuvwxyz]*
+allow to[abcdefghijklmnopqrstuvwxyz]*
+#if !defined ISO && !defined ISO99 && !defined ISO11
allow *_t
#endif
+#endif