public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Make libio.h work in cygwin-b20
@ 1999-09-26  8:08 Nix
  1999-09-27 11:08 ` Geoffrey Noer
  1999-09-30 23:42 ` Nix
  0 siblings, 2 replies; 4+ messages in thread
From: Nix @ 1999-09-26  8:08 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make libio.h work in cygwin-b20
  1999-09-26  8:08 [PATCH] Make libio.h work in cygwin-b20 Nix
@ 1999-09-27 11:08 ` Geoffrey Noer
  1999-09-30 23:42   ` Geoffrey Noer
  1999-09-30 23:42 ` Nix
  1 sibling, 1 reply; 4+ messages in thread
From: Geoffrey Noer @ 1999-09-27 11:08 UTC (permalink / raw)
  To: Nix; +Cc: cygwin

On Sun, Sep 26, 1999, Nix wrote:
>
> libio.h does not work when #included in cygwin-b20.
[...]
> 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.

Looks like this has already been fixed.  winsup/include/sys/cdefs.h:

#ifndef _SYS_CDEFS_H
#define _SYS_CDEFS_H
#ifdef  __cplusplus
#define __BEGIN_DECLS   extern "C" {
#define __END_DECLS     }
#else
#define __BEGIN_DECLS
#define __END_DECLS
#endif
#define __P(protos)     protos          /* full-blown ANSI C */
#endif

-- 
Geoffrey Noer		Email: noer@cygnus.com
Cygnus Solutions

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Make libio.h work in cygwin-b20
  1999-09-27 11:08 ` Geoffrey Noer
@ 1999-09-30 23:42   ` Geoffrey Noer
  0 siblings, 0 replies; 4+ messages in thread
From: Geoffrey Noer @ 1999-09-30 23:42 UTC (permalink / raw)
  To: Nix; +Cc: cygwin

On Sun, Sep 26, 1999, Nix wrote:
>
> libio.h does not work when #included in cygwin-b20.
[...]
> 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.

Looks like this has already been fixed.  winsup/include/sys/cdefs.h:

#ifndef _SYS_CDEFS_H
#define _SYS_CDEFS_H
#ifdef  __cplusplus
#define __BEGIN_DECLS   extern "C" {
#define __END_DECLS     }
#else
#define __BEGIN_DECLS
#define __END_DECLS
#endif
#define __P(protos)     protos          /* full-blown ANSI C */
#endif

-- 
Geoffrey Noer		Email: noer@cygnus.com
Cygnus Solutions

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Make libio.h work in cygwin-b20
  1999-09-26  8:08 [PATCH] Make libio.h work in cygwin-b20 Nix
  1999-09-27 11:08 ` Geoffrey Noer
@ 1999-09-30 23:42 ` Nix
  1 sibling, 0 replies; 4+ messages in thread
From: Nix @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-09-30 23:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-26  8:08 [PATCH] Make libio.h work in cygwin-b20 Nix
1999-09-27 11:08 ` Geoffrey Noer
1999-09-30 23:42   ` Geoffrey Noer
1999-09-30 23:42 ` Nix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).