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