This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Make libio.h work in cygwin-b20


libio.h does not work when #included in cygwin-b20.

This is because of this code therefrom:

: #ifndef __P
: # if _G_HAVE_SYS_CDEFS
: #  include <sys/cdefs.h>
: # else
: #  ifdef __STDC__
: #   define __P(p) p
: #  else
: #   define __P(p) ()
: #  endif
: # endif
: #endif /*!__P*/

[and, further down, code that uses __P, like

: extern int _IO_getc __P ((_IO_FILE *__fp));

]

This code is OK; the GNU C Library has included a definition of __P in
<sys/cdefs.h> for donkey's years (since before the changelog began, it
seems).

But cygwin-b20's <cdefs.h> does not contain such a definition, so that
any code that includes <libio.h> before including anything else that
defines __P breaks.

This patch adds such a definition to <sys/cdefs.h>. (The path in the
patch may well be wrong.)

--- sys/cdefs.h.orig        Sat Sep 25 20:30:57 1999
+++ sys/cdefs.h     Sat Sep 25 20:30:57 1999
@@ -7,5 +7,9 @@
 #define        __BEGIN_DECLS
 #define        __END_DECLS
 #endif
+#ifdef __STDC__
+#define __P(args) args
+#else
+#define __P(args) ()
+#endif
 #endif

I hope this is useful.

-- 
`I need some female underwear.' --- Vadik @ 1999-09-19

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]