@@ -184,43 +184,6 @@ typedef Py_ssize_t Py_ssize_clean_t;
184184# define Py_MEMCPY memcpy
185185#endif
186186
187- /* ******************************
188- * stat() and fstat() fiddling *
189- *******************************/
190-
191- #ifdef HAVE_SYS_STAT_H
192- #include < sys/stat.h>
193- #elif defined(HAVE_STAT_H)
194- #include < stat.h>
195- #endif
196-
197- #ifndef S_IFMT
198- /* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */
199- #define S_IFMT 0170000
200- #endif
201-
202- #ifndef S_IFLNK
203- /* Windows doesn't define S_IFLNK but posixmodule.c maps
204- * IO_REPARSE_TAG_SYMLINK to S_IFLNK */
205- # define S_IFLNK 0120000
206- #endif
207-
208- #ifndef S_ISREG
209- #define S_ISREG (x ) (((x) & S_IFMT) == S_IFREG)
210- #endif
211-
212- #ifndef S_ISDIR
213- #define S_ISDIR (x ) (((x) & S_IFMT) == S_IFDIR)
214- #endif
215-
216- #ifndef S_ISCHR
217- #define S_ISCHR (x ) (((x) & S_IFMT) == S_IFCHR)
218- #endif
219-
220- #ifndef S_ISLNK
221- #define S_ISLNK (x ) (((x) & S_IFMT) == S_IFLNK)
222- #endif
223-
224187#ifdef __cplusplus
225188/* Move this down here since some C++ #include's don't like to be included
226189 inside an extern "C" */
@@ -392,117 +355,8 @@ extern "C" {
392355# define Py_NO_INLINE
393356#endif
394357
395- /* On 4.4BSD-descendants, ctype functions serves the whole range of
396- * wchar_t character set rather than single byte code points only.
397- * This characteristic can break some operations of string object
398- * including str.upper() and str.split() on UTF-8 locales. This
399- * workaround was provided by Tim Robbins of FreeBSD project.
400- */
401-
402- #if defined(__APPLE__)
403- # define _PY_PORT_CTYPE_UTF8_ISSUE
404- #endif
405-
406- #ifdef _PY_PORT_CTYPE_UTF8_ISSUE
407- #ifndef __cplusplus
408- /* The workaround below is unsafe in C++ because
409- * the <locale> defines these symbols as real functions,
410- * with a slightly different signature.
411- * See issue #10910
412- */
413- #include < ctype.h>
414- #include < wctype.h>
415- #undef isalnum
416- #define isalnum (c ) iswalnum(btowc(c))
417- #undef isalpha
418- #define isalpha (c ) iswalpha(btowc(c))
419- #undef islower
420- #define islower (c ) iswlower(btowc(c))
421- #undef isspace
422- #define isspace (c ) iswspace(btowc(c))
423- #undef isupper
424- #define isupper (c ) iswupper(btowc(c))
425- #undef tolower
426- #define tolower (c ) towlower(btowc(c))
427- #undef toupper
428- #define toupper (c ) towupper(btowc(c))
429- #endif
430- #endif
431-
432-
433- /* Declarations for symbol visibility.
434-
435- PyAPI_FUNC(type): Declares a public Python API function and return type
436- PyAPI_DATA(type): Declares public Python data and its type
437- PyMODINIT_FUNC: A Python module init function. If these functions are
438- inside the Python core, they are private to the core.
439- If in an extension module, it may be declared with
440- external linkage depending on the platform.
441-
442- As a number of platforms support/require "__declspec(dllimport/dllexport)",
443- we support a HAVE_DECLSPEC_DLL macro to save duplication.
444- */
445-
446- /*
447- All windows ports, except cygwin, are handled in PC/pyconfig.h.
448-
449- Cygwin is the only other autoconf platform requiring special
450- linkage handling and it uses __declspec().
451- */
452- #if defined(__CYGWIN__)
453- # define HAVE_DECLSPEC_DLL
454- #endif
455-
456358#include " exports.h"
457359
458- /* only get special linkage if built as shared or platform is Cygwin */
459- #if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__)
460- # if defined(HAVE_DECLSPEC_DLL)
461- # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
462- # define PyAPI_FUNC (RTYPE ) Py_EXPORTED_SYMBOL RTYPE
463- # define PyAPI_DATA (RTYPE ) extern Py_EXPORTED_SYMBOL RTYPE
464- /* module init functions inside the core need no external linkage */
465- /* except for Cygwin to handle embedding */
466- # if defined(__CYGWIN__)
467- # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
468- # else /* __CYGWIN__ */
469- # define PyMODINIT_FUNC PyObject*
470- # endif /* __CYGWIN__ */
471- # else /* Py_BUILD_CORE */
472- /* Building an extension module, or an embedded situation */
473- /* public Python functions and data are imported */
474- /* Under Cygwin, auto-import functions to prevent compilation */
475- /* failures similar to those described at the bottom of 4.1: */
476- /* http://docs.python.org/extending/windows.html#a-cookbook-approach */
477- # if !defined(__CYGWIN__)
478- # define PyAPI_FUNC (RTYPE ) Py_IMPORTED_SYMBOL RTYPE
479- # endif /* !__CYGWIN__ */
480- # define PyAPI_DATA (RTYPE ) extern Py_IMPORTED_SYMBOL RTYPE
481- /* module init functions outside the core must be exported */
482- # if defined(__cplusplus)
483- # define PyMODINIT_FUNC extern " C" Py_EXPORTED_SYMBOL PyObject*
484- # else /* __cplusplus */
485- # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
486- # endif /* __cplusplus */
487- # endif /* Py_BUILD_CORE */
488- # endif /* HAVE_DECLSPEC_DLL */
489- #endif /* Py_ENABLE_SHARED */
490-
491- /* If no external linkage macros defined by now, create defaults */
492- #ifndef PyAPI_FUNC
493- # define PyAPI_FUNC (RTYPE ) Py_EXPORTED_SYMBOL RTYPE
494- #endif
495- #ifndef PyAPI_DATA
496- # define PyAPI_DATA (RTYPE ) extern Py_EXPORTED_SYMBOL RTYPE
497- #endif
498- #ifndef PyMODINIT_FUNC
499- # if defined(__cplusplus)
500- # define PyMODINIT_FUNC extern " C" Py_EXPORTED_SYMBOL PyObject*
501- # else /* __cplusplus */
502- # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
503- # endif /* __cplusplus */
504- #endif
505-
506360/* limits.h constants that may be missing */
507361
508362#ifndef INT_MAX
0 commit comments