1 /* $NetBSD: c.h,v 1.6 2009/06/19 23:36:41 dyoung Exp $ */
4 * Copyright (c) 1991 Carnegie Mellon University
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
13 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
15 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 * Carnegie Mellon requests users of this software to return to
19 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
20 * School of Computer Science
21 * Carnegie Mellon University
22 * Pittsburgh PA 15213-3890
24 * any improvements or extensions that they make and grant Carnegie the rights
25 * to redistribute these changes.
30 **********************************************************************
32 * 02-Feb-86 Glenn Marcy (gm0w) at Carnegie-Mellon University
33 * Added check to allow multiple or recursive inclusion of this
34 * file. Added bool enum from machine/types.h for regular users
35 * that want a real boolean type.
37 * 29-Dec-85 Glenn Marcy (gm0w) at Carnegie-Mellon University
38 * Also change spacing of MAX and MIN to coincide with that of
41 * 19-Nov-85 Glenn Marcy (gm0w) at Carnegie-Mellon University
42 * Changed the number of tabs between TRUE, FALSE and their
43 * respective values to match those in sys/types.h.
45 * 17-Dec-84 Glenn Marcy (gm0w) at Carnegie-Mellon University
46 * Only define TRUE and FALSE if not defined. Added caseE macro
47 * for using enumerated types in switch statements.
49 * 23-Apr-81 Mike Accetta (mja) at Carnegie-Mellon University
50 * Added "sizeofS" and "sizeofA" macros which expand to the size
51 * of a string constant and array respectively.
53 **********************************************************************
59 #include <sys/cdefs.h>
60 #include <sys/param.h>
71 #define MAX(a,b) ((a)>(b)?(a):(b))
75 #define sizeofA(array) __arraycount(array)
77 #define sizeofA(array) (sizeof(array)/sizeof(array[0]))
84 #define __unused __attribute__((__unused__))
88 #endif /* _C_INCLUDE_ */