Guido van Rossum | 4c04be6 | 1997-07-19 19:25:33 +0000 | [diff] [blame] | 1 | /* Minimal main program -- everything is loaded from the library */ |
| 2 | |
Guido van Rossum | be10c20 | 1998-08-08 20:01:22 +0000 | [diff] [blame] | 3 | #include "Python.h" |
| 4 | |
Tim Peters | 4643bd9 | 2002-12-28 21:56:08 +0000 | [diff] [blame] | 5 | #ifdef __FreeBSD__ |
| 6 | #include <floatingpoint.h> |
| 7 | #endif |
| 8 | |
Guido van Rossum | 7c14103 | 1997-08-15 02:52:08 +0000 | [diff] [blame] | 9 | int |
Fredrik Lundh | faa209d6 | 2000-07-09 20:35:15 +0000 | [diff] [blame] | 10 | main(int argc, char **argv) |
Guido van Rossum | 4c04be6 | 1997-07-19 19:25:33 +0000 | [diff] [blame] | 11 | { |
Tim Peters | 4643bd9 | 2002-12-28 21:56:08 +0000 | [diff] [blame] | 12 | /* 754 requires that FP exceptions run in "no stop" mode by default, |
| 13 | * and until C vendors implement C99's ways to control FP exceptions, |
| 14 | * Python requires non-stop mode. Alas, some platforms enable FP |
| 15 | * exceptions by default. Here we disable them. |
| 16 | */ |
| 17 | #ifdef __FreeBSD__ |
| 18 | fp_except_t m; |
| 19 | |
| 20 | m = fpgetmask(); |
| 21 | fpsetmask(m & ~FP_X_OFL); |
| 22 | #endif |
Guido van Rossum | 4c04be6 | 1997-07-19 19:25:33 +0000 | [diff] [blame] | 23 | return Py_Main(argc, argv); |
| 24 | } |