Ticket #3115: pyport.h.diff

File pyport.h.diff, 861 bytes (added by jsnitow@…, 20 years ago)

Context patch for python 2.4.1's Include/pyport.h

Line 
1*** pyport.h    Mon May 16 21:36:35 2005
2--- pyport.h    Mon May 16 21:47:28 2005
3***************
4*** 152,162 ****
5--- 152,174 ----
6  #if defined(PYOS_OS2) && defined(PYCC_GCC)
7  #include <sys/types.h>
8  #endif
9+
10+ #if (defined __APPLE__) && (!defined _POSIX_C_SOURCE)
11+ #define TEMPORARILY_DEFINING__POSIX_C_SOURCE    /* so we can #undef it later */
12+ #define _POSIX_C_SOURCE   /* avoid deprecated struct ostat in sys/stat.h */
13+ #endif
14+
15  #include <sys/stat.h>
16  #elif defined(HAVE_STAT_H)
17  #include <stat.h>
18  #endif
19 
20+ /* Mac OS X: undefine _POSIX_C_SOURCE if it wasn't defined before */
21+ #ifdef TEMPORARILY_DEFINING__POSIX_C_SOURCE
22+ #undef _POSIX_C_SOURCE
23+ #undef TEMPORARILY_DEFINING__POSIX_C_SOURCE
24+ #endif
25+
26  #if defined(PYCC_VACPP)
27  /* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */
28  #define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG)