u.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #define nil ((void*)0)
  2. typedef unsigned short ushort;
  3. typedef unsigned char uchar;
  4. typedef unsigned long ulong;
  5. typedef unsigned int uint;
  6. typedef signed char schar;
  7. typedef long long vlong;
  8. typedef unsigned long long uvlong;
  9. typedef unsigned long uintptr;
  10. typedef ushort Rune;
  11. typedef union FPdbleword FPdbleword;
  12. typedef long jmp_buf[2];
  13. #define JMPBUFSP 0
  14. #define JMPBUFPC 1
  15. #define JMPBUFDPC 0
  16. typedef unsigned int mpdigit; /* for /sys/include/mp.h */
  17. typedef unsigned char u8int;
  18. typedef unsigned short u16int;
  19. typedef unsigned int u32int;
  20. typedef unsigned long long u64int;
  21. /* FCR */
  22. #define FPINEX (1<<5)
  23. #define FPUNFL ((1<<4)|(1<<1))
  24. #define FPOVFL (1<<3)
  25. #define FPZDIV (1<<2)
  26. #define FPINVAL (1<<0)
  27. #define FPRNR (0<<10)
  28. #define FPRZ (3<<10)
  29. #define FPRPINF (2<<10)
  30. #define FPRNINF (1<<10)
  31. #define FPRMASK (3<<10)
  32. #define FPPEXT (3<<8)
  33. #define FPPSGL (0<<8)
  34. #define FPPDBL (2<<8)
  35. #define FPPMASK (3<<8)
  36. /* FSR */
  37. #define FPAINEX FPINEX
  38. #define FPAOVFL FPOVFL
  39. #define FPAUNFL FPUNFL
  40. #define FPAZDIV FPZDIV
  41. #define FPAINVAL FPINVAL
  42. union FPdbleword
  43. {
  44. double x;
  45. struct { /* little endian */
  46. ulong lo;
  47. ulong hi;
  48. };
  49. };
  50. typedef char* va_list;
  51. #define va_start(list, start) list =\
  52. (sizeof(start) < 4?\
  53. (char*)((int*)&(start)+1):\
  54. (char*)(&(start)+1))
  55. #define va_end(list)\
  56. USED(list)
  57. #define va_arg(list, mode)\
  58. ((sizeof(mode) == 1)?\
  59. ((mode*)(list += 4))[-4]:\
  60. (sizeof(mode) == 2)?\
  61. ((mode*)(list += 4))[-2]:\
  62. ((mode*)(list += sizeof(mode)))[-1])