Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc48826

Browse files
committed
Patch #555929: Cygwin AH_BOTTOM cleanup patch (*** version 2 ***)
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.
1 parent 1bdd9b0 commit bc48826

5 files changed

Lines changed: 19 additions & 29 deletions

File tree

Include/Python.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@
2727
#include <limits.h>
2828
#endif
2929

30-
/* pyconfig.h may or may not define DL_IMPORT */
31-
#ifndef DL_IMPORT /* declarations for DLL import/export */
32-
#define DL_IMPORT(RTYPE) RTYPE
33-
#endif
34-
#ifndef DL_EXPORT /* declarations for DLL import/export */
35-
#define DL_EXPORT(RTYPE) RTYPE
36-
#endif
37-
3830
#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
3931
#define _SGI_MP_SOURCE
4032
#endif
@@ -61,6 +53,14 @@
6153

6254
#include "pyport.h"
6355

56+
/* pyconfig.h or pyport.h may or may not define DL_IMPORT */
57+
#ifndef DL_IMPORT /* declarations for DLL import/export */
58+
#define DL_IMPORT(RTYPE) RTYPE
59+
#endif
60+
#ifndef DL_EXPORT /* declarations for DLL import/export */
61+
#define DL_EXPORT(RTYPE) RTYPE
62+
#endif
63+
6464
/* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
6565
* PYMALLOC_DEBUG is in error if pymalloc is not in use.
6666
*/

Include/pyport.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,19 @@ extern int fsync(int fd);
384384
extern double hypot(double, double);
385385
#endif
386386

387+
#ifndef __CYGWIN__
387388
#ifndef DL_IMPORT /* declarations for DLL import */
388389
#define DL_IMPORT(RTYPE) RTYPE
389390
#endif
391+
#else /* __CYGWIN__ */
392+
#ifdef USE_DL_IMPORT
393+
#define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
394+
#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
395+
#else /* !USE_DL_IMPORT */
396+
#define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
397+
#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
398+
#endif /* USE_DL_IMPORT */
399+
#endif /* __CYGWIN__ */
390400

391401
/* If the fd manipulation macros aren't defined,
392402
here is a set that should do the job */

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 1.318 .
2+
# From configure.in Revision: 1.319 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.53.
55
#

configure.in

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@ AC_CONFIG_HEADER(pyconfig.h)
77
# This is for stuff that absolutely must end up in pyconfig.h.
88
# Please use pyport.h instead, if possible.
99
AH_BOTTOM([
10-
#ifdef __CYGWIN__
11-
#ifdef USE_DL_IMPORT
12-
#define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
13-
#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
14-
#else
15-
#define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
16-
#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
17-
#endif
18-
#endif
19-
2010
/* Define the macros needed if on a UnixWare 7.x system. */
2111
#if defined(__USLC__) && defined(__SCO_VERSION__)
2212
#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */

pyconfig.h.in

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -828,16 +828,6 @@
828828
#undef volatile
829829

830830

831-
#ifdef __CYGWIN__
832-
#ifdef USE_DL_IMPORT
833-
#define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
834-
#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
835-
#else
836-
#define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
837-
#define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
838-
#endif
839-
#endif
840-
841831
/* Define the macros needed if on a UnixWare 7.x system. */
842832
#if defined(__USLC__) && defined(__SCO_VERSION__)
843833
#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */

0 commit comments

Comments
 (0)