diff options
author | jlam <jlam@pkgsrc.org> | 2003-09-03 13:11:11 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2003-09-03 13:11:11 +0000 |
commit | 16ddd24bdb727e793ce7987f2532f167aa4e4afb (patch) | |
tree | dee374cdf0dbf8f7aacba0cb9b2b20618f68c830 /pkgtools/libnbcompat/files/nbcompat.h | |
parent | f90ace6498739ae9023c5ad0c47f76a0c477391c (diff) | |
download | pkgsrc-16ddd24bdb727e793ce7987f2532f167aa4e4afb.tar.gz |
Update pkgtools/libnbcompat to 20030826. Changes from previous version:
* Properly declare statfs() and fstatfs() if we use the libnbcompat
versions.
* Move some headers into a private directory in the installed
location so that they don't override headers of the same name
on the system.
* Define TAILQ_HEAD_INITIALIZER if it doesn't exist.
* Add a poll() implementation using select() for poll()-less systems.
Thanks for Charles Blundell for the implementation!
* Fix the vis.h check for systems whose vis() is not as featureful
as NetBSD's.
Diffstat (limited to 'pkgtools/libnbcompat/files/nbcompat.h')
-rw-r--r-- | pkgtools/libnbcompat/files/nbcompat.h | 78 |
1 files changed, 60 insertions, 18 deletions
diff --git a/pkgtools/libnbcompat/files/nbcompat.h b/pkgtools/libnbcompat/files/nbcompat.h index 29def5890c2..e26e99d999a 100644 --- a/pkgtools/libnbcompat/files/nbcompat.h +++ b/pkgtools/libnbcompat/files/nbcompat.h @@ -1,9 +1,43 @@ +/* $NetBSD: nbcompat.h,v 1.14 2003/09/03 13:11:14 jlam Exp $ */ + +/*- + * Copyright (c) 2003 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + #ifndef _NBCOMPAT_H #define _NBCOMPAT_H -#include <nbconfig.h> - -#include <nbtypes.h> +#include <nbcompat/nbconfig.h> +#include <nbcompat/nbtypes.h> #include <sys/types.h> #include <sys/param.h> @@ -32,16 +66,12 @@ #include <termios.h> #include <unistd.h> -#if HAVE_POLL -# if HAVE_POLL_H -# include <poll.h> -# elif HAVE_SYS_POLL_H -# include <sys/poll.h> -# endif -#elif HAVE_SELECT -# define USE_SELECT +#if HAVE_POLL_H +# include <poll.h> +#elif HAVE_SYS_POLL_H +# include <sys/poll.h> #else -# error "no poll() or select() found" +# include <nbcompat/poll.h> #endif #if HAVE_DIRENT_H @@ -62,7 +92,7 @@ #if HAVE_FTS_H # include <fts.h> #else -# include "fts.h" +# include <nbcompat/fts.h> #endif #if TIME_WITH_SYS_TIME @@ -165,6 +195,10 @@ struct { \ } while (/*CONSTCOND*/0) #endif /* HAVE_SYS_QUEUE_H */ +#ifndef TAILQ_HEAD_INITIALIZER +#define TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first } +#endif #ifndef TAILQ_EMPTY #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) #endif @@ -187,6 +221,8 @@ struct { \ #if HAVE_ERR_H # include <err.h> +#else +# include <nbcompat/err.h> #endif #include <ftpglob.h> @@ -280,10 +316,16 @@ void tputs(const char *, int, int (*)(int)); # include <libutil.h> #endif +#if HAVE_NBCOMPAT_VIS +# ifdef HAVE_VIS_H +# undef HAVE_VIS_H +# endif +#endif + #if HAVE_VIS_H # include <vis.h> #else -# include "vis.h" +# include <nbcompat/vis.h> #endif #if !HAVE_D_NAMLEN @@ -319,10 +361,6 @@ extern int optind; int pclose(FILE *); #endif -#if !HAVE_ERR -#include <err.h> -#endif - #if !HAVE_FGETLN char *fgetln(FILE *, size_t *); #endif @@ -423,6 +461,10 @@ size_t strlcpy(char *, const char *, size_t); char *strsep(char **stringp, const char *delim); #endif +#if HAVE_NBCOMPAT_STATFS +# include <nbcompat/statfs.h> +#endif + #if !HAVE_MEMMOVE # define memmove(a,b,c) bcopy((b),(a),(c)) /* XXX: add others #defines for borken systems? */ |