author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
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 * RCS: @(#) $Id: tclMacMath.h,v 1.3 2001/11/23 01:27:50 das Exp $
16 */
18 #ifndef _TCLMACMATH
19 #define _TCLMACMATH
21 #include <math.h>
23 #if defined(__MWERKS__) && !defined(__POWERPC__)
24 #if __option(IEEEdoubles)
26 # ifdef cos
27 # undef cos
28 # define cos cosd
29 # endif
31 # ifdef sin
32 # undef sin
33 # define sin sind
34 # endif
36 # ifdef tan
37 # undef tan
38 # define tan tand
39 # endif
41 # ifdef acos
42 # undef acos
43 # define acos acosd
44 # endif
46 # ifdef asin
47 # undef asin
48 # define asin asind
49 # endif
51 # ifdef atan
52 # undef atan
53 # define atan atand
54 # endif
56 # ifdef cosh
57 # undef cosh
58 # define cosh coshd
59 # endif
61 # ifdef sinh
62 # undef sinh
63 # define sinh sinhd
64 # endif
66 # ifdef tanh
67 # undef tanh
68 # define tanh tanhd
69 # endif
71 # ifdef exp
72 # undef exp
73 # define exp expd
74 # endif
76 # ifdef ldexp
77 # undef ldexp
78 # define ldexp ldexpd
79 # endif
81 # ifdef log
82 # undef log
83 # define log logd
84 # endif
86 # ifdef log10
87 # undef log10
88 # define log10 log10d
89 # endif
91 # ifdef fabs
92 # undef fabs
93 # define fabs fabsd
94 # endif
96 # ifdef sqrt
97 # undef sqrt
98 # define sqrt sqrtd
99 # endif
101 # ifdef fmod
102 # undef fmod
103 # define fmod fmodd
104 # endif
106 # ifdef atan2
107 # undef atan2
108 # define atan2 atan2d
109 # endif
111 # ifdef frexp
112 # undef frexp
113 # define frexp frexpd
114 # endif
116 # ifdef modf
117 # undef modf
118 # define modf modfd
119 # endif
121 # ifdef pow
122 # undef pow
123 # define pow powd
124 # endif
126 # ifdef ceil
127 # undef ceil
128 # define ceil ceild
129 # endif
131 # ifdef floor
132 # undef floor
133 # define floor floord
134 # endif
135 #endif
136 #endif
138 #if (defined(THINK_C))
139 #pragma export on
140 double hypotd(double x, double y);
141 #define hypot hypotd
142 #pragma export reset
143 #endif
145 #endif /* _TCLMACMATH */