From 2c57e076fe7653e38fb0a52679bb3ac219793143 Mon Sep 17 00:00:00 2001 From: Vladimir Marangozov Date: Fri, 11 Aug 2000 11:48:33 +0000 Subject: #include reordering so that extern "C" does not interfere with standard C++ specific includes. Closes patch 101061. --- Include/pyport.h | 78 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/Include/pyport.h b/Include/pyport.h index 8cbc821..3d9b305 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -37,12 +37,51 @@ Used in: Py_SAFE_DOWNCAST #include #endif +#include /* Moved here from the math section, before extern "C" */ + +/******************************************** + * WRAPPER FOR and/or * + ********************************************/ + +#ifdef TIME_WITH_SYS_TIME +#include +#include +#else /* !TIME_WITH_SYS_TIME */ +#ifdef HAVE_SYS_TIME_H +#include +#else /* !HAVE_SYS_TIME_H */ +#include +#endif /* !HAVE_SYS_TIME_H */ +#endif /* !TIME_WITH_SYS_TIME */ + + +/****************************** + * WRAPPER FOR * + ******************************/ + +/* NB caller must include */ + +#ifdef HAVE_SYS_SELECT_H + +#include + +#else /* !HAVE_SYS_SELECT_H */ + +#ifdef USE_GUSI1 +/* If we don't have sys/select the definition may be in unistd.h */ +#include +#endif + +#endif /* !HAVE_SYS_SELECT_H */ + + #ifdef __cplusplus /* Move this down here since some C++ #include's don't like to be included inside an extern "C" */ extern "C" { #endif + /* Py_ARITHMETIC_RIGHT_SHIFT * C doesn't define whether a right-shift of a signed integer sign-extends * or zero-fills. Here a macro to force sign extension: @@ -85,7 +124,6 @@ extern "C" { #endif - /************************************************************************** Prototypes that are missing from the standard include files on some systems (and possibly only some versions of such systems.) @@ -165,8 +203,6 @@ extern double hypot(double, double); #endif #endif -#include - #ifndef HAVE_HYPOT #ifdef __MWERKS__ #undef hypot @@ -241,41 +277,6 @@ extern double hypot(double, double); #endif -/******************************************** - * WRAPPER FOR and/or * - ********************************************/ - -#ifdef TIME_WITH_SYS_TIME -#include -#include -#else /* !TIME_WITH_SYS_TIME */ -#ifdef HAVE_SYS_TIME_H -#include -#else /* !HAVE_SYS_TIME_H */ -#include -#endif /* !HAVE_SYS_TIME_H */ -#endif /* !TIME_WITH_SYS_TIME */ - - -/****************************** - * WRAPPER FOR * - ******************************/ - -/* NB caller must include */ - -#ifdef HAVE_SYS_SELECT_H - -#include - -#else /* !HAVE_SYS_SELECT_H */ - -#ifdef USE_GUSI1 -/* If we don't have sys/select the definition may be in unistd.h */ -#include -#endif - -#endif /* !HAVE_SYS_SELECT_H */ - /* If the fd manipulation macros aren't defined, here is a set that should do the job */ @@ -307,6 +308,7 @@ typedef struct fd_set { #endif /* fd manipulation macros */ + #ifdef __cplusplus } #endif -- cgit v0.12