1 /* Misc system-specific crap */
22 #include <sys/param.h>
24 #include <sys/types.h>
26 #ifdef __LDSO_LDD_SUPPORT__
27 # include <sys/wait.h>
30 #if defined(_WIN32) || defined(_WINNT)
31 # include "mmap-windows.c"
33 # include <sys/mman.h>
36 #ifdef BUILDING_LINKAGE
38 /* makefile will include elf.h for us */
44 /* __WORDSIZE ist used for __ELF_NATIVE_CLASS, which is used for ElfW().
45 We want to provide the wordsize of the target, not of the host, when
46 compiling readelf.host
49 #ifdef ARCH_NATIVE_BIT
51 #define __WORDSIZE ARCH_NATIVE_BIT
59 # define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
64 #define PATH_MAX _POSIX_PATH_MAX
67 #ifndef UCLIBC_RUNTIME_PREFIX
68 # define UCLIBC_RUNTIME_PREFIX "/"
71 #undef UCLIBC_ENDIAN_HOST
72 #define UCLIBC_ENDIAN_LITTLE 1234
73 #define UCLIBC_ENDIAN_BIG 4321
74 #if defined(BYTE_ORDER)
75 # if BYTE_ORDER == LITTLE_ENDIAN
76 # define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE
77 # elif BYTE_ORDER == BIG_ENDIAN
78 # define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG
80 #elif defined(__BYTE_ORDER)
81 # if __BYTE_ORDER == __LITTLE_ENDIAN
82 # define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE
83 # elif __BYTE_ORDER == __BIG_ENDIAN
84 # define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG
87 #if !defined(UCLIBC_ENDIAN_HOST)
88 # error "Unknown host byte order!"
91 #if defined __GNUC__ || defined __ICC
92 # define attribute_noreturn __attribute__ ((__noreturn__))
94 # define attribute_noreturn