home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tcl8.0 / mac / tclMacMath.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-15  |  2.2 KB  |  146 lines  |  [TEXT/CWIE]

  1. /*
  2.  * tclMacMath.h --
  3.  *
  4.  *    This file is necessary because of Metrowerks CodeWarrior Pro 1
  5.  *    on the Macintosh. With 8-byte doubles turned on, the definitions of
  6.  *    sin, cos, acos, etc., are screwed up.  They are fine as long as
  7.  *    they are used as function calls, but if the function pointers
  8.  *    are passed around and used, they will crash hard on the 68K.
  9.  *
  10.  * Copyright (c) 1997 Sun Microsystems, Inc.
  11.  *
  12.  * See the file "license.terms" for information on usage and redistribution
  13.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  14.  *
  15.  * SCCS: @(#) tclMacMath.h 1.2 97/07/28 11:04:02
  16.  */
  17.  
  18. #ifndef _TCLMACMATH
  19. #define _TCLMACMATH
  20.  
  21. #include <math.h>
  22.  
  23. #if defined(__MWERKS__) && !defined(__POWERPC__)
  24. #if __option(IEEEdoubles)
  25.  
  26. #   ifdef cos
  27. #    undef cos
  28. #    define cos cosd
  29. #   endif
  30.  
  31. #   ifdef sin
  32. #    undef sin
  33. #    define sin sind
  34. #   endif
  35.  
  36. #   ifdef tan
  37. #    undef tan
  38. #    define tan tand
  39. #   endif
  40.  
  41. #   ifdef acos
  42. #    undef acos
  43. #    define acos acosd
  44. #   endif
  45.  
  46. #   ifdef asin
  47. #    undef asin
  48. #    define asin asind
  49. #   endif
  50.  
  51. #   ifdef atan
  52. #    undef atan
  53. #    define atan atand
  54. #   endif
  55.  
  56. #   ifdef cosh
  57. #    undef cosh
  58. #    define cosh coshd
  59. #   endif
  60.  
  61. #   ifdef sinh
  62. #    undef sinh
  63. #    define sinh sinhd
  64. #   endif
  65.  
  66. #   ifdef tanh
  67. #    undef tanh
  68. #    define tanh tanhd
  69. #   endif
  70.  
  71. #   ifdef exp
  72. #    undef exp
  73. #    define exp expd
  74. #   endif
  75.  
  76. #   ifdef ldexp
  77. #    undef ldexp
  78. #    define ldexp ldexpd
  79. #   endif
  80.  
  81. #   ifdef log
  82. #    undef log
  83. #    define log logd
  84. #   endif
  85.  
  86. #   ifdef log10
  87. #    undef log10
  88. #    define log10 log10d
  89. #   endif
  90.  
  91. #   ifdef fabs
  92. #    undef fabs
  93. #    define fabs fabsd
  94. #   endif
  95.  
  96. #   ifdef sqrt
  97. #    undef sqrt
  98. #    define sqrt sqrtd
  99. #   endif
  100.  
  101. #   ifdef fmod
  102. #    undef fmod
  103. #    define fmod fmodd
  104. #   endif
  105.  
  106. #   ifdef atan2
  107. #    undef atan2
  108. #    define atan2 atan2d
  109. #   endif
  110.  
  111. #   ifdef frexp
  112. #    undef frexp
  113. #    define frexp frexpd
  114. #   endif
  115.  
  116. #   ifdef modf
  117. #    undef modf
  118. #    define modf modfd
  119. #   endif
  120.  
  121. #   ifdef pow
  122. #    undef pow
  123. #    define pow powd
  124. #   endif
  125.  
  126. #   ifdef ceil
  127. #    undef ceil
  128. #    define ceil ceild
  129. #   endif
  130.  
  131. #   ifdef floor
  132. #    undef floor
  133. #    define floor floord
  134. #   endif
  135. #endif
  136. #endif
  137.  
  138. #if (defined(THINK_C) || defined(__MWERKS__))
  139. #pragma export on
  140. double        hypotd(double x, double y);
  141. #define hypot hypotd
  142. #pragma export reset
  143. #endif
  144.  
  145. #endif /* _TCLMACMATH */
  146.