comparison Python/pythonrun.c @ 24155:9456a2ccda61 legacy-trunk

The Py_REF_DEBUG/COUNT_ALLOCS/Py_TRACE_REFS macro minefield: added more trivial lexical helper macros so that uses of these guys expand to nothing at all when they're not enabled. This should help sub- standard compilers that can't do a good job of optimizing away the previous "(void)0" expressions. Py_DECREF: There's only one definition of this now. Yay! That was that last one in the family defined multiple times in an #ifdef maze. Py_FatalError(): Changed the char* signature to const char*. _Py_NegativeRefcount(): New helper function for the Py_REF_DEBUG expansion of Py_DECREF. Calling an external function cuts down on the volume of generated code. The previous inline expansion of abort() didn't work as intended on Windows (the program often kept going, and the error msg scrolled off the screen unseen). _Py_NegativeRefcount calls Py_FatalError instead, which captures our best knowledge of how to abort effectively across platforms.
author Tim Peters <tim.peters@gmail.com>
date Tue, 09 Jul 2002 02:57:01 +0000
parents 8142f8d668a0
children cb728141ae12
comparison
equal deleted inserted replaced
24154:208fb1d61148 24155:9456a2ccda61
1264 } 1264 }
1265 1265
1266 /* Print fatal error message and abort */ 1266 /* Print fatal error message and abort */
1267 1267
1268 void 1268 void
1269 Py_FatalError(char *msg) 1269 Py_FatalError(const char *msg)
1270 { 1270 {
1271 fprintf(stderr, "Fatal Python error: %s\n", msg); 1271 fprintf(stderr, "Fatal Python error: %s\n", msg);
1272 #ifdef macintosh 1272 #ifdef macintosh
1273 for (;;); 1273 for (;;);
1274 #endif 1274 #endif