From 8315ea579046727bb234dc4692ca28c8514eacbe Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sun, 23 Jul 2000 19:28:35 +0000 Subject: 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. --- Include/Python.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Include/Python.h') diff --git a/Include/Python.h b/Include/Python.h index 3cea5914d3..8ba466fe42 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -31,7 +31,6 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. #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 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. #ifdef HAVE_STDLIB_H #include #endif +#include + +#include "pyport.h" #include "myproto.h" -- cgit v1.2.1