u.h 1.3 KB

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