u.h 1.4 KB

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