u.h 1.4 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 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<<7)
  23. #define FPUNFL (1<<8)
  24. #define FPOVFL (1<<9)
  25. #define FPZDIV (1<<10)
  26. #define FPINVAL (1<<11)
  27. #define FPRNR (0<<0)
  28. #define FPRZ (1<<0)
  29. #define FPRPINF (2<<0)
  30. #define FPRNINF (3<<0)
  31. #define FPRMASK (3<<0)
  32. #define FPPEXT 0
  33. #define FPPSGL 0
  34. #define FPPDBL 0
  35. #define FPPMASK 0
  36. /* FSR */
  37. #define FPAINEX (1<<2)
  38. #define FPAOVFL (1<<4)
  39. #define FPAUNFL (1<<3)
  40. #define FPAZDIV (1<<5)
  41. #define FPAINVAL (1<<6)
  42. union FPdbleword
  43. {
  44. double x;
  45. struct { /* big endian */
  46. ulong hi;
  47. ulong lo;
  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))[-1]:\
  61. (sizeof(mode) == 2)?\
  62. ((mode*)(list += 4))[-1]:\
  63. ((mode*)(list += sizeof(mode)))[-1])