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