u.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 vlong intptr;
  10. typedef unsigned long long uintptr;
  11. typedef unsigned long usize;
  12. typedef uint Rune;
  13. typedef union FPdbleword FPdbleword;
  14. typedef uintptr jmp_buf[2];
  15. #define JMPBUFSP 0
  16. #define JMPBUFPC 1
  17. #define JMPBUFDPC 0
  18. typedef unsigned int mpdigit; /* for /sys/include/mp.h */
  19. typedef unsigned char u8int;
  20. typedef unsigned short u16int;
  21. typedef unsigned int u32int;
  22. typedef unsigned long long u64int;
  23. /* FCR */
  24. #define FPINEX 0
  25. #define FPUNFL 0
  26. #define FPOVFL 0
  27. #define FPZDIV 0
  28. #define FPINVAL 0
  29. #define FPRNR (0<<5)
  30. #define FPRZ (1<<5)
  31. #define FPRPINF (3<<5)
  32. #define FPRNINF (2<<5)
  33. #define FPRMASK (15<<5)
  34. #define FPPEXT 0
  35. #define FPPSGL 0
  36. #define FPPDBL 0
  37. #define FPPMASK 0
  38. /* FSR */
  39. #define FPAINEX (1<<0)
  40. #define FPAOVFL (1<<2)
  41. #define FPAUNFL (1<<1)
  42. #define FPAZDIV (1<<3)
  43. #define FPAINVAL (1<<4)
  44. union FPdbleword
  45. {
  46. double x;
  47. struct { /* little endian */
  48. ulong lo;
  49. ulong hi;
  50. };
  51. };
  52. /* stdarg - little-endian 64-bit */
  53. typedef uintptr va_list;
  54. #define va_start(list, start) list =\
  55. (sizeof(start) < 4?\
  56. (uintptr)((long*)&(start)+1):\
  57. (uintptr)(&(start)+1))
  58. #define va_end(list)\
  59. USED(list)
  60. #define va_arg(list, mode)\
  61. ((sizeof(mode) == 1)?\
  62. ((list += 4), (mode*)list)[-4]:\
  63. (sizeof(mode) == 2)?\
  64. ((list += 4), (mode*)list)[-2]:\
  65. (sizeof(mode) == 4)?\
  66. ((list += 4), (mode*)list)[-1]:\
  67. ((list += sizeof(mode)+7), (list &= ~7), (mode*)list)[-1])
  68. #define _BITS64 /* for ape */