diff Include/Python.h @ 13674:c90d94d287d7 legacy-trunk

Included assert.h in Python.h -- it's absurd that this basic tool of good C practice hasn't been available to everything all along. Added Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) macro to pyport.h; this just casts VALUE from type WIDE to type NARROW, but assert-fails if Py_DEBUG is defined and info is lost due to casting. Replaced a line in Fredrik's fix to marshal.c to use the new macro.
author Tim Peters <tim.peters@gmail.com>
date Sun, 23 Jul 2000 19:28:35 +0000
parents ffd5e8b67c84
children 59f8cedcf049
line wrap: on
line diff
--- a/Include/Python.h	Sun Jul 23 18:33:52 2000 +0000
+++ b/Include/Python.h	Sun Jul 23 19:28:35 2000 +0000
@@ -31,7 +31,6 @@
 
 #include "patchlevel.h"
 #include "config.h"
-#include "pyport.h"
 
 /* config.h may or may not define DL_IMPORT */
 #ifndef DL_IMPORT	/* declarations for DLL import/export */
@@ -51,6 +50,9 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#include <assert.h>
+
+#include "pyport.h"
 
 #include "myproto.h"