summaryrefslogtreecommitdiffstats
path: root/Include/pyport.h
diff options
context:
space:
mode:
authorVladimir Marangozov <vladimir.marangozov@t-online.de>2000-08-11 11:48:33 (GMT)
committerVladimir Marangozov <vladimir.marangozov@t-online.de>2000-08-11 11:48:33 (GMT)
commit2c57e076fe7653e38fb0a52679bb3ac219793143 (patch)
treef450b585b252b1a8734304f517dce9201f1e2174 /Include/pyport.h
parent1a731c60a3e70a2516eebc32b8988eab996bbc88 (diff)
downloadcpython-2c57e076fe7653e38fb0a52679bb3ac219793143.zip
cpython-2c57e076fe7653e38fb0a52679bb3ac219793143.tar.gz
cpython-2c57e076fe7653e38fb0a52679bb3ac219793143.tar.bz2
#include reordering so that extern "C" does not interfere with
standard C++ specific includes. Closes patch 101061.
Diffstat (limited to 'Include/pyport.h')
-rw-r--r--Include/pyport.h78
1 files 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 <stdlib.h>
#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
/* 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 <math.h>
-
#ifndef HAVE_HYPOT
#ifdef __MWERKS__
#undef hypot
@@ -241,41 +277,6 @@ extern double hypot(double, double);
#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,
here is a set that should do the job */
@@ -307,6 +308,7 @@ typedef struct fd_set {
#endif /* fd manipulation macros */
+
#ifdef __cplusplus
}
#endif