compat.h 900 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _SOLARIS_COMPAT_H
  2. #define _SOLARIS_COMPAT_H
  3. #define __BEGIN_DECLS
  4. #define __END_DECLS
  5. #ifndef __P
  6. #define __P(p) p
  7. #endif
  8. #include <alloca.h>
  9. #include <strings.h>
  10. #include <string.h>
  11. #include <pthread.h>
  12. #include <sys/stat.h>
  13. #include <signal.h>
  14. #include <netinet/in.h>
  15. #ifndef BYTE_ORDER
  16. #define LITTLE_ENDIAN 1234
  17. #define BIG_ENDIAN 4321
  18. #ifdef __sparc__
  19. #define BYTE_ORDER BIG_ENDIAN
  20. #else
  21. #define BYTE_ORDER LITTLE_ENDIAN
  22. #endif
  23. #endif
  24. #ifndef __BYTE_ORDER
  25. #define __LITTLE_ENDIAN LITTLE_ENDIAN
  26. #define __BIG_ENDIAN BIG_ENDIAN
  27. #define __BYTE_ORDER BYTE_ORDER
  28. #endif
  29. #ifndef __BIT_TYPES_DEFINED__
  30. #define __BIT_TYPES_DEFINED__
  31. typedef unsigned char u_int8_t;
  32. typedef unsigned short u_int16_t;
  33. typedef unsigned int u_int32_t;
  34. #endif
  35. char* strsep(char** str, const char* delims);
  36. int setenv(const char *name, const char *value, int overwrite);
  37. int unsetenv(const char *name);
  38. #endif