1
0

u.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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<<30)
  23. #define FPOVFL (1<<19)
  24. #define FPUNFL ((1<<29)|(1<<28))
  25. #define FPZDIV (1<<18)
  26. #define FPINVAL (1<<17)
  27. #define FPRNR (2<<26)
  28. #define FPRZ (0<<26)
  29. #define FPRPINF (3<<26)
  30. #define FPRNINF (1<<26)
  31. #define FPRMASK (3<<26)
  32. #define FPPEXT 0
  33. #define FPPSGL 0
  34. #define FPPDBL 0
  35. #define FPPMASK 0
  36. /* FSR */
  37. #define FPAINEX (1<<24)
  38. #define FPAUNFL (1<<23)
  39. #define FPAOVFL (1<<22)
  40. #define FPAZDIV (1<<21)
  41. #define FPAINVAL (1<<20)
  42. union FPdbleword
  43. {
  44. double x;
  45. struct { /* little endian */
  46. ulong lo;
  47. ulong hi;
  48. };
  49. };
  50. /* stdarg */
  51. typedef char* va_list;
  52. #define va_start(list, start) list =\
  53. (sizeof(start) < 4?\
  54. (char*)((int*)&(start)+1):\
  55. (char*)(&(start)+1))
  56. #define va_end(list)\
  57. USED(list)
  58. #define va_arg(list, mode)\
  59. (sizeof(mode)==1?\
  60. ((mode*)(list += 4))[-4]:\
  61. sizeof(mode)==2?\
  62. ((mode*)(list += 4))[-2]:\
  63. sizeof(mode)>4?\
  64. ((mode*)(list = (char*)((long)(list+7) & ~7) + sizeof(mode)))[-1]:\
  65. ((mode*)(list += sizeof(mode)))[-1])