1
0

u.h 1.5 KB

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