[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Patch] stdio-impl.h has too indiscriminate #ifdef
From: |
Bruno Haible |
Subject: |
Re: [Patch] stdio-impl.h has too indiscriminate #ifdef |
Date: |
Mon, 5 Apr 2010 00:15:00 +0100 |
User-agent: |
KMail/1.9.9 |
Hi Hauke,
> -- it should actually be
>
> if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000)
>
> where __NetBSD_Version__ is defined in <sys/param.h>, in the kernel source
> tree at src/sys/sys/param.h.
>
> The relevant version bump of this file is
> <http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/param.h?rev=1.135&content-type=text/x-cvsweb-markup>
Thanks, this makes it clear. To be safe, it's necessary to
#include <sys/param.h>.
I'm applying this patch. (The "tiny change" is not a devalorisation of your
contribution, but merely an indication that you don't need to start a copyright
assignment for the FSF for this contribution.)
2010-04-04 Hauke Fath <address@hidden> (tiny change)
Bruno Haible <address@hidden>
Port extended stdio to NetBSD 1.5.
* lib/stdio-impl.h [NetBSD]: Include <sys/param.h>.
(struct __sfileext, fp_ub): Define the "old way" for NetBSD 1.5Z and
older.
--- lib/stdio-impl.h.orig Mon Apr 5 01:09:55 2010
+++ lib/stdio-impl.h Mon Apr 5 01:07:15 2010
@@ -1,5 +1,5 @@
/* Implementation details of FILE streams.
- Copyright (C) 2007-2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,6 +21,11 @@
/* BSD stdio derived implementations. */
+#if defined __NetBSD__ /* NetBSD */
+/* Get __NetBSD_Version__. */
+# include <sys/param.h>
+#endif
+
#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD,
DragonFly, MacOS X, Cygwin */
# if defined __DragonFly__ /* DragonFly */
@@ -50,7 +55,7 @@
# define fp_ fp
# endif
-# if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */
+# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined
__OpenBSD__ /* NetBSD >= 1.5ZA, OpenBSD */
/* See
<http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
and
<http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
*/
struct __sfileext
@@ -59,7 +64,7 @@
/* More fields, not relevant here. */
};
# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
-# else /* FreeBSD, DragonFly, MacOS X,
Cygwin */
+# else /* FreeBSD, NetBSD <= 1.5Z,
DragonFly, MacOS X, Cygwin */
# define fp_ub fp_->_ub
# endif