u.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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<<5)
  19. #define FPUNFL ((1<<4)|(1<<1))
  20. #define FPOVFL (1<<3)
  21. #define FPZDIV (1<<2)
  22. #define FPINVAL (1<<0)
  23. #define FPRNR (0<<10)
  24. #define FPRZ (3<<10)
  25. #define FPRPINF (2<<10)
  26. #define FPRNINF (1<<10)
  27. #define FPRMASK (3<<10)
  28. #define FPPEXT (3<<8)
  29. #define FPPSGL (0<<8)
  30. #define FPPDBL (2<<8)
  31. #define FPPMASK (3<<8)
  32. /* FSR */
  33. #define FPAINEX FPINEX
  34. #define FPAOVFL FPOVFL
  35. #define FPAUNFL FPUNFL
  36. #define FPAZDIV FPZDIV
  37. #define FPAINVAL FPINVAL
  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])