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

Skip to content

Commit 4c3f57c

Browse files
committed
SF Patch #103154 by jlt63: Cygwin Check Import Case Patch.
Note: I've reordered acconfig.h and config.h.in to obtain alphabetical order (modulo case and leading _).
1 parent f61f166 commit 4c3f57c

5 files changed

Lines changed: 505 additions & 453 deletions

File tree

Python/import.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ find_module(char *realname, PyObject *path, char *buf, size_t buflen,
10101010

10111011
#ifdef CHECK_IMPORT_CASE
10121012

1013-
#ifdef MS_WIN32
1013+
#if defined(MS_WIN32) || defined(__CYGWIN__)
10141014
#include <windows.h>
10151015
#include <ctype.h>
10161016

@@ -1039,14 +1039,26 @@ allcaps8x3(char *s)
10391039
return 1;
10401040
}
10411041

1042+
#ifdef __CYGWIN__
1043+
#include <sys/cygwin.h>
1044+
#endif
1045+
10421046
static int
10431047
check_case(char *buf, int len, int namelen, char *name)
10441048
{
10451049
WIN32_FIND_DATA data;
10461050
HANDLE h;
1051+
#ifdef __CYGWIN__
1052+
char tempbuf[MAX_PATH];
1053+
#endif
10471054
if (getenv("PYTHONCASEOK") != NULL)
10481055
return 1;
1056+
#ifdef __CYGWIN__
1057+
cygwin32_conv_to_win32_path(buf, tempbuf);
1058+
h = FindFirstFile(tempbuf, &data);
1059+
#else
10491060
h = FindFirstFile(buf, &data);
1061+
#endif
10501062
if (h == INVALID_HANDLE_VALUE) {
10511063
PyErr_Format(PyExc_NameError,
10521064
"Can't find file for module %.100s\n(filename %.300s)",

acconfig.h

Lines changed: 59 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/* Leave this blank line here -- autoheader needs it! */
22

33

4+
/* Define for AIX if your compiler is a genuine IBM xlC/xlC_r
5+
and you want support for AIX C++ shared extension modules. */
6+
#undef AIX_GENUINE_CPLUSPLUS
7+
48
/* Define if your <unistd.h> contains bad prototypes for exec*()
59
(as it does on SGI IRIX 4.x) */
610
#undef BAD_EXEC_PROTOTYPES
@@ -9,16 +13,15 @@
913
(as it does on SCI ODT 3.0) */
1014
#undef BAD_STATIC_FORWARD
1115

12-
/* Define for AIX if your compiler is a genuine IBM xlC/xlC_r
13-
and you want support for AIX C++ shared extension modules. */
14-
#undef AIX_GENUINE_CPLUSPLUS
15-
1616
/* Define this if you have BeOS threads */
1717
#undef BEOS_THREADS
1818

1919
/* Define if you have the Mach cthreads package */
2020
#undef C_THREADS
2121

22+
/* Defined when case of imported modules are checked against case of file. */
23+
#undef CHECK_IMPORT_CASE
24+
2225
/* Define to `long' if <time.h> doesn't define. */
2326
#undef clock_t
2427

@@ -32,6 +35,9 @@
3235
/* Define this if your time.h defines altzone */
3336
#undef HAVE_ALTZONE
3437

38+
/* Defined when any dynamic module loading is enabled */
39+
#undef HAVE_DYNAMIC_LOADING
40+
3541
/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
3642
#undef HAVE_GETC_UNLOCKED
3743

@@ -50,12 +56,18 @@
5056
/* Define this if you have the 6-arg version of gethostbyname_r() */
5157
#undef HAVE_GETHOSTBYNAME_R_6_ARG
5258

59+
/* Defined to enable large file support when an off_t is bigger than a long
60+
and long long is available and at least as big as an off_t. You may need
61+
to add some flags for configuration and compilation to enable this mode.
62+
E.g, for Solaris 2.7:
63+
CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" OPT="-O2 $CFLAGS" \
64+
configure
65+
*/
66+
#undef HAVE_LARGEFILE_SUPPORT
67+
5368
/* Define this if you have the type long long */
5469
#undef HAVE_LONG_LONG
5570

56-
/* Define this if you have the type uintptr_t */
57-
#undef HAVE_UINTPTR_T
58-
5971
/* Define if your compiler supports function prototypes */
6072
#undef HAVE_PROTOTYPES
6173

@@ -66,12 +78,26 @@
6678
(e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h> */
6779
#undef HAVE_STDARG_PROTOTYPES
6880

81+
/* Define this if you have the type uintptr_t */
82+
#undef HAVE_UINTPTR_T
83+
84+
/* Define if you have a useable wchar_t type defined in wchar.h; useable
85+
means wchar_t must be 16-bit unsigned type. (see
86+
Include/unicodeobject.h). */
87+
#undef HAVE_USABLE_WCHAR_T
88+
89+
/* Define if the compiler provides a wchar.h header file. */
90+
#undef HAVE_WCHAR_H
91+
6992
/* Define if malloc(0) returns a NULL pointer */
7093
#undef MALLOC_ZERO_RETURNS_NULL
7194

7295
/* Define if you have POSIX threads */
7396
#undef _POSIX_THREADS
7497

98+
/* Define if you want to build an interpreter with many run-time checks */
99+
#undef Py_DEBUG
100+
75101
/* Define to force use of thread-safe errno, h_errno, and other functions */
76102
#undef _REENTRANT
77103

@@ -81,6 +107,20 @@
81107
/* Define to empty if the keyword does not work. */
82108
#undef signed
83109

110+
/* Define if i>>j for signed int i does not extend the sign bit
111+
when i < 0
112+
*/
113+
#undef SIGNED_RIGHT_SHIFT_ZERO_FILLS
114+
115+
/* The number of bytes in an off_t. */
116+
#undef SIZEOF_OFF_T
117+
118+
/* The number of bytes in a time_t. */
119+
#undef SIZEOF_TIME_T
120+
121+
/* The number of bytes in a pthread_t. */
122+
#undef SIZEOF_PTHREAD_T
123+
84124
/* sizeof(void *) */
85125
#undef SIZEOF_VOID_P
86126

@@ -103,24 +143,12 @@
103143
/* Define if you want SIGFPE handled (see Include/pyfpe.h). */
104144
#undef WANT_SIGFPE_HANDLER
105145

106-
/* Define if the compiler provides a wchar.h header file. */
107-
#undef HAVE_WCHAR_H
108-
109-
/* Define if you have a useable wchar_t type defined in wchar.h; useable
110-
means wchar_t must be 16-bit unsigned type. (see
111-
Include/unicodeobject.h). */
112-
#undef HAVE_USABLE_WCHAR_T
113-
114146
/* Define if you want wctype.h functions to be used instead of the
115147
one supplied by Python itself. (see Include/unicodectype.h). */
116148
#undef WANT_WCTYPE_FUNCTIONS
117149

118-
/* Define if you want to use SGI (IRIX 4) dynamic linking.
119-
This requires the "dl" library by Jack Jansen,
120-
ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
121-
Don't bother on IRIX 5, it already has dynamic linking using SunOS
122-
style shared libraries */
123-
#undef WITH_SGI_DL
150+
/* Define if you want to compile in cycle garbage collection */
151+
#undef WITH_CYCLE_GC
124152

125153
/* Define if you want to emulate SGI (IRIX 4) dynamic linking.
126154
This is rumoured to work on VAX (Ultrix), Sun3 (SunOS 3.4),
@@ -138,47 +166,22 @@
138166
linker (rld). Dyld is necessary to support frameworks. */
139167
#undef WITH_DYLD
140168

141-
/* Define if you want to compile in rudimentary thread support */
142-
#undef WITH_THREAD
143-
144-
/* Define if you want to compile in cycle garbage collection */
145-
#undef WITH_CYCLE_GC
169+
/* Define if you want to use BSD db. */
170+
#undef WITH_LIBDB
146171

147172
/* Define if you want to produce an OpenStep/Rhapsody framework
148173
(shared library plus accessory files). */
149174
#undef WITH_NEXT_FRAMEWORK
150175

151-
/* Define if you want to use BSD db. */
152-
#undef WITH_LIBDB
153-
154-
/* Define if you want to build an interpreter with many run-time checks */
155-
#undef Py_DEBUG
156-
157-
/* The number of bytes in an off_t. */
158-
#undef SIZEOF_OFF_T
159-
160-
/* The number of bytes in a time_t. */
161-
#undef SIZEOF_TIME_T
162-
163-
/* The number of bytes in a pthread_t. */
164-
#undef SIZEOF_PTHREAD_T
165-
166-
/* Defined to enable large file support when an off_t is bigger than a long
167-
and long long is available and at least as big as an off_t. You may need
168-
to add some flags for configuration and compilation to enable this mode.
169-
E.g, for Solaris 2.7:
170-
CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" OPT="-O2 $CFLAGS" \
171-
configure
172-
*/
173-
#undef HAVE_LARGEFILE_SUPPORT
174-
175-
/* Defined when any dynamic module loading is enabled */
176-
#undef HAVE_DYNAMIC_LOADING
176+
/* Define if you want to use SGI (IRIX 4) dynamic linking.
177+
This requires the "dl" library by Jack Jansen,
178+
ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
179+
Don't bother on IRIX 5, it already has dynamic linking using SunOS
180+
style shared libraries */
181+
#undef WITH_SGI_DL
177182

178-
/* Define if i>>j for signed int i does not extend the sign bit
179-
when i < 0
180-
*/
181-
#undef SIGNED_RIGHT_SHIFT_ZERO_FILLS
183+
/* Define if you want to compile in rudimentary thread support */
184+
#undef WITH_THREAD
182185

183186

184187
/* Leave that blank line there-- autoheader needs it! */

0 commit comments

Comments
 (0)