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

Skip to content

Commit eadb6bb

Browse files
committed
Patch #555929: Cygwin AH_BOTTOM cleanup patch
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 5cc21ae commit eadb6bb

5 files changed

Lines changed: 13 additions & 24 deletions

File tree

Include/Python.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@
2222

2323
#include "patchlevel.h"
2424
#include "pyconfig.h"
25+
#include "pyport.h"
2526

2627
#ifdef HAVE_LIMITS_H
2728
#include <limits.h>
2829
#endif
2930

30-
/* pyconfig.h may or may not define DL_IMPORT */
31+
/* pyconfig.h or pyport.h may or may not define DL_IMPORT */
3132
#ifndef DL_IMPORT /* declarations for DLL import/export */
3233
#define DL_IMPORT(RTYPE) RTYPE
3334
#endif
@@ -59,8 +60,6 @@
5960
*/
6061
#include <assert.h>
6162

62-
#include "pyport.h"
63-
6463
/* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
6564
* PYMALLOC_DEBUG is in error if pymalloc is not in use.
6665
*/

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.314 .
2+
# From configure.in Revision: 1.315 .
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
@@ -825,16 +825,6 @@
825825
#undef volatile
826826

827827

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

0 commit comments

Comments
 (0)