u.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 ushort Rune;
  10. typedef union FPdbleword FPdbleword;
  11. typedef long jmp_buf[2];
  12. #define JMPBUFSP 0
  13. #define JMPBUFPC 1
  14. #define JMPBUFDPC 0
  15. typedef unsigned int mpdigit; /* for /sys/include/mp.h */
  16. typedef unsigned char u8int;
  17. typedef unsigned short u16int;
  18. typedef unsigned int u32int;
  19. typedef unsigned long long u64int;
  20. /* FCR */
  21. #define FPINEX (1<<30)
  22. #define FPOVFL (1<<19)
  23. #define FPUNFL ((1<<29)|(1<<28))
  24. #define FPZDIV (1<<18)
  25. #define FPINVAL (1<<17)
  26. #define FPRNR (2<<26)
  27. #define FPRZ (0<<26)
  28. #define FPRPINF (3<<26)
  29. #define FPRNINF (1<<26)
  30. #define FPRMASK (3<<26)
  31. #define FPPEXT 0
  32. #define FPPSGL 0
  33. #define FPPDBL 0
  34. #define FPPMASK 0
  35. /* FSR */
  36. #define FPAINEX (1<<24)
  37. #define FPAUNFL (1<<23)
  38. #define FPAOVFL (1<<22)
  39. #define FPAZDIV (1<<21)
  40. #define FPAINVAL (1<<20)
  41. union FPdbleword
  42. {
  43. double x;
  44. struct { /* little endian */
  45. ulong lo;
  46. ulong hi;
  47. };
  48. };
  49. /* stdarg */
  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. sizeof(mode)>4?\
  63. ((mode*)(list = (char*)((long)(list+7) & ~7) + sizeof(mode)))[-1]:\
  64. ((mode*)(list += sizeof(mode)))[-1])