]> granicus.if.org Git - python/commitdiff
#include reordering so that extern "C" does not interfere with
authorVladimir Marangozov <vladimir.marangozov@t-online.de>
Fri, 11 Aug 2000 11:48:33 +0000 (11:48 +0000)
committerVladimir Marangozov <vladimir.marangozov@t-online.de>
Fri, 11 Aug 2000 11:48:33 +0000 (11:48 +0000)
standard C++ specific includes.

Closes patch 101061.

Include/pyport.h

index 8cbc821a0184f35bbc1ec0202566a120ea5e8e12..3d9b305d914a2f48fab0117bf7b0606e915186e8 100644 (file)
@@ -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