]>
git.saurik.com Git - apple/xnu.git/blob - bsd/include/c.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
25 **********************************************************************
27 * 02-Feb-86 Glenn Marcy (gm0w) at Carnegie-Mellon University
28 * Added check to allow multiple or recursive inclusion of this
29 * file. Added bool enum from machine/types.h for regular users
30 * that want a real boolean type.
32 * 29-Dec-85 Glenn Marcy (gm0w) at Carnegie-Mellon University
33 * Also change spacing of MAX and MIN to coincide with that of
36 * 19-Nov-85 Glenn Marcy (gm0w) at Carnegie-Mellon University
37 * Changed the number of tabs between TRUE, FALSE and their
38 * respective values to match those in sys/types.h.
40 * 17-Dec-84 Glenn Marcy (gm0w) at Carnegie-Mellon University
41 * Only define TRUE and FALSE if not defined. Added caseE macro
42 * for using enumerated types in switch statements.
44 * 23-Apr-81 Mike Accetta (mja) at Carnegie-Mellon University
45 * Added "sizeofS" and "sizeofA" macros which expand to the size
46 * of a string constant and array respectively.
48 **********************************************************************
55 #define ABS(x) ((x)>=0?(x):-(x))
58 #define MIN(a,b) (((a)<(b))?(a):(b))
61 #define MAX(a,b) (((a)>(b))?(a):(b))
74 typedef enum { false = 0, true = 1 } bool;
77 #define sizeofS(string) (sizeof(string) - 1)
78 #define sizeofA(array) (sizeof(array)/sizeof(array[0]))
80 #define caseE(enum_type) case (int)(enum_type)
82 #endif /* _C_INCLUDE_ */