]> granicus.if.org Git - python/commitdiff
Patch #555929: Cygwin AH_BOTTOM cleanup patch (*** version 2 ***)
authorJason Tishler <jason@tishler.net>
Tue, 4 Jun 2002 15:07:08 +0000 (15:07 +0000)
committerJason Tishler <jason@tishler.net>
Tue, 4 Jun 2002 15:07:08 +0000 (15:07 +0000)
This patch complies with the following request found
near the top of configure.in:

# This is for stuff that absolutely must end up in pyconfig.h.
# Please use pyport.h instead, if possible.

I tested this patch under Cygwin, Win32, and Red
Hat Linux. Python built and ran successfully on
each of these platforms.

Include/Python.h
Include/pyport.h
configure
configure.in
pyconfig.h.in

index b978de2e9672f4b4b98dc8b7f83072497df69e54..3f0fd9b1f0dd68d0356e6c2c76518ffd42ef79b1 100644 (file)
 #include <limits.h>
 #endif
 
-/* pyconfig.h may or may not define DL_IMPORT */
-#ifndef DL_IMPORT      /* declarations for DLL import/export */
-#define DL_IMPORT(RTYPE) RTYPE
-#endif
-#ifndef DL_EXPORT      /* declarations for DLL import/export */
-#define DL_EXPORT(RTYPE) RTYPE
-#endif
-
 #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
 #define _SGI_MP_SOURCE
 #endif
 
 #include "pyport.h"
 
+/* pyconfig.h or pyport.h may or may not define DL_IMPORT */
+#ifndef DL_IMPORT      /* declarations for DLL import/export */
+#define DL_IMPORT(RTYPE) RTYPE
+#endif
+#ifndef DL_EXPORT      /* declarations for DLL import/export */
+#define DL_EXPORT(RTYPE) RTYPE
+#endif
+
 /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
  *  PYMALLOC_DEBUG is in error if pymalloc is not in use.
  */
index 790c7afa59c5a1276b4fa21288ff7ca51ad7a3aa..5c3e0a947f1f2d9df7f2cb0db05ff55adee2023b 100644 (file)
@@ -384,9 +384,19 @@ extern int fsync(int fd);
 extern double hypot(double, double);
 #endif
 
+#ifndef __CYGWIN__
 #ifndef DL_IMPORT       /* declarations for DLL import */
 #define DL_IMPORT(RTYPE) RTYPE
 #endif
+#else /* __CYGWIN__ */
+#ifdef USE_DL_IMPORT
+#define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
+#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
+#else /* !USE_DL_IMPORT */
+#define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
+#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
+#endif /* USE_DL_IMPORT */
+#endif /* __CYGWIN__ */
 
 /* If the fd manipulation macros aren't defined,
    here is a set that should do the job */
index 28a58348aa92c3f503b67b1805d0e0706a669abb..affb7c39766dfa389f4b91c4a2e33ff3f1021845 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.318 .
+# From configure.in Revision: 1.319 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.53.
 #
index 1003761a1520912787df0b4bb7e10de15cd02ae1..ffdc279412a59c81724561876d9be9ee3881419d 100644 (file)
@@ -7,16 +7,6 @@ AC_CONFIG_HEADER(pyconfig.h)
 # This is for stuff that absolutely must end up in pyconfig.h.
 # Please use pyport.h instead, if possible.
 AH_BOTTOM([
-#ifdef __CYGWIN__
-#ifdef USE_DL_IMPORT
-#define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
-#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
-#else
-#define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
-#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
-#endif
-#endif
-
 /* Define the macros needed if on a UnixWare 7.x system. */
 #if defined(__USLC__) && defined(__SCO_VERSION__)
 #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
index c8fa5afd676f78682cc530528d40639b0022e9fc..bf616d433e95eccbd435c869356a7a9ff7efa766 100644 (file)
 #undef volatile
 
 
-#ifdef __CYGWIN__
-#ifdef USE_DL_IMPORT
-#define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
-#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
-#else
-#define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
-#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
-#endif
-#endif
-
 /* Define the macros needed if on a UnixWare 7.x system. */
 #if defined(__USLC__) && defined(__SCO_VERSION__)
 #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */