porting.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. #ifdef BUILDING_LINKAGE
  31. #include <link.h>
  32. /* makefile will include elf.h for us */
  33. #include "bswap.h"
  34. #include "dl-defs.h"
  35. #endif
  36. #ifdef DMALLOC
  37. #include <dmalloc.h>
  38. #endif
  39. /* For SunOS */
  40. #ifndef PATH_MAX
  41. #define PATH_MAX _POSIX_PATH_MAX
  42. #endif
  43. #ifndef UCLIBC_RUNTIME_PREFIX
  44. # define UCLIBC_RUNTIME_PREFIX "/"
  45. #endif
  46. #undef UCLIBC_ENDIAN_HOST
  47. #define UCLIBC_ENDIAN_LITTLE 1234
  48. #define UCLIBC_ENDIAN_BIG 4321
  49. #if defined(BYTE_ORDER)
  50. # if BYTE_ORDER == LITTLE_ENDIAN
  51. # define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE
  52. # elif BYTE_ORDER == BIG_ENDIAN
  53. # define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG
  54. # endif
  55. #elif defined(__BYTE_ORDER)
  56. # if __BYTE_ORDER == __LITTLE_ENDIAN
  57. # define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE
  58. # elif __BYTE_ORDER == __BIG_ENDIAN
  59. # define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG
  60. # endif
  61. #endif
  62. #if !defined(UCLIBC_ENDIAN_HOST)
  63. # error "Unknown host byte order!"
  64. #endif
  65. #if defined __GNUC__ || defined __ICC
  66. # define attribute_noreturn __attribute__ ((__noreturn__))
  67. #else
  68. # define attribute_noreturn
  69. #endif
  70. #endif