Guido van Rossum | 0acd4b6 | 1995-02-18 14:50:12 +0000 | [diff] [blame] | 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 | |
Guido van Rossum | 50cc04e | 1998-04-28 16:02:29 +0000 | [diff] [blame] | 8 | #ifndef HAVE_HYPOT |
Tim Peters | dbd9ba6 | 2000-07-09 03:09:57 +0000 | [diff] [blame] | 9 | extern double hypot(double, double); |
Guido van Rossum | 446fd04 | 1998-11-02 16:21:39 +0000 | [diff] [blame] | 10 | #ifdef MWERKS_BEFORE_PRO4 |
Guido van Rossum | 50cc04e | 1998-04-28 16:02:29 +0000 | [diff] [blame] | 11 | #define hypot we_dont_want_faulty_hypot_decl |
| 12 | #endif |
| 13 | #endif |
| 14 | |
Guido van Rossum | 0acd4b6 | 1995-02-18 14:50:12 +0000 | [diff] [blame] | 15 | #include <math.h> |
| 16 | |
Guido van Rossum | 50cc04e | 1998-04-28 16:02:29 +0000 | [diff] [blame] | 17 | #ifndef HAVE_HYPOT |
| 18 | #ifdef __MWERKS__ |
| 19 | #undef hypot |
| 20 | #endif |
| 21 | #endif |
| 22 | |
Guido van Rossum | c23ef0a | 1997-05-20 15:58:15 +0000 | [diff] [blame] | 23 | #if defined(USE_MSL) && defined(__MC68K__) |
| 24 | /* CodeWarrior MSL 2.1.1 has weird define overrides that don't work |
| 25 | ** when you take the address of math functions. If I interpret the |
| 26 | ** ANSI C standard correctly this is illegal, but I haven't been able |
| 27 | ** to convince the MetroWerks folks of this... |
| 28 | */ |
| 29 | #undef acos |
| 30 | #undef asin |
| 31 | #undef atan |
| 32 | #undef atan2 |
| 33 | #undef ceil |
| 34 | #undef cos |
| 35 | #undef cosh |
| 36 | #undef exp |
| 37 | #undef fabs |
| 38 | #undef floor |
| 39 | #undef fmod |
| 40 | #undef log |
| 41 | #undef log10 |
| 42 | #undef pow |
Guido van Rossum | 71260b8 | 2000-05-11 18:19:42 +0000 | [diff] [blame] | 43 | #undef rint |
Guido van Rossum | c23ef0a | 1997-05-20 15:58:15 +0000 | [diff] [blame] | 44 | #undef sin |
| 45 | #undef sinh |
| 46 | #undef sqrt |
| 47 | #undef tan |
| 48 | #undef tanh |
| 49 | #define acos acosd |
| 50 | #define asin asind |
| 51 | #define atan atand |
| 52 | #define atan2 atan2d |
| 53 | #define ceil ceild |
| 54 | #define cos cosd |
| 55 | #define cosh coshd |
| 56 | #define exp expd |
| 57 | #define fabs fabsd |
| 58 | #define floor floord |
| 59 | #define fmod fmodd |
| 60 | #define log logd |
| 61 | #define log10 log10d |
| 62 | #define pow powd |
Guido van Rossum | 71260b8 | 2000-05-11 18:19:42 +0000 | [diff] [blame] | 63 | #define rint rintd |
Guido van Rossum | c23ef0a | 1997-05-20 15:58:15 +0000 | [diff] [blame] | 64 | #define sin sind |
| 65 | #define sinh sinhd |
| 66 | #define sqrt sqrtd |
| 67 | #define tan tand |
| 68 | #define tanh tanhd |
| 69 | #endif |