OSDN Git Service

add mmap()/munmap() implementation for Windows
[uclinux-h8/uClibc.git] / utils / porting.h
1 /* Misc system-specific crap */
2
3 #ifndef _PORTING_H_
4 #define _PORTING_H_
5
6 #ifdef HAVE_CONFIG_H
7 #include <config.h>
8 #endif
9
10 #include <ctype.h>
11 #include <dirent.h>
12 #include <errno.h>
13 #include <fcntl.h>
14 #include <limits.h>
15 #include <stdarg.h>
16 #include <stdint.h>
17 #include <stdio.h>
18 #include <string.h>
19 #include <strings.h>
20 #include <stdlib.h>
21 #include <unistd.h>
22 #include <sys/param.h>
23 #include <sys/stat.h>
24 #include <sys/types.h>
25
26 #ifdef __LDSO_LDD_SUPPORT__
27 # include <sys/wait.h>
28 #endif
29
30 #if defined(_WIN32) || defined(_WINNT)
31 # include "mmap-windows.c"
32 #else
33 # include <sys/mman.h>
34 #endif
35
36 #include <link.h>
37 /* makefile will include elf.h for us */
38
39 #include "bswap.h"
40 #include "dl-defs.h"
41
42 #ifdef DMALLOC
43 #include <dmalloc.h>
44 #endif
45
46 /* For SunOS */
47 #ifndef PATH_MAX
48 #define PATH_MAX _POSIX_PATH_MAX
49 #endif
50
51 #ifndef UCLIBC_RUNTIME_PREFIX
52 # define UCLIBC_RUNTIME_PREFIX "/"
53 #endif
54
55 #undef UCLIBC_ENDIAN_HOST
56 #define UCLIBC_ENDIAN_LITTLE 1234
57 #define UCLIBC_ENDIAN_BIG    4321
58 #if defined(BYTE_ORDER)
59 # if BYTE_ORDER == LITTLE_ENDIAN
60 #  define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE
61 # elif BYTE_ORDER == BIG_ENDIAN
62 #  define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG
63 # endif
64 #elif defined(__BYTE_ORDER)
65 # if __BYTE_ORDER == __LITTLE_ENDIAN
66 #  define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE
67 # elif __BYTE_ORDER == __BIG_ENDIAN
68 #  define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG
69 # endif
70 #endif
71 #if !defined(UCLIBC_ENDIAN_HOST)
72 # error "Unknown host byte order!"
73 #endif
74
75 #endif