porting.h 1.4 KB

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