os.h 2.1 KB

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