We have sys/cdefs.h now, so remove hacks.

This commit is contained in:
Arun Thomas 2010-06-17 15:14:57 +00:00
parent 7b7091e905
commit 042b5bf606
19 changed files with 33 additions and 42 deletions

View file

@ -35,8 +35,8 @@
static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95";
#endif #endif
#endif /* not lint */ #endif /* not lint */
/*
#include <sys/cdefs.h> #include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/alias.c,v 1.18 2004/04/06 20:06:51 markm Exp $"); __FBSDID("$FreeBSD: src/bin/sh/alias.c,v 1.18 2004/04/06 20:06:51 markm Exp $");
*/ */

View file

@ -35,8 +35,8 @@
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95"; static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
#endif #endif
#endif /* not lint */ #endif /* not lint */
/*
#include <sys/cdefs.h> #include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/eval.c,v 1.42 2004/04/06 20:06:51 markm Exp $"); __FBSDID("$FreeBSD: src/bin/sh/eval.c,v 1.42 2004/04/06 20:06:51 markm Exp $");
*/ */

View file

@ -35,8 +35,8 @@
static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95"; static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
#endif #endif
#endif /* not lint */ #endif /* not lint */
/*
#include <sys/cdefs.h> #include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/exec.c,v 1.24.2.1 2004/09/30 04:41:55 des Exp $"); __FBSDID("$FreeBSD: src/bin/sh/exec.c,v 1.24.2.1 2004/09/30 04:41:55 des Exp $");
*/ */

View file

@ -35,8 +35,8 @@
static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95"; static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95";
#endif #endif
#endif /* not lint */ #endif /* not lint */
/*
#include <sys/cdefs.h> #include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/expand.c,v 1.46 2004/04/06 20:06:51 markm Exp $"); __FBSDID("$FreeBSD: src/bin/sh/expand.c,v 1.46 2004/04/06 20:06:51 markm Exp $");
*/ */

View file

@ -35,8 +35,8 @@
static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95"; static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
#endif #endif
#endif /* not lint */ #endif /* not lint */
/*
#include <sys/cdefs.h> #include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/input.c,v 1.22 2004/04/06 20:06:51 markm Exp $"); __FBSDID("$FreeBSD: src/bin/sh/input.c,v 1.22 2004/04/06 20:06:51 markm Exp $");
*/ */

View file

@ -35,8 +35,8 @@
static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
#endif #endif
#endif /* not lint */ #endif /* not lint */
/*
#include <sys/cdefs.h> #include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/jobs.c,v 1.67 2004/04/06 20:06:51 markm Exp $"); __FBSDID("$FreeBSD: src/bin/sh/jobs.c,v 1.67 2004/04/06 20:06:51 markm Exp $");
*/ */

View file

@ -35,8 +35,8 @@
static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95";
#endif #endif
#endif /* not lint */ #endif /* not lint */
/*
#include <sys/cdefs.h> #include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/miscbltin.c,v 1.30 2004/04/06 20:06:51 markm Exp $"); __FBSDID("$FreeBSD: src/bin/sh/miscbltin.c,v 1.30 2004/04/06 20:06:51 markm Exp $");
*/ */

View file

@ -41,8 +41,8 @@ static char const copyright[] =
static char sccsid[] = "@(#)mkinit.c 8.2 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)mkinit.c 8.2 (Berkeley) 5/4/95";
#endif #endif
#endif /* not lint */ #endif /* not lint */
/*
#include <sys/cdefs.h> #include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/mkinit.c,v 1.17 2004/04/06 20:06:51 markm Exp $"); __FBSDID("$FreeBSD: src/bin/sh/mkinit.c,v 1.17 2004/04/06 20:06:51 markm Exp $");
*/ */
@ -65,10 +65,6 @@ __FBSDID("$FreeBSD: src/bin/sh/mkinit.c,v 1.17 2004/04/06 20:06:51 markm Exp $")
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#ifdef __minix
#define __unused
#endif
/* /*
* OUTFILE is the name of the output file. Output is initially written * OUTFILE is the name of the output file. Output is initially written
* to the file OUTTEMP, which is then moved to OUTFILE. * to the file OUTTEMP, which is then moved to OUTFILE.

View file

@ -41,6 +41,7 @@ static char const copyright[] =
static char sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95";
#endif /* not lint */ #endif /* not lint */
#endif #endif
#include <sys/cdefs.h>
/* /*
__FBSDID("$FreeBSD: src/bin/sh/mksyntax.c,v 1.23 2004/04/06 20:06:51 markm Exp $"); __FBSDID("$FreeBSD: src/bin/sh/mksyntax.c,v 1.23 2004/04/06 20:06:51 markm Exp $");
*/ */
@ -54,10 +55,6 @@ __FBSDID("$FreeBSD: src/bin/sh/mksyntax.c,v 1.23 2004/04/06 20:06:51 markm Exp $
#include <string.h> #include <string.h>
#include "parser.h" #include "parser.h"
#ifdef __minix
#define __unused
#endif
struct synclass { struct synclass {
char *name; char *name;
char *comment; char *comment;

View file

@ -35,8 +35,8 @@
static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95"; static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
#endif #endif
#endif /* not lint */ #endif /* not lint */
/*
#include <sys/cdefs.h> #include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/parser.c,v 1.51.2.1 2005/03/03 03:43:20 obrien Exp $"); __FBSDID("$FreeBSD: src/bin/sh/parser.c,v 1.51.2.1 2005/03/03 03:43:20 obrien Exp $");
*/ */

View file

@ -82,8 +82,6 @@ extern char nullstr[1]; /* null string */
#endif #endif
#ifdef __minix #ifdef __minix
#define __unused
typedef long quad_t; /* XXX */ typedef long quad_t; /* XXX */
typedef unsigned long u_quad_t; /* XXX */ typedef unsigned long u_quad_t; /* XXX */
#endif #endif

View file

@ -35,8 +35,8 @@
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
#endif #endif
#endif /* not lint */ #endif /* not lint */
/*
#include <sys/cdefs.h> #include <sys/cdefs.h>
/*
__FBSDID("$FreeBSD: src/bin/sh/var.c,v 1.26.2.1 2004/09/30 04:41:55 des Exp $"); __FBSDID("$FreeBSD: src/bin/sh/var.c,v 1.26.2.1 2004/09/30 04:41:55 des Exp $");
*/ */

View file

@ -29,8 +29,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#if 0
#include <sys/cdefs.h> #include <sys/cdefs.h>
#if 0
#ifndef lint #ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1988, 1993\ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\
The Regents of the University of California. All rights reserved."); The Regents of the University of California. All rights reserved.");

View file

@ -35,10 +35,6 @@
#define _ERR_H_ #define _ERR_H_
#ifdef __minix #ifdef __minix
#define __BEGIN_DECLS
#define __dead
#define __END_DECLS
#define __attribute__(x)
#define _BSD_VA_LIST_ va_list #define _BSD_VA_LIST_ va_list
#include <stdarg.h> #include <stdarg.h>
#else #else
@ -50,8 +46,8 @@
* _BSD_VA_LIST_ from <machine/ansi.h> and use it. * _BSD_VA_LIST_ from <machine/ansi.h> and use it.
*/ */
#include <machine/ansi.h> #include <machine/ansi.h>
#include <sys/cdefs.h>
#endif #endif
#include <sys/cdefs.h>
__BEGIN_DECLS __BEGIN_DECLS
__dead void err(int, const char *, ...) __dead void err(int, const char *, ...)

View file

@ -32,12 +32,7 @@
#ifndef _GETOPT_H_ #ifndef _GETOPT_H_
#define _GETOPT_H_ #define _GETOPT_H_
#ifdef __minix
#define __BEGIN_DECLS
#define __END_DECLS
#else
#include <sys/cdefs.h> #include <sys/cdefs.h>
#endif
#include <unistd.h> #include <unistd.h>
/* /*

View file

@ -10,6 +10,7 @@
#ifndef _STDINT_H #ifndef _STDINT_H
#define _STDINT_H #define _STDINT_H
#include <sys/cdefs.h>
#ifndef _MINIX__TYPES_H #ifndef _MINIX__TYPES_H
#include <minix/types.h> #include <minix/types.h>
#endif #endif
@ -197,10 +198,6 @@ typedef unsigned long uintmax_t;
#endif /* !__cplusplus || __STDC_LIMIT_MACROS */ #endif /* !__cplusplus || __STDC_LIMIT_MACROS */
#ifndef __CONCAT
#define __CONCAT(x,y) x ## y
#endif
/* Constants of the proper type. */ /* Constants of the proper type. */
#define INT8_C(c) c #define INT8_C(c) c
#define INT16_C(c) c #define INT16_C(c) c

View file

@ -343,6 +343,25 @@
#define __predict_false(exp) (exp) #define __predict_false(exp) (exp)
#endif #endif
/*
* We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
* require it.
*/
#if __GNUC_PREREQ__(4, 1)
#define __offsetof(type, field) __builtin_offsetof(type, field)
#else
#ifndef __cplusplus
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
#else
#define __offsetof(type, field) \
(__offsetof__ (reinterpret_cast <size_t> \
(&reinterpret_cast <const volatile char &> \
(static_cast<type *> (0)->field))))
#endif
#endif
#define __rangeof(type, start, end) \
(__offsetof(type, end) - __offsetof(type, start))
/* /*
* Compiler-dependent macros to declare that functions take printf-like * Compiler-dependent macros to declare that functions take printf-like
* or scanf-like arguments. They are null except for versions of gcc * or scanf-like arguments. They are null except for versions of gcc

View file

@ -33,12 +33,7 @@
#ifndef _SYS_QUEUE_H_ #ifndef _SYS_QUEUE_H_
#define _SYS_QUEUE_H_ #define _SYS_QUEUE_H_
/* Minix doesn't have this file.
#include <sys/cdefs.h> #include <sys/cdefs.h>
*/
/* Minix does needs this declaration from sys/cdefs.h though. */
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
/* /*
* This file defines four types of data structures: singly-linked lists, * This file defines four types of data structures: singly-linked lists,

View file

@ -30,9 +30,7 @@
*/ */
#ifdef __minix #ifdef __minix
#define __P(x) x
#define _DIAGASSERT assert #define _DIAGASSERT assert
#define __UNCONST(x) ((void *) (x))
#else #else
#if HAVE_NBTOOL_CONFIG_H #if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h" #include "nbtool_config.h"