Changeset 23777


Ignore:
Timestamp:
Apr 9, 2007, 7:13:26 PM (14 years ago)
Author:
mgrimes@…
Message:

Forward-declare struct winsize as an incomplete type before any of the declarations that use it to ensure it will mean the same thing in every scope.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/lang/python24/files/patch-Include-pyport.h

    r21487 r23777  
    1 *** Include/pyport.h    Mon May 16 21:36:35 2005
    2 --- Include/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)
     1--- Include/pyport.h.orig       2007-03-12 23:26:06.000000000 -0700
     2+++ Include/pyport.h    2007-03-12 23:29:35.000000000 -0700
     3@@ -152,11 +152,23 @@ typedef PY_LONG_LONG              Py_intptr_t;
     4 #if defined(PYOS_OS2) && defined(PYCC_GCC)
     5 #include <sys/types.h>
     6 #endif
     7+
     8+#if (defined __APPLE__) && (!defined _POSIX_C_SOURCE)
     9+#define TEMPORARILY_DEFINING__POSIX_C_SOURCE    /* so we can #undef it later */
     10+#define _POSIX_C_SOURCE   /* avoid deprecated struct ostat in sys/stat.h */
     11+#endif
     12+
     13 #include <sys/stat.h>
     14 #elif defined(HAVE_STAT_H)
     15 #include <stat.h>
     16 #endif
     17 
     18+/* Mac OS X: undefine _POSIX_C_SOURCE if it wasn't defined before */
     19+#ifdef TEMPORARILY_DEFINING__POSIX_C_SOURCE
     20+#undef _POSIX_C_SOURCE
     21+#undef TEMPORARILY_DEFINING__POSIX_C_SOURCE
     22+#endif
     23+
     24 #if defined(PYCC_VACPP)
     25 /* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */
     26 #define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG)
     27@@ -393,6 +405,7 @@ extern char * _getpty(int *, int, mode_t
     28 /* BSDI does not supply a prototype for the 'openpty' and 'forkpty'
     29    functions, even though they are included in libutil. */
     30 #include <termios.h>
     31+struct winsize;
     32 extern int openpty(int *, int *, char *, struct termios *, struct winsize *);
     33 extern int forkpty(int *, char *, struct termios *, struct winsize *);
     34 #endif /* !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) */
Note: See TracChangeset for help on using the changeset viewer.