Kaydet (Commit) 2c57e076 authored tarafından Vladimir Marangozov's avatar Vladimir Marangozov

#include reordering so that extern "C" does not interfere with

standard C++ specific includes.

Closes patch 101061.
üst 1a731c60
...@@ -37,12 +37,51 @@ Used in: Py_SAFE_DOWNCAST ...@@ -37,12 +37,51 @@ Used in: Py_SAFE_DOWNCAST
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#include <math.h> /* Moved here from the math section, before extern "C" */
/********************************************
* WRAPPER FOR <time.h> and/or <sys/time.h> *
********************************************/
#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else /* !TIME_WITH_SYS_TIME */
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else /* !HAVE_SYS_TIME_H */
#include <time.h>
#endif /* !HAVE_SYS_TIME_H */
#endif /* !TIME_WITH_SYS_TIME */
/******************************
* WRAPPER FOR <sys/select.h> *
******************************/
/* NB caller must include <sys/types.h> */
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#else /* !HAVE_SYS_SELECT_H */
#ifdef USE_GUSI1
/* If we don't have sys/select the definition may be in unistd.h */
#include <GUSI.h>
#endif
#endif /* !HAVE_SYS_SELECT_H */
#ifdef __cplusplus #ifdef __cplusplus
/* Move this down here since some C++ #include's don't like to be included /* Move this down here since some C++ #include's don't like to be included
inside an extern "C" */ inside an extern "C" */
extern "C" { extern "C" {
#endif #endif
/* Py_ARITHMETIC_RIGHT_SHIFT /* Py_ARITHMETIC_RIGHT_SHIFT
* C doesn't define whether a right-shift of a signed integer sign-extends * C doesn't define whether a right-shift of a signed integer sign-extends
* or zero-fills. Here a macro to force sign extension: * or zero-fills. Here a macro to force sign extension:
...@@ -85,7 +124,6 @@ extern "C" { ...@@ -85,7 +124,6 @@ extern "C" {
#endif #endif
/************************************************************************** /**************************************************************************
Prototypes that are missing from the standard include files on some systems Prototypes that are missing from the standard include files on some systems
(and possibly only some versions of such systems.) (and possibly only some versions of such systems.)
...@@ -165,8 +203,6 @@ extern double hypot(double, double); ...@@ -165,8 +203,6 @@ extern double hypot(double, double);
#endif #endif
#endif #endif
#include <math.h>
#ifndef HAVE_HYPOT #ifndef HAVE_HYPOT
#ifdef __MWERKS__ #ifdef __MWERKS__
#undef hypot #undef hypot
...@@ -241,41 +277,6 @@ extern double hypot(double, double); ...@@ -241,41 +277,6 @@ extern double hypot(double, double);
#endif #endif
/********************************************
* WRAPPER FOR <time.h> and/or <sys/time.h> *
********************************************/
#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else /* !TIME_WITH_SYS_TIME */
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else /* !HAVE_SYS_TIME_H */
#include <time.h>
#endif /* !HAVE_SYS_TIME_H */
#endif /* !TIME_WITH_SYS_TIME */
/******************************
* WRAPPER FOR <sys/select.h> *
******************************/
/* NB caller must include <sys/types.h> */
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#else /* !HAVE_SYS_SELECT_H */
#ifdef USE_GUSI1
/* If we don't have sys/select the definition may be in unistd.h */
#include <GUSI.h>
#endif
#endif /* !HAVE_SYS_SELECT_H */
/* If the fd manipulation macros aren't defined, /* If the fd manipulation macros aren't defined,
here is a set that should do the job */ here is a set that should do the job */
...@@ -307,6 +308,7 @@ typedef struct fd_set { ...@@ -307,6 +308,7 @@ typedef struct fd_set {
#endif /* fd manipulation macros */ #endif /* fd manipulation macros */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment