Subversion Repositories Kolibri OS

Rev

Rev 1029 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. #define  NULL (void*)0
  3.  
  4.  
  5. typedef  unsigned char        u8_t;
  6. typedef  unsigned short int   u16_t;
  7. typedef  unsigned int         u32_t;
  8. typedef  unsigned long long   u64_t;
  9.  
  10. typedef  unsigned int         addr_t;
  11.  
  12. typedef  unsigned int         size_t;
  13. typedef  unsigned int         count_t;
  14. typedef  unsigned int         eflags_t;
  15.  
  16. typedef  unsigned int Bool;
  17.  
  18. #define  TRUE  (Bool)1
  19. #define  FALSE (Bool)0
  20.  
  21. /*
  22.  * min()/max() macros that also do
  23.  * strict type-checking.. See the
  24.  * "unnecessary" pointer comparison.
  25.  */
  26. #define min(x,y) ({ \
  27.         typeof(x) _x = (x);     \
  28.         typeof(y) _y = (y);     \
  29.         (void) (&_x == &_y);            \
  30.         _x < _y ? _x : _y; })
  31.  
  32. #define max(x,y) ({ \
  33.         typeof(x) _x = (x);     \
  34.         typeof(y) _y = (y);     \
  35.         (void) (&_x == &_y);            \
  36.         _x > _y ? _x : _y; })
  37.  
  38.  
  39. #define min_t(type,x,y) \
  40.         ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
  41. #define max_t(type,x,y) \
  42.         ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
  43.  
  44.  
  45.