1
0

u.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 long uintptr;
  10. typedef ushort Rune;
  11. typedef union FPdbleword FPdbleword;
  12. typedef uvlong 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. /* MXCSR */
  22. /* fcr */
  23. #define FPFTZ (1<<15) /* amd64 */
  24. #define FPINEX (1<<12)
  25. #define FPUNFL (1<<11)
  26. #define FPOVFL (1<<10)
  27. #define FPZDIV (1<<9)
  28. #define FPDNRM (1<<8) /* amd64 */
  29. #define FPINVAL (1<<7)
  30. #define FPDAZ (1<<6) /* amd64 */
  31. #define FPRNR (0<<13)
  32. #define FPRZ (3<<13)
  33. #define FPRPINF (2<<13)
  34. #define FPRNINF (1<<13)
  35. #define FPRMASK (3<<13)
  36. #define FPPEXT 0
  37. #define FPPSGL 0
  38. #define FPPDBL 0
  39. #define FPPMASK 0
  40. /* fsr */
  41. #define FPAINEX (1<<5)
  42. #define FPAUNFL (1<<4)
  43. #define FPAOVFL (1<<3)
  44. #define FPAZDIV (1<<2)
  45. #define FPADNRM (1<<1) /* not in plan 9 */
  46. #define FPAINVAL (1<<0)
  47. union FPdbleword
  48. {
  49. double x;
  50. struct { /* little endian */
  51. uint lo;
  52. uint hi;
  53. };
  54. };
  55. typedef char* va_list;
  56. #define va_start(list, start) list =\
  57. (sizeof(start) < 8?\
  58. (char*)((vlong*)&(start)+1):\
  59. (char*)(&(start)+1))
  60. #define va_end(list)\
  61. USED(list)
  62. #define va_arg(list, mode)\
  63. ((sizeof(mode) == 1)?\
  64. ((mode*)(list += 8))[-8]:\
  65. (sizeof(mode) == 2)?\
  66. ((mode*)(list += 8))[-4]:\
  67. (sizeof(mode) == 4)?\
  68. ((mode*)(list += 8))[-2]:\
  69. ((mode*)(list += sizeof(mode)))[-1])