Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
5.3 KiB

  1. #define IN_KERNEL 1
  2. #if 0
  3. /* #define this in floatem.c, fedefs.h and EM_support.c */
  4. #define DEBUG_UNIX
  5. #endif
  6. #ifdef IN_KERNEL
  7. #define FP_EMULATION_ERROR0(string) \
  8. {DbgPrint(string); }
  9. #define FP_EMULATION_ERROR1(string, arg) \
  10. {DbgPrint(string, arg); }
  11. #define FP_EMULATION_ERROR2(string, arg1, arg2) \
  12. {DbgPrint(string, arg1, arg2); }
  13. #define FP_EMULATION_ERROR3(string, arg1, arg2, arg3) \
  14. {DbgPrint(string, arg1, arg2, arg3); }
  15. #define FP_EMULATION_ERROR4(string, arg1, arg2, arg3, arg4) \
  16. {DbgPrint(string, arg1, arg2, arg3, arg4); }
  17. #define FP_EMULATION_ERROR5(string, arg1, arg2, arg3, arg4, arg5) \
  18. {DbgPrint(string, arg1, arg2, arg3, arg4, arg5); }
  19. #define FP_EMULATION_ERROR6(string, arg1, arg2, arg3, arg4, arg5, arg6) \
  20. {DbgPrint(string, arg1, arg2, arg3, arg4, arg5, arg6); }
  21. #define FP_EMULATION_PRINT0(string) \
  22. {DbgPrint(string); }
  23. #define FP_EMULATION_PRINT1(string, arg) \
  24. {DbgPrint(string, arg); }
  25. #define FP_EMULATION_PRINT2(string, arg1, arg2) \
  26. {DbgPrint(string, arg1, arg2); }
  27. #define FP_EMULATION_PRINT3(string, arg1, arg2, arg3) \
  28. {DbgPrint(string, arg1, arg2, arg3); }
  29. #define FP_EMULATION_PRINT4(string, arg1,arg2, arg3, arg4) \
  30. {DbgPrint(string, arg1, arg2, arg3, arg4); }
  31. #define FP_EMULATION_PRINT5(string, arg1, arg2, arg3, arg4, arg5) \
  32. {DbgPrint(string, arg1, arg2, arg3, arg4, arg5); }
  33. #define FP_EMULATION_PRINT6(string, arg1, arg2, arg3, arg4, arg5, arg6) \
  34. {DbgPrint(string, arg1, arg2, arg3, arg4, arg5, arg6); }
  35. #define perror(string) DbgPrint(string)
  36. #define exit(number) KeBugCheck(FP_EMULATION_ERROR)
  37. #elif defined(unix)
  38. #define FP_EMULATION_ERROR0(string) \
  39. {DbgPrint(string); }
  40. #define FP_EMULATION_ERROR1(string, arg) \
  41. {DbgPrint(string, arg); }
  42. #define FP_EMULATION_ERROR2(string, arg1, arg2) \
  43. {DbgPrint(string, arg1, arg2); }
  44. #define FP_EMULATION_ERROR3(string, arg1, arg2, arg3) \
  45. {DbgPrint(string, arg1, arg2, arg3); }
  46. #define FP_EMULATION_ERROR4(string, arg1, arg2, arg3, arg4) \
  47. {DbgPrint(string, arg1, arg2, arg3, arg4); }
  48. #define FP_EMULATION_ERROR5(string, arg1, arg2, arg3, arg4, arg5) \
  49. {DbgPrint(string, arg1, arg2, arg3, arg4, arg5); }
  50. #define FP_EMULATION_ERROR6(string, arg1, arg2, arg3, arg4, arg5, arg6) \
  51. {DbgPrint(string, arg1, arg2, arg3, arg4, arg5, arg6); }
  52. #define FP_EMULATION_PRINT0(string) \
  53. {DbgPrint(string); }
  54. #define FP_EMULATION_PRINT1(string, arg) \
  55. {DbgPrint(string, arg); }
  56. #define FP_EMULATION_PRINT2(string, arg1, arg2) \
  57. {DbgPrint(string, arg1, arg2); }
  58. #define FP_EMULATION_PRINT3(string, arg1, arg2, arg3) \
  59. {DbgPrint(string, arg1, arg2, arg3); }
  60. #define FP_EMULATION_PRINT4(string, arg1,arg2, arg3, arg4) \
  61. {DbgPrint(string, arg1, arg2, arg3, arg4); }
  62. #define FP_EMULATION_PRINT5(string, arg1, arg2, arg3, arg4, arg5) \
  63. {DbgPrint(string, arg1, arg2, arg3, arg4, arg5); }
  64. #define FP_EMULATION_PRINT6(string, arg1, arg2, arg3, arg4, arg5, arg6) \
  65. {DbgPrint(string, arg1, arg2, arg3, arg4, arg5, arg6); }
  66. #ifdef DEBUG_UNIX
  67. #define DbgPrint printf
  68. #else
  69. #define DbgPrint(string)
  70. #endif
  71. #define KeBugCheck(FP_EMULATION_ERROR) return
  72. #else
  73. #define FP_EMULATION_ERROR0(string) \
  74. { fprintf (stderr, string); exit (1); }
  75. #define FP_EMULATION_ERROR1(string, arg) \
  76. { fprintf (stderr, string, arg); \
  77. exit (1); }
  78. #define FP_EMULATION_ERROR2(string, arg1, arg2) \
  79. { fprintf (stderr, string, arg1, arg2); \
  80. exit (1); }
  81. #define FP_EMULATION_ERROR3(string, arg1, arg2, arg3) \
  82. { fprintf (stderr, string, arg1, arg2, arg3); \
  83. exit (1); }
  84. #define FP_EMULATION_ERROR4(string, arg1, arg2, arg3, arg4) \
  85. { fprintf (stderr, string, arg1, arg2, arg3, arg4); \
  86. exit (1); }
  87. #define FP_EMULATION_ERROR5(string, arg1, arg2, arg3, arg4, arg5) \
  88. { fprintf (stderr, string, arg1, arg2, arg3, arg4, arg5); \
  89. exit (1); }
  90. #define FP_EMULATION_ERROR6(string, arg1, arg2, arg3, arg4, arg5, arg6) \
  91. { fprintf (stderr, string, arg1, arg2, arg3, arg4, arg5, arg6); \
  92. exit (1); }
  93. #define FP_EMULATION_PRINT0(string) \
  94. { printf (string); \
  95. fflush (stdout); }
  96. #define FP_EMULATION_PRINT1(string, arg) \
  97. { printf (string, arg); \
  98. fflush (stdout); }
  99. #define FP_EMULATION_PRINT2(string, arg1, arg2) \
  100. { printf (string, arg1, arg2); \
  101. fflush (stdout); }
  102. #define FP_EMULATION_PRINT3(string, arg1, arg2, arg3) \
  103. { printf (string, arg1, arg2, arg3); \
  104. fflush (stdout); }
  105. #define FP_EMULATION_PRINT4(string, arg1, arg2, arg3, arg4) \
  106. { printf (string, arg1, arg2, arg3, arg4); \
  107. fflush (stdout); }
  108. #define FP_EMULATION_PRINT5(string, arg1, arg2, arg3, arg4, arg5) \
  109. { printf (string, arg1, arg2, arg3, arg4, arg5); \
  110. fflush (stdout); }
  111. #define FP_EMULATION_PRINT6(string, arg1, arg2, arg3, arg4, arg5, arg6) \
  112. { printf (string, arg1, arg2, arg3, arg4, arg5, arg6); \
  113. fflush (stdout); }
  114. #endif