porting.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. #include <sys/wait.h>
  23. #include <link.h>
  24. #include <sys/mman.h>
  25. /* makefile will include elf.h for us */
  26. #include "bswap.h"
  27. #include "dl-defs.h"
  28. #ifdef DMALLOC
  29. #include <dmalloc.h>
  30. #endif
  31. /* For SunOS */
  32. #ifndef PATH_MAX
  33. #define PATH_MAX _POSIX_PATH_MAX
  34. #endif
  35. #ifndef UCLIBC_RUNTIME_PREFIX
  36. # define UCLIBC_RUNTIME_PREFIX "/"
  37. #endif
  38. #undef UCLIBC_ENDIAN_HOST
  39. #define UCLIBC_ENDIAN_LITTLE 1234
  40. #define UCLIBC_ENDIAN_BIG 4321
  41. #if defined(BYTE_ORDER)
  42. # if BYTE_ORDER == LITTLE_ENDIAN
  43. # define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE
  44. # elif BYTE_ORDER == BIG_ENDIAN
  45. # define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG
  46. # endif
  47. #elif 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. #endif
  54. #if !defined(UCLIBC_ENDIAN_HOST)
  55. # error "Unknown host byte order!"
  56. #endif
  57. #endif