home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / py2s152.zip / Include / mymath.h < prev    next >
C/C++ Source or Header  |  1999-06-27  |  2KB  |  76 lines

  1. /* On the 68K Mac, when using CFM (Code Fragment Manager),
  2.    <math.h> requires special treatment -- we need to surround it with
  3.    #pragma lib_export off / on...
  4.    This is because MathLib.o is a static library, and exporting its
  5.    symbols doesn't quite work...
  6.    XXX Not sure now...  Seems to be something else going on as well... */
  7.  
  8. #ifdef SYMANTEC__CFM68K__
  9. #pragma lib_export off
  10. #endif
  11.  
  12. #ifndef HAVE_HYPOT
  13. extern double hypot Py_PROTO((double, double));
  14. #ifdef MWERKS_BEFORE_PRO4
  15. #define hypot we_dont_want_faulty_hypot_decl
  16. #endif
  17. #endif
  18.  
  19. #include <math.h>
  20.  
  21. #ifndef HAVE_HYPOT
  22. #ifdef __MWERKS__
  23. #undef hypot
  24. #endif
  25. #endif
  26.  
  27. #ifdef SYMANTEC__CFM68K__
  28. #pragma lib_export on
  29. #endif
  30.  
  31. #if defined(USE_MSL) && defined(__MC68K__)
  32. /* CodeWarrior MSL 2.1.1 has weird define overrides that don't work
  33. ** when you take the address of math functions. If I interpret the
  34. ** ANSI C standard correctly this is illegal, but I haven't been able
  35. ** to convince the MetroWerks folks of this...
  36. */
  37. #undef acos
  38. #undef asin
  39. #undef atan
  40. #undef atan2
  41. #undef ceil
  42. #undef cos
  43. #undef cosh
  44. #undef exp
  45. #undef fabs
  46. #undef floor
  47. #undef fmod
  48. #undef log
  49. #undef log10
  50. #undef pow
  51. #undef sin
  52. #undef sinh
  53. #undef sqrt
  54. #undef tan
  55. #undef tanh
  56. #define acos acosd
  57. #define asin asind
  58. #define atan atand
  59. #define atan2 atan2d
  60. #define ceil ceild
  61. #define cos cosd
  62. #define cosh coshd
  63. #define exp expd
  64. #define fabs fabsd
  65. #define floor floord
  66. #define fmod fmodd
  67. #define log logd
  68. #define log10 log10d
  69. #define pow powd
  70. #define sin sind
  71. #define sinh sinhd
  72. #define sqrt sqrtd
  73. #define tan tand
  74. #define tanh tanhd
  75. #endif 
  76.