os.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * THIS FILE IS NOT IDENTICAL TO THE ORIGINAL
  3. * FROM THE BZIP2 DISTRIBUTION.
  4. *
  5. * It has been modified, mainly to break the library
  6. * into smaller pieces.
  7. *
  8. * Russ Cox
  9. * rsc@plan9.bell-labs.com
  10. * July 2000
  11. */
  12. /*---------------------------------------------*/
  13. /*--
  14. Place a 1 beside your platform, and 0 elsewhere.
  15. Attempts to autosniff this even if you don't.
  16. --*/
  17. /*--
  18. Generic 32-bit Unix.
  19. Also works on 64-bit Unix boxes.
  20. --*/
  21. #define BZ_UNIX 1
  22. /*--
  23. Win32, as seen by Jacob Navia's excellent
  24. port of (Chris Fraser & David Hanson)'s excellent
  25. lcc compiler.
  26. --*/
  27. #define BZ_LCCWIN32 0
  28. #if defined(_WIN32) && !defined(__CYGWIN__)
  29. #undef BZ_LCCWIN32
  30. #define BZ_LCCWIN32 1
  31. #undef BZ_UNIX
  32. #define BZ_UNIX 0
  33. #endif
  34. /*--
  35. Plan 9 from Bell Labs
  36. --*/
  37. #define BZ_PLAN9 0
  38. #if defined(PLAN9)
  39. #undef BZ_UNIX
  40. #define BZ_UNIX 0
  41. #undef BZ_PLAN9
  42. #define BZ_PLAN9 1
  43. #endif
  44. #if BZ_UNIX
  45. # include "unix.h"
  46. #elif BZ_LCCWIN32
  47. # include "lccwin32.h"
  48. #elif BZ_PLAN9
  49. # include "plan9.h"
  50. #endif
  51. #ifdef __GNUC__
  52. # define NORETURN __attribute__ ((noreturn))
  53. #else
  54. # define NORETURN /**/
  55. #endif
  56. /*--
  57. Some more stuff for all platforms :-)
  58. This might have to get moved into the platform-specific
  59. header files if we encounter a machine with different sizes.
  60. --*/
  61. typedef char Char;
  62. typedef unsigned char Bool;
  63. typedef unsigned char UChar;
  64. typedef int Int32;
  65. typedef unsigned int UInt32;
  66. typedef short Int16;
  67. typedef unsigned short UInt16;
  68. #define True ((Bool)1)
  69. #define False ((Bool)0)
  70. /*--
  71. IntNative is your platform's `native' int size.
  72. Only here to avoid probs with 64-bit platforms.
  73. --*/
  74. typedef int IntNative;