@test "$(ARCH)" || { echo "Please set ARCH in config.mak before running make." ; exit 1 ; }
ln -sf ../arch/$(ARCH)/bits $@
-include/bits/alltypes.h.sh: include/bits
+include/bits/alltypes.h.in: include/bits
-include/bits/alltypes.h: include/bits/alltypes.h.sh
- sh $< > $@
+include/bits/alltypes.h: include/bits/alltypes.h.in include/alltypes.h.in tools/mkalltypes.sed
+ sed -f tools/mkalltypes.sed include/bits/alltypes.h.in include/alltypes.h.in > $@
src/ldso/dynlink.lo: arch/$(ARCH)/reloc.h
--- /dev/null
+#define _Addr int
+#define _Int64 long long
+
+TYPEDEF __builtin_va_list va_list;
+TYPEDEF __builtin_va_list __isoc_va_list;
+
+#ifndef __cplusplus
+TYPEDEF unsigned wchar_t;
+#endif
+TYPEDEF int wint_t;
+
+TYPEDEF float float_t;
+TYPEDEF double double_t;
+
+TYPEDEF long time_t;
+TYPEDEF long suseconds_t;
+
+TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t;
+TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
+TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
+TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
+TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
+++ /dev/null
-#!/bin/sh
-sed -e << EOF \
-'/^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2)\
-typedef \1 \2;\
-#define __DEFINED_\2\
-#endif\
-/
-/^STRUCT/s/STRUCT * \([^ ]*\) \(.*\);$/#if defined(__NEED_struct_\1) \&\& !defined(__DEFINED_struct_\1)\
-struct \1 \2;\
-#define __DEFINED_struct_\1\
-#endif\
-/
-/^UNION/s/UNION * \([^ ]*\) \(.*\);$/#if defined(__NEED_union_\1) \&\& !defined(__DEFINED_union_\1)\
-union \1 \2;\
-#define __DEFINED_union_\1\
-#endif\
-/'
-
-TYPEDEF unsigned size_t;
-TYPEDEF int ssize_t;
-TYPEDEF int ptrdiff_t;
-
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
-
-#ifndef __cplusplus
-TYPEDEF unsigned wchar_t;
-#endif
-TYPEDEF int wint_t;
-TYPEDEF const int * wctrans_t;
-TYPEDEF unsigned long wctype_t;
-
-TYPEDEF signed char int8_t;
-TYPEDEF short int16_t;
-TYPEDEF int int32_t;
-TYPEDEF long long int64_t;
-
-TYPEDEF unsigned char uint8_t;
-TYPEDEF unsigned short uint16_t;
-TYPEDEF unsigned int uint32_t;
-TYPEDEF unsigned long long uint64_t;
-
-TYPEDEF unsigned short __uint16_t;
-TYPEDEF unsigned int __uint32_t;
-TYPEDEF unsigned long long __uint64_t;
-
-TYPEDEF int8_t int_fast8_t;
-TYPEDEF int int_fast16_t;
-TYPEDEF int int_fast32_t;
-TYPEDEF int64_t int_fast64_t;
-
-TYPEDEF unsigned char uint_fast8_t;
-TYPEDEF unsigned int uint_fast16_t;
-TYPEDEF unsigned int uint_fast32_t;
-TYPEDEF uint64_t uint_fast64_t;
-
-TYPEDEF long intptr_t;
-TYPEDEF unsigned long uintptr_t;
-
-TYPEDEF long long intmax_t;
-TYPEDEF unsigned long long uintmax_t;
-
-TYPEDEF float float_t;
-TYPEDEF double double_t;
-
-TYPEDEF long time_t;
-TYPEDEF int suseconds_t;
-TYPEDEF unsigned useconds_t;
-STRUCT timeval { time_t tv_sec; int tv_usec; };
-STRUCT timespec { time_t tv_sec; long tv_nsec; };
-
-TYPEDEF int pid_t;
-TYPEDEF unsigned id_t;
-TYPEDEF unsigned uid_t;
-TYPEDEF unsigned gid_t;
-TYPEDEF int key_t;
-
-TYPEDEF struct __pthread * pthread_t;
-TYPEDEF int pthread_once_t;
-TYPEDEF int pthread_key_t;
-TYPEDEF int pthread_spinlock_t;
-
-TYPEDEF struct { union { int __i[9]; size_t __s[9]; } __u; } pthread_attr_t;
-TYPEDEF unsigned pthread_mutexattr_t;
-TYPEDEF unsigned pthread_condattr_t;
-TYPEDEF unsigned pthread_barrierattr_t;
-TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
-
-TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
-
-TYPEDEF long long off_t;
-
-TYPEDEF unsigned int mode_t;
-
-TYPEDEF unsigned int nlink_t;
-TYPEDEF unsigned long long ino_t;
-TYPEDEF long long dev_t;
-TYPEDEF long blksize_t;
-TYPEDEF long long blkcnt_t;
-TYPEDEF unsigned long long fsblkcnt_t;
-TYPEDEF unsigned long long fsfilcnt_t;
-
-TYPEDEF void * timer_t;
-TYPEDEF int clockid_t;
-TYPEDEF long clock_t;
-
-TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
-TYPEDEF struct __siginfo siginfo_t;
-
-TYPEDEF unsigned int socklen_t;
-TYPEDEF unsigned short sa_family_t;
-TYPEDEF unsigned short in_port_t;
-TYPEDEF unsigned int in_addr_t;
-STRUCT in_addr { in_addr_t s_addr; };
-
-TYPEDEF struct __FILE_s FILE;
-
-TYPEDEF int nl_item;
-
-TYPEDEF struct __locale * locale_t;
-
-STRUCT iovec { void *iov_base; size_t iov_len; };
-
-EOF
-#define INT_FAST8_MIN INT8_MIN
+typedef int32_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef uint32_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST64_MIN INT64_MIN
-#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MAX INT64_MAX
-#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
#define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX
--- /dev/null
+#define _Addr int
+#define _Int64 long long
+
+#if __GNUC__ >= 3
+TYPEDEF __builtin_va_list va_list;
+TYPEDEF __builtin_va_list __isoc_va_list;
+#else
+TYPEDEF struct __va_list * va_list;
+TYPEDEF struct __va_list * __isoc_va_list;
+#endif
+
+#ifndef __cplusplus
+#ifdef __WCHAR_TYPE__
+TYPEDEF __WCHAR_TYPE__ wchar_t;
+#else
+TYPEDEF long wchar_t;
+#endif
+#endif
+TYPEDEF long wint_t;
+
+#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 0
+TYPEDEF float float_t;
+TYPEDEF double double_t;
+#else
+TYPEDEF long double float_t;
+TYPEDEF long double double_t;
+#endif
+
+TYPEDEF long time_t;
+TYPEDEF long suseconds_t;
+
+TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t;
+TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
+TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
+TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
+TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
+++ /dev/null
-#!/bin/sh
-sed -e << EOF \
-'/^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2)\
-typedef \1 \2;\
-#define __DEFINED_\2\
-#endif\
-/
-/^STRUCT/s/STRUCT * \([^ ]*\) \(.*\);$/#if defined(__NEED_struct_\1) \&\& !defined(__DEFINED_struct_\1)\
-struct \1 \2;\
-#define __DEFINED_struct_\1\
-#endif\
-/
-/^UNION/s/UNION * \([^ ]*\) \(.*\);$/#if defined(__NEED_union_\1) \&\& !defined(__DEFINED_union_\1)\
-union \1 \2;\
-#define __DEFINED_union_\1\
-#endif\
-/'
-
-TYPEDEF unsigned size_t;
-TYPEDEF int ssize_t;
-TYPEDEF int ptrdiff_t;
-
-#if __GNUC__ >= 3
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
-#else
-TYPEDEF struct __va_list * va_list;
-TYPEDEF struct __va_list * __isoc_va_list;
-#endif
-
-#ifndef __cplusplus
-#ifdef __WCHAR_TYPE__
-TYPEDEF __WCHAR_TYPE__ wchar_t;
-#else
-TYPEDEF long wchar_t;
-#endif
-#endif
-TYPEDEF long wint_t;
-TYPEDEF const int * wctrans_t;
-TYPEDEF unsigned long wctype_t;
-
-TYPEDEF signed char int8_t;
-TYPEDEF short int16_t;
-TYPEDEF int int32_t;
-TYPEDEF long long int64_t;
-
-TYPEDEF unsigned char uint8_t;
-TYPEDEF unsigned short uint16_t;
-TYPEDEF unsigned int uint32_t;
-TYPEDEF unsigned long long uint64_t;
-
-TYPEDEF unsigned short __uint16_t;
-TYPEDEF unsigned int __uint32_t;
-TYPEDEF unsigned long long __uint64_t;
-
-TYPEDEF int8_t int_fast8_t;
-TYPEDEF int int_fast16_t;
-TYPEDEF int int_fast32_t;
-TYPEDEF int64_t int_fast64_t;
-
-TYPEDEF unsigned char uint_fast8_t;
-TYPEDEF unsigned int uint_fast16_t;
-TYPEDEF unsigned int uint_fast32_t;
-TYPEDEF uint64_t uint_fast64_t;
-
-TYPEDEF long intptr_t;
-TYPEDEF unsigned long uintptr_t;
-
-TYPEDEF long long intmax_t;
-TYPEDEF unsigned long long uintmax_t;
-
-#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 0
-TYPEDEF float float_t;
-TYPEDEF double double_t;
-#else
-TYPEDEF long double float_t;
-TYPEDEF long double double_t;
-#endif
-
-TYPEDEF long time_t;
-TYPEDEF int suseconds_t;
-TYPEDEF unsigned useconds_t;
-STRUCT timeval { time_t tv_sec; int tv_usec; };
-STRUCT timespec { time_t tv_sec; long tv_nsec; };
-
-TYPEDEF int pid_t;
-TYPEDEF unsigned id_t;
-TYPEDEF unsigned uid_t;
-TYPEDEF unsigned gid_t;
-TYPEDEF int key_t;
-
-TYPEDEF struct __pthread * pthread_t;
-TYPEDEF int pthread_once_t;
-TYPEDEF int pthread_key_t;
-TYPEDEF int pthread_spinlock_t;
-
-TYPEDEF struct { union { int __i[9]; size_t __s[9]; } __u; } pthread_attr_t;
-TYPEDEF unsigned pthread_mutexattr_t;
-TYPEDEF unsigned pthread_condattr_t;
-TYPEDEF unsigned pthread_barrierattr_t;
-TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
-
-TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
-
-TYPEDEF long long off_t;
-
-TYPEDEF unsigned int mode_t;
-
-TYPEDEF unsigned int nlink_t;
-TYPEDEF unsigned long long ino_t;
-TYPEDEF long long dev_t;
-TYPEDEF long blksize_t;
-TYPEDEF long long blkcnt_t;
-TYPEDEF unsigned long long fsblkcnt_t;
-TYPEDEF unsigned long long fsfilcnt_t;
-
-TYPEDEF void * timer_t;
-TYPEDEF int clockid_t;
-TYPEDEF long clock_t;
-
-TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
-TYPEDEF struct __siginfo siginfo_t;
-
-TYPEDEF unsigned int socklen_t;
-TYPEDEF unsigned short sa_family_t;
-TYPEDEF unsigned short in_port_t;
-TYPEDEF unsigned int in_addr_t;
-STRUCT in_addr { in_addr_t s_addr; };
-
-TYPEDEF struct __FILE_s FILE;
-
-TYPEDEF int nl_item;
-
-TYPEDEF struct __locale * locale_t;
-
-STRUCT iovec { void *iov_base; size_t iov_len; };
-
-EOF
-#define INT_FAST8_MIN INT8_MIN
+typedef int32_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef uint32_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST64_MIN INT64_MIN
-#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MAX INT64_MAX
-#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
#define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX
#define UINTPTR_MAX UINT32_MAX
#define PTRDIFF_MIN INT32_MIN
#define PTRDIFF_MAX INT32_MAX
-#define SIG_ATOMIC_MIN INT32_MIN
-#define SIG_ATOMIC_MAX INT32_MAX
#define SIZE_MAX UINT32_MAX
--- /dev/null
+#define _Addr int
+#define _Int64 long long
+
+TYPEDEF __builtin_va_list va_list;
+TYPEDEF __builtin_va_list __isoc_va_list;
+
+#ifndef __cplusplus
+TYPEDEF int wchar_t;
+#endif
+TYPEDEF int wint_t;
+
+TYPEDEF float float_t;
+TYPEDEF double double_t;
+
+TYPEDEF long time_t;
+TYPEDEF long suseconds_t;
+
+TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t;
+TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
+TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
+TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
+TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
+++ /dev/null
-#!/bin/sh
-sed -e << EOF \
-'/^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2)\
-typedef \1 \2;\
-#define __DEFINED_\2\
-#endif\
-/
-/^STRUCT/s/STRUCT * \([^ ]*\) \(.*\);$/#if defined(__NEED_struct_\1) \&\& !defined(__DEFINED_struct_\1)\
-struct \1 \2;\
-#define __DEFINED_struct_\1\
-#endif\
-/
-/^UNION/s/UNION * \([^ ]*\) \(.*\);$/#if defined(__NEED_union_\1) \&\& !defined(__DEFINED_union_\1)\
-union \1 \2;\
-#define __DEFINED_union_\1\
-#endif\
-/'
-
-TYPEDEF unsigned size_t;
-TYPEDEF int ssize_t;
-TYPEDEF int ptrdiff_t;
-
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
-
-#ifndef __cplusplus
-TYPEDEF int wchar_t;
-#endif
-TYPEDEF int wint_t;
-TYPEDEF const int * wctrans_t;
-TYPEDEF unsigned long wctype_t;
-
-TYPEDEF signed char int8_t;
-TYPEDEF short int16_t;
-TYPEDEF int int32_t;
-TYPEDEF long long int64_t;
-
-TYPEDEF unsigned char uint8_t;
-TYPEDEF unsigned short uint16_t;
-TYPEDEF unsigned int uint32_t;
-TYPEDEF unsigned long long uint64_t;
-
-TYPEDEF unsigned short __uint16_t;
-TYPEDEF unsigned int __uint32_t;
-TYPEDEF unsigned long long __uint64_t;
-
-TYPEDEF int8_t int_fast8_t;
-TYPEDEF int int_fast16_t;
-TYPEDEF int int_fast32_t;
-TYPEDEF int64_t int_fast64_t;
-
-TYPEDEF unsigned char uint_fast8_t;
-TYPEDEF unsigned int uint_fast16_t;
-TYPEDEF unsigned int uint_fast32_t;
-TYPEDEF uint64_t uint_fast64_t;
-
-TYPEDEF long intptr_t;
-TYPEDEF unsigned long uintptr_t;
-
-TYPEDEF long long intmax_t;
-TYPEDEF unsigned long long uintmax_t;
-
-TYPEDEF float float_t;
-TYPEDEF double double_t;
-
-TYPEDEF long time_t;
-TYPEDEF int suseconds_t;
-TYPEDEF unsigned useconds_t;
-STRUCT timeval { time_t tv_sec; int tv_usec; };
-STRUCT timespec { time_t tv_sec; long tv_nsec; };
-
-TYPEDEF int pid_t;
-TYPEDEF unsigned id_t;
-TYPEDEF unsigned uid_t;
-TYPEDEF unsigned gid_t;
-TYPEDEF int key_t;
-
-TYPEDEF struct __pthread * pthread_t;
-TYPEDEF int pthread_once_t;
-TYPEDEF int pthread_key_t;
-TYPEDEF int pthread_spinlock_t;
-
-TYPEDEF struct { union { int __i[9]; size_t __s[9]; } __u; } pthread_attr_t;
-TYPEDEF unsigned pthread_mutexattr_t;
-TYPEDEF unsigned pthread_condattr_t;
-TYPEDEF unsigned pthread_barrierattr_t;
-TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
-
-TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
-
-TYPEDEF long long off_t;
-
-TYPEDEF unsigned int mode_t;
-
-TYPEDEF unsigned int nlink_t;
-TYPEDEF unsigned long long ino_t;
-TYPEDEF long long dev_t;
-TYPEDEF long blksize_t;
-TYPEDEF long long blkcnt_t;
-TYPEDEF unsigned long long fsblkcnt_t;
-TYPEDEF unsigned long long fsfilcnt_t;
-
-TYPEDEF void * timer_t;
-TYPEDEF int clockid_t;
-TYPEDEF long clock_t;
-
-TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
-TYPEDEF struct __siginfo siginfo_t;
-
-TYPEDEF unsigned int socklen_t;
-TYPEDEF unsigned short sa_family_t;
-TYPEDEF unsigned short in_port_t;
-TYPEDEF unsigned int in_addr_t;
-STRUCT in_addr { in_addr_t s_addr; };
-
-TYPEDEF struct __FILE_s FILE;
-
-TYPEDEF int nl_item;
-
-TYPEDEF struct __locale * locale_t;
-
-STRUCT iovec { void *iov_base; size_t iov_len; };
-
-EOF
-#define INT_FAST8_MIN INT8_MIN
+typedef int32_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef uint32_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST64_MIN INT64_MIN
-#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MAX INT64_MAX
-#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
#define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX
--- /dev/null
+#define _Addr int
+#define _Int64 long long
+
+TYPEDEF __builtin_va_list va_list;
+TYPEDEF __builtin_va_list __isoc_va_list;
+
+#ifndef __cplusplus
+TYPEDEF int wchar_t;
+#endif
+TYPEDEF int wint_t;
+
+TYPEDEF float float_t;
+TYPEDEF double double_t;
+
+TYPEDEF long time_t;
+TYPEDEF long suseconds_t;
+
+TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t;
+TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
+TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
+TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
+TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
+++ /dev/null
-#!/bin/sh
-sed -e << EOF \
-'/^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2)\
-typedef \1 \2;\
-#define __DEFINED_\2\
-#endif\
-/
-/^STRUCT/s/STRUCT * \([^ ]*\) \(.*\);$/#if defined(__NEED_struct_\1) \&\& !defined(__DEFINED_struct_\1)\
-struct \1 \2;\
-#define __DEFINED_struct_\1\
-#endif\
-/
-/^UNION/s/UNION * \([^ ]*\) \(.*\);$/#if defined(__NEED_union_\1) \&\& !defined(__DEFINED_union_\1)\
-union \1 \2;\
-#define __DEFINED_union_\1\
-#endif\
-/'
-
-TYPEDEF unsigned size_t;
-TYPEDEF int ssize_t;
-TYPEDEF int ptrdiff_t;
-
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
-
-#ifndef __cplusplus
-TYPEDEF int wchar_t;
-#endif
-TYPEDEF int wint_t;
-TYPEDEF const int * wctrans_t;
-TYPEDEF unsigned long wctype_t;
-
-TYPEDEF signed char int8_t;
-TYPEDEF short int16_t;
-TYPEDEF int int32_t;
-TYPEDEF long long int64_t;
-
-TYPEDEF unsigned char uint8_t;
-TYPEDEF unsigned short uint16_t;
-TYPEDEF unsigned int uint32_t;
-TYPEDEF unsigned long long uint64_t;
-
-TYPEDEF unsigned short __uint16_t;
-TYPEDEF unsigned int __uint32_t;
-TYPEDEF unsigned long long __uint64_t;
-
-TYPEDEF int8_t int_fast8_t;
-TYPEDEF int int_fast16_t;
-TYPEDEF int int_fast32_t;
-TYPEDEF int64_t int_fast64_t;
-
-TYPEDEF unsigned char uint_fast8_t;
-TYPEDEF unsigned int uint_fast16_t;
-TYPEDEF unsigned int uint_fast32_t;
-TYPEDEF uint64_t uint_fast64_t;
-
-TYPEDEF long intptr_t;
-TYPEDEF unsigned long uintptr_t;
-
-TYPEDEF long long intmax_t;
-TYPEDEF unsigned long long uintmax_t;
-
-TYPEDEF float float_t;
-TYPEDEF double double_t;
-
-TYPEDEF long time_t;
-TYPEDEF int suseconds_t;
-TYPEDEF unsigned useconds_t;
-STRUCT timeval { time_t tv_sec; int tv_usec; };
-STRUCT timespec { time_t tv_sec; long tv_nsec; };
-
-TYPEDEF int pid_t;
-TYPEDEF unsigned id_t;
-TYPEDEF unsigned uid_t;
-TYPEDEF unsigned gid_t;
-TYPEDEF int key_t;
-
-TYPEDEF struct __pthread * pthread_t;
-TYPEDEF int pthread_once_t;
-TYPEDEF int pthread_key_t;
-TYPEDEF int pthread_spinlock_t;
-
-TYPEDEF struct { union { int __i[9]; size_t __s[9]; } __u; } pthread_attr_t;
-TYPEDEF unsigned pthread_mutexattr_t;
-TYPEDEF unsigned pthread_condattr_t;
-TYPEDEF unsigned pthread_barrierattr_t;
-TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
-
-TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
-
-TYPEDEF long long off_t;
-
-TYPEDEF unsigned int mode_t;
-
-TYPEDEF unsigned int nlink_t;
-TYPEDEF unsigned long long ino_t;
-TYPEDEF long long dev_t;
-TYPEDEF long blksize_t;
-TYPEDEF long long blkcnt_t;
-TYPEDEF unsigned long long fsblkcnt_t;
-TYPEDEF unsigned long long fsfilcnt_t;
-
-TYPEDEF void * timer_t;
-TYPEDEF int clockid_t;
-TYPEDEF long clock_t;
-
-TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
-TYPEDEF struct __siginfo siginfo_t;
-
-TYPEDEF unsigned int socklen_t;
-TYPEDEF unsigned short sa_family_t;
-TYPEDEF unsigned short in_port_t;
-TYPEDEF unsigned int in_addr_t;
-STRUCT in_addr { in_addr_t s_addr; };
-
-TYPEDEF struct __FILE_s FILE;
-
-TYPEDEF int nl_item;
-
-TYPEDEF struct __locale * locale_t;
-
-STRUCT iovec { void *iov_base; size_t iov_len; };
-
-EOF
-#define INT_FAST8_MIN INT8_MIN
+typedef int32_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef uint32_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST64_MIN INT64_MIN
-#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MAX INT64_MAX
-#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
#define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX
--- /dev/null
+#define _Addr int
+#define _Int64 long long
+
+TYPEDEF __builtin_va_list va_list;
+TYPEDEF __builtin_va_list __isoc_va_list;
+
+#ifndef __cplusplus
+TYPEDEF long wchar_t;
+#endif
+TYPEDEF int wint_t;
+
+TYPEDEF float float_t;
+TYPEDEF double double_t;
+
+TYPEDEF long time_t;
+TYPEDEF long suseconds_t;
+
+TYPEDEF struct { union { int __i[9]; unsigned __s[9]; } __u; } pthread_attr_t;
+TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
+TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
+TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
+TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
+++ /dev/null
-#!/bin/sh
-sed -e << EOF \
-'/^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2)\
-typedef \1 \2;\
-#define __DEFINED_\2\
-#endif\
-/
-/^STRUCT/s/STRUCT * \([^ ]*\) \(.*\);$/#if defined(__NEED_struct_\1) \&\& !defined(__DEFINED_struct_\1)\
-struct \1 \2;\
-#define __DEFINED_struct_\1\
-#endif\
-/
-/^UNION/s/UNION * \([^ ]*\) \(.*\);$/#if defined(__NEED_union_\1) \&\& !defined(__DEFINED_union_\1)\
-union \1 \2;\
-#define __DEFINED_union_\1\
-#endif\
-/'
-
-TYPEDEF unsigned size_t;
-TYPEDEF int ssize_t;
-TYPEDEF int ptrdiff_t;
-
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
-
-#ifndef __cplusplus
-TYPEDEF long wchar_t;
-#endif
-TYPEDEF int wint_t;
-TYPEDEF const int * wctrans_t;
-TYPEDEF unsigned long wctype_t;
-
-TYPEDEF signed char int8_t;
-TYPEDEF short int16_t;
-TYPEDEF int int32_t;
-TYPEDEF long long int64_t;
-
-TYPEDEF unsigned char uint8_t;
-TYPEDEF unsigned short uint16_t;
-TYPEDEF unsigned int uint32_t;
-TYPEDEF unsigned long long uint64_t;
-
-TYPEDEF unsigned short __uint16_t;
-TYPEDEF unsigned int __uint32_t;
-TYPEDEF unsigned long long __uint64_t;
-
-TYPEDEF int8_t int_fast8_t;
-TYPEDEF int int_fast16_t;
-TYPEDEF int int_fast32_t;
-TYPEDEF int64_t int_fast64_t;
-
-TYPEDEF unsigned char uint_fast8_t;
-TYPEDEF unsigned int uint_fast16_t;
-TYPEDEF unsigned int uint_fast32_t;
-TYPEDEF uint64_t uint_fast64_t;
-
-TYPEDEF int intptr_t;
-TYPEDEF unsigned uintptr_t;
-
-TYPEDEF long long intmax_t;
-TYPEDEF unsigned long long uintmax_t;
-
-TYPEDEF float float_t;
-TYPEDEF double double_t;
-
-TYPEDEF long time_t;
-TYPEDEF int suseconds_t;
-TYPEDEF unsigned useconds_t;
-STRUCT timeval { time_t tv_sec; int tv_usec; };
-STRUCT timespec { time_t tv_sec; long tv_nsec; };
-
-TYPEDEF int pid_t;
-TYPEDEF unsigned id_t;
-TYPEDEF unsigned uid_t;
-TYPEDEF unsigned gid_t;
-TYPEDEF int key_t;
-
-TYPEDEF struct __pthread * pthread_t;
-TYPEDEF int pthread_once_t;
-TYPEDEF int pthread_key_t;
-TYPEDEF int pthread_spinlock_t;
-
-TYPEDEF struct { union { int __i[9]; size_t __s[9]; } __u; } pthread_attr_t;
-TYPEDEF unsigned pthread_mutexattr_t;
-TYPEDEF unsigned pthread_condattr_t;
-TYPEDEF unsigned pthread_barrierattr_t;
-TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
-
-TYPEDEF struct { union { int __i[6]; void *__p[6]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[12]; void *__p[12]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[8]; void *__p[8]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[5]; void *__p[5]; } __u; } pthread_barrier_t;
-
-TYPEDEF long long off_t;
-
-TYPEDEF unsigned int mode_t;
-
-TYPEDEF unsigned int nlink_t;
-TYPEDEF unsigned long long ino_t;
-TYPEDEF unsigned long long dev_t;
-TYPEDEF unsigned long blksize_t;
-TYPEDEF unsigned long long blkcnt_t;
-TYPEDEF unsigned long long fsblkcnt_t;
-TYPEDEF unsigned long long fsfilcnt_t;
-
-TYPEDEF void * timer_t;
-TYPEDEF int clockid_t;
-TYPEDEF long clock_t;
-
-TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
-TYPEDEF struct __siginfo siginfo_t;
-
-TYPEDEF unsigned int socklen_t;
-TYPEDEF unsigned short sa_family_t;
-TYPEDEF unsigned short in_port_t;
-TYPEDEF unsigned int in_addr_t;
-STRUCT in_addr { in_addr_t s_addr; };
-
-TYPEDEF struct __FILE_s FILE;
-
-TYPEDEF int nl_item;
-
-TYPEDEF struct __locale * locale_t;
-
-STRUCT iovec { void *iov_base; size_t iov_len; };
-
-EOF
-#define INT_FAST8_MIN INT8_MIN
+typedef int32_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef uint32_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST64_MIN INT64_MIN
-#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MAX INT64_MAX
-#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
#define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX
--- /dev/null
+#define _Addr long
+#define _Int64 long
+
+TYPEDEF __builtin_va_list va_list;
+TYPEDEF __builtin_va_list __isoc_va_list;
+
+#ifndef __cplusplus
+TYPEDEF int wchar_t;
+#endif
+TYPEDEF int wint_t;
+
+#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2
+TYPEDEF long double float_t;
+TYPEDEF long double double_t;
+#else
+TYPEDEF float float_t;
+TYPEDEF double double_t;
+#endif
+
+TYPEDEF long time_t;
+TYPEDEF long suseconds_t;
+
+TYPEDEF struct { union { int __i[14]; unsigned long __s[7]; } __u; } pthread_attr_t;
+TYPEDEF struct { union { int __i[10]; void *__p[5]; } __u; } pthread_mutex_t;
+TYPEDEF struct { union { int __i[12]; void *__p[6]; } __u; } pthread_cond_t;
+TYPEDEF struct { union { int __i[14]; void *__p[7]; } __u; } pthread_rwlock_t;
+TYPEDEF struct { union { int __i[8]; void *__p[4]; } __u; } pthread_barrier_t;
+++ /dev/null
-#!/bin/sh
-sed -e << EOF \
-'/^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2)\
-typedef \1 \2;\
-#define __DEFINED_\2\
-#endif\
-/
-/^STRUCT/s/STRUCT * \([^ ]*\) \(.*\);$/#if defined(__NEED_struct_\1) \&\& !defined(__DEFINED_struct_\1)\
-struct \1 \2;\
-#define __DEFINED_struct_\1\
-#endif\
-/
-/^UNION/s/UNION * \([^ ]*\) \(.*\);$/#if defined(__NEED_union_\1) \&\& !defined(__DEFINED_union_\1)\
-union \1 \2;\
-#define __DEFINED_union_\1\
-#endif\
-/'
-
-TYPEDEF unsigned long size_t;
-TYPEDEF long ssize_t;
-TYPEDEF long ptrdiff_t;
-
-TYPEDEF __builtin_va_list va_list;
-TYPEDEF __builtin_va_list __isoc_va_list;
-
-#ifndef __cplusplus
-TYPEDEF int wchar_t;
-#endif
-TYPEDEF int wint_t;
-TYPEDEF const int * wctrans_t;
-TYPEDEF unsigned long wctype_t;
-
-TYPEDEF signed char int8_t;
-TYPEDEF short int16_t;
-TYPEDEF int int32_t;
-TYPEDEF long int64_t;
-
-TYPEDEF unsigned char uint8_t;
-TYPEDEF unsigned short uint16_t;
-TYPEDEF unsigned int uint32_t;
-TYPEDEF unsigned long uint64_t;
-
-TYPEDEF unsigned short __uint16_t;
-TYPEDEF unsigned int __uint32_t;
-TYPEDEF unsigned long __uint64_t;
-
-TYPEDEF int8_t int_fast8_t;
-TYPEDEF int int_fast16_t;
-TYPEDEF int int_fast32_t;
-TYPEDEF int64_t int_fast64_t;
-
-TYPEDEF unsigned char uint_fast8_t;
-TYPEDEF unsigned int uint_fast16_t;
-TYPEDEF unsigned int uint_fast32_t;
-TYPEDEF uint64_t uint_fast64_t;
-
-TYPEDEF long intptr_t;
-TYPEDEF unsigned long uintptr_t;
-
-TYPEDEF long intmax_t;
-TYPEDEF unsigned long uintmax_t;
-
-TYPEDEF float float_t;
-TYPEDEF double double_t;
-
-TYPEDEF long time_t;
-TYPEDEF long suseconds_t;
-TYPEDEF unsigned useconds_t;
-STRUCT timeval { time_t tv_sec; long tv_usec; };
-STRUCT timespec { time_t tv_sec; long tv_nsec; };
-
-TYPEDEF int pid_t;
-TYPEDEF unsigned id_t;
-TYPEDEF unsigned uid_t;
-TYPEDEF unsigned gid_t;
-TYPEDEF int key_t;
-
-TYPEDEF struct __pthread * pthread_t;
-TYPEDEF int pthread_once_t;
-TYPEDEF int pthread_key_t;
-TYPEDEF int pthread_spinlock_t;
-
-TYPEDEF struct { union { int __i[14]; size_t __s[7]; } __u; } pthread_attr_t;
-TYPEDEF unsigned pthread_mutexattr_t;
-TYPEDEF unsigned pthread_condattr_t;
-TYPEDEF unsigned pthread_barrierattr_t;
-TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
-
-TYPEDEF struct { union { int __i[10]; void *__p[5]; } __u; } pthread_mutex_t;
-TYPEDEF struct { union { int __i[12]; void *__p[6]; } __u; } pthread_cond_t;
-TYPEDEF struct { union { int __i[14]; void *__p[7]; } __u; } pthread_rwlock_t;
-TYPEDEF struct { union { int __i[8]; void *__p[4]; } __u; } pthread_barrier_t;
-
-TYPEDEF long off_t;
-
-TYPEDEF unsigned int mode_t;
-
-TYPEDEF unsigned long nlink_t;
-TYPEDEF unsigned long ino_t;
-TYPEDEF unsigned long dev_t;
-TYPEDEF long blksize_t;
-TYPEDEF long blkcnt_t;
-TYPEDEF unsigned long fsblkcnt_t;
-TYPEDEF unsigned long fsfilcnt_t;
-
-TYPEDEF void * timer_t;
-TYPEDEF int clockid_t;
-TYPEDEF long clock_t;
-
-TYPEDEF struct { unsigned long __bits[128/sizeof(long)]; } sigset_t;
-TYPEDEF struct __siginfo siginfo_t;
-
-TYPEDEF unsigned int socklen_t;
-TYPEDEF unsigned short sa_family_t;
-TYPEDEF unsigned short in_port_t;
-TYPEDEF unsigned int in_addr_t;
-STRUCT in_addr { in_addr_t s_addr; };
-
-TYPEDEF struct __FILE_s FILE;
-
-TYPEDEF int nl_item;
-
-TYPEDEF struct __locale * locale_t;
-
-STRUCT iovec { void *iov_base; size_t iov_len; };
-
-EOF
-#define INT_FAST8_MIN INT8_MIN
+typedef int32_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef uint32_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST64_MIN INT64_MIN
-#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MAX INT64_MAX
-#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
--- /dev/null
+TYPEDEF unsigned _Addr size_t;
+TYPEDEF unsigned _Addr uintptr_t;
+TYPEDEF _Addr ptrdiff_t;
+TYPEDEF _Addr ssize_t;
+TYPEDEF _Addr intptr_t;
+
+TYPEDEF signed char int8_t;
+TYPEDEF short int16_t;
+TYPEDEF int int32_t;
+TYPEDEF _Int64 int64_t;
+TYPEDEF _Int64 intmax_t;
+TYPEDEF unsigned char uint8_t;
+TYPEDEF unsigned short uint16_t;
+TYPEDEF unsigned int uint32_t;
+TYPEDEF unsigned _Int64 uint64_t;
+TYPEDEF unsigned _Int64 uintmax_t;
+
+TYPEDEF unsigned mode_t;
+TYPEDEF unsigned nlink_t;
+TYPEDEF _Int64 off_t;
+TYPEDEF unsigned _Int64 ino_t;
+TYPEDEF unsigned _Int64 dev_t;
+TYPEDEF long blksize_t;
+TYPEDEF _Int64 blkcnt_t;
+TYPEDEF unsigned _Int64 fsblkcnt_t;
+TYPEDEF unsigned _Int64 fsfilcnt_t;
+
+TYPEDEF unsigned long wctype_t;
+
+TYPEDEF void * timer_t;
+TYPEDEF int clockid_t;
+TYPEDEF long clock_t;
+STRUCT timeval { time_t tv_sec; suseconds_t tv_usec; };
+STRUCT timespec { time_t tv_sec; long tv_nsec; };
+
+TYPEDEF int pid_t;
+TYPEDEF unsigned id_t;
+TYPEDEF unsigned uid_t;
+TYPEDEF unsigned gid_t;
+TYPEDEF int key_t;
+TYPEDEF unsigned useconds_t;
+
+#ifdef __cplusplus
+TYPEDEF unsigned long pthread_t;
+#else
+TYPEDEF struct __pthread * pthread_t;
+#endif
+TYPEDEF int pthread_once_t;
+TYPEDEF int pthread_key_t;
+TYPEDEF int pthread_spinlock_t;
+TYPEDEF unsigned pthread_mutexattr_t;
+TYPEDEF unsigned pthread_condattr_t;
+TYPEDEF unsigned pthread_barrierattr_t;
+TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
+
+TYPEDEF struct _IO_FILE FILE;
+
+TYPEDEF struct __locale_struct * locale_t;
+
+TYPEDEF struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
+
+STRUCT iovec { void *iov_base; size_t iov_len; };
+
+TYPEDEF unsigned socklen_t;
+TYPEDEF unsigned short sa_family_t;
#include <features.h>
#include <netinet/in.h>
-#include <inttypes.h>
-
-#define __NEED_socklen_t
-#define __NEED_in_addr_t
-#define __NEED_in_port_t
-#define __NEED_uint16_t
-#define __NEED_uint32_t
-#define __NEED_struct_in_addr
-
-#include <bits/alltypes.h>
uint32_t htonl(uint32_t);
uint16_t htons(uint16_t);
#include <bits/alltypes.h>
-typedef struct __DIR_s DIR;
+typedef struct __dirstream DIR;
struct dirent
{
extern "C" {
#endif
-#define __NEED_nl_item
+#include <nl_types.h>
+
#define __NEED_locale_t
#include <bits/alltypes.h>
#define __NEED_float_t
#define __NEED_double_t
-#define __NEED___uint16_t
-#define __NEED___uint32_t
-#define __NEED___uint64_t
#include <bits/alltypes.h>
#if 100*__GNUC__+__GNUC_MINOR__ >= 303
int __fpclassifyf(float);
int __fpclassifyl(long double);
-static __inline __uint32_t __FLOAT_BITS(float __f)
+static __inline unsigned __FLOAT_BITS(float __f)
{
- union {float __f; __uint32_t __i;} __u = {__f};
+ union {float __f; unsigned __i;} __u = {__f};
return __u.__i;
}
-static __inline __uint64_t __DOUBLE_BITS(double __f)
+static __inline unsigned long long __DOUBLE_BITS(double __f)
{
- union {double __f; __uint64_t __i;} __u = {__f};
+ union {double __f; unsigned long long __i;} __u = {__f};
return __u.__i;
}
#define isinf(x) ( \
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) == 0x7f800000 : \
- sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & (__uint64_t)-1>>1) == (__uint64_t)0x7ff<<52 : \
+ sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) == 0x7ffULL<<52 : \
__fpclassifyl(x) == FP_INFINITE)
#define isnan(x) ( \
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) > 0x7f800000 : \
- sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & (__uint64_t)-1>>1) > (__uint64_t)0x7ff<<52 : \
+ sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) > 0x7ffULL<<52 : \
__fpclassifyl(x) == FP_NAN)
#define isnormal(x) ( \
sizeof(x) == sizeof(float) ? ((__FLOAT_BITS(x)+0x00800000) & 0x7fffffff) >= 0x01000000 : \
- sizeof(x) == sizeof(double) ? ((__DOUBLE_BITS(x)+((__uint64_t)1<<52)) & (__uint64_t)-1>>1) >= (__uint64_t)1<<53 : \
+ sizeof(x) == sizeof(double) ? ((__DOUBLE_BITS(x)+(1ULL<<52)) & -1ULL>>1) >= 1ULL<<53 : \
__fpclassifyl(x) == FP_NORMAL)
#define isfinite(x) ( \
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) < 0x7f800000 : \
- sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & (__uint64_t)-1>>1) < (__uint64_t)0x7ff<<52 : \
+ sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) < 0x7ffULL<<52 : \
__fpclassifyl(x) > FP_INFINITE)
int __signbit(double);
#endif
#include <features.h>
+#include <netinet/in.h>
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define __NEED_size_t
-#endif
-
-#define __NEED_socklen_t
-#define __NEED_uint32_t
-
#include <bits/alltypes.h>
+#endif
struct addrinfo
{
#endif
#include <features.h>
+#include <inttypes.h>
+#include <sys/socket.h>
-#define __NEED_in_addr_t
-#define __NEED_in_port_t
-#define __NEED_sa_family_t
-#define __NEED_struct_in_addr
-#define __NEED_uint8_t
-#define __NEED_uint16_t
-#define __NEED_uint32_t
-
-#include <bits/alltypes.h>
+typedef uint16_t in_port_t;
+typedef uint32_t in_addr_t;
+struct in_addr { in_addr_t s_addr; };
struct sockaddr_in
{
#define NL_SETD 1
#define NL_CAT_LOCALE 1
-#define __NEED_nl_item
-#include <bits/alltypes.h>
-
-typedef long nl_catd;
+typedef int nl_item;
+typedef void *nl_catd;
nl_catd catopen (const char *, int);
char *catgets (nl_catd, int, int, const char *);
|| defined(_BSD_SOURCE)
#ifdef _GNU_SOURCE
-#define __siginfo siginfo
#define __ucontext ucontext
#endif
#define __NEED_time_t
#define __NEED_clock_t
#define __NEED_sigset_t
-#define __NEED_siginfo_t
#include <bits/alltypes.h>
#define CLD_STOPPED 5
#define CLD_CONTINUED 6
-struct sigaction {
- union {
- void (*sa_handler)(int);
- void (*sa_sigaction)(int, siginfo_t *, void *);
- } __sa_handler;
- sigset_t sa_mask;
- int sa_flags;
- void (*sa_restorer)(void);
-};
-#define sa_handler __sa_handler.sa_handler
-#define sa_sigaction __sa_handler.sa_sigaction
-
-typedef struct {
+typedef struct sigaltstack {
void *ss_sp;
int ss_flags;
size_t ss_size;
void *sival_ptr;
};
-struct __siginfo {
+typedef struct {
int si_signo, si_errno, si_code;
union {
char __pad[128 - 2*sizeof(int) - sizeof(long)];
int si_fd;
} __sigpoll;
} __si_fields;
-};
+} siginfo_t;
#define si_pid __si_fields.__sigchld.si_pid
#define si_uid __si_fields.__sigchld.si_uid
#define si_status __si_fields.__sigchld.si_status
#define si_ptr __si_fields.__rt.si_sigval.sival_ptr
#define si_int __si_fields.__rt.si_sigval.sival_int
+struct sigaction {
+ union {
+ void (*sa_handler)(int);
+ void (*sa_sigaction)(int, siginfo_t *, void *);
+ } __sa_handler;
+ sigset_t sa_mask;
+ int sa_flags;
+ void (*sa_restorer)(void);
+};
+#define sa_handler __sa_handler.sa_handler
+#define sa_sigaction __sa_handler.sa_sigaction
+
struct sigevent {
union sigval sigev_value;
int sigev_signo;
#define __NEED_uint32_t
#define __NEED_uint64_t
-#define __NEED_int_fast8_t
-#define __NEED_int_fast16_t
-#define __NEED_int_fast32_t
-#define __NEED_int_fast64_t
-
-#define __NEED_uint_fast8_t
-#define __NEED_uint_fast16_t
-#define __NEED_uint_fast32_t
-#define __NEED_uint_fast64_t
-
#define __NEED_intptr_t
#define __NEED_uintptr_t
#include <bits/alltypes.h>
+typedef int8_t int_fast8_t;
+typedef int64_t int_fast64_t;
+
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
+typedef uint8_t uint_fast8_t;
+typedef uint64_t uint_fast64_t;
+
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
#define UINT32_MAX (0xffffffff)
#define UINT64_MAX (0xffffffffffffffff)
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST64_MIN INT64_MIN
+
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MIN INT64_MIN
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST64_MAX INT64_MAX
+
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MAX INT64_MAX
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define WCHAR_MIN (-1-0x7fffffff+L'\0')
#endif
+#define SIG_ATOMIC_MIN INT32_MIN
+#define SIG_ATOMIC_MAX INT32_MAX
+
#include <bits/stdint.h>
#define INT8_C(c) c
#define TMP_MAX 10000
#define L_tmpnam 20
-typedef union {
+typedef union _G_fpos64_t {
char __opaque[16];
double __align;
} fpos_t;
#endif
#include <features.h>
+#include <sys/time.h>
#define __NEED_id_t
-#define __NEED_time_t
-#define __NEED_struct_timeval
#ifdef _GNU_SOURCE
#define __NEED_pid_t
#include <sys/statvfs.h>
-typedef struct {
+typedef struct __fsid_t {
int __val[2];
} fsid_t;
#define __NEED_int32_t
#define __NEED_int64_t
-#define __NEED___uint16_t
-#define __NEED___uint32_t
-#define __NEED___uint64_t
-
#define __NEED_blkcnt_t
#define __NEED_fsblkcnt_t
#define __NEED_fsfilcnt_t
#include <bits/alltypes.h>
typedef unsigned char u_int8_t;
-typedef __uint16_t u_int16_t;
-typedef __uint32_t u_int32_t;
-typedef __uint64_t u_int64_t;
+typedef unsigned short u_int16_t;
+typedef unsigned u_int32_t;
+typedef unsigned long long u_int64_t;
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef char *caddr_t;
#define __NEED_pid_t
#define __NEED_id_t
-#define __NEED_siginfo_t
#include <bits/alltypes.h>
-typedef int idtype_t;
+typedef enum {
+ P_ALL = 0,
+ P_PID = 1,
+ P_PGID = 2
+} idtype_t;
pid_t wait (int *);
int waitid (idtype_t, id_t, siginfo_t *, int);
#define __WALL 0x40000000
#define __WCLONE 0x80000000
-#define P_ALL 0
-#define P_PID 1
-#define P_PGID 2
-
#define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
#define WTERMSIG(s) ((s) & 0x7f)
#define WSTOPSIG(s) WEXITSTATUS(s)
#define __NEED_pid_t
#define __NEED_time_t
+#define __NEED_suseconds_t
#define __NEED_struct_timeval
#include <bits/alltypes.h>
#undef WEOF
#define WEOF (-1)
-typedef struct
+typedef struct __mbstate_t
{
unsigned __opaque1, __opaque2;
} mbstate_t;
#include <features.h>
#define __NEED_wint_t
-#define __NEED_wctrans_t
#define __NEED_wctype_t
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
#include <bits/alltypes.h>
+typedef const int * wctrans_t;
+
#undef WEOF
#define WEOF (-1)
-struct __DIR_s
+struct __dirstream
{
int fd;
off_t tell;
#include <locale.h>
-struct __locale {
+struct __locale_struct {
int dummy;
};
#define F_ERR 32
#define F_SVB 64
-struct __FILE_s {
+struct _IO_FILE {
unsigned flags;
unsigned char *rpos, *rend;
int (*close)(FILE *);
--- /dev/null
+/^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2)\
+typedef \1 \2;\
+#define __DEFINED_\2\
+#endif\
+/
+/^STRUCT/s/STRUCT * \([^ ]*\) \(.*\);$/#if defined(__NEED_struct_\1) \&\& !defined(__DEFINED_struct_\1)\
+struct \1 \2;\
+#define __DEFINED_struct_\1\
+#endif\
+/
+/^UNION/s/UNION * \([^ ]*\) \(.*\);$/#if defined(__NEED_union_\1) \&\& !defined(__DEFINED_union_\1)\
+union \1 \2;\
+#define __DEFINED_union_\1\
+#endif\
+/