Loading...
--- Libc/Libc-1353.11.2/include/struct.h
+++ Libc/Libc-320/include/struct.h
@@ -1,3 +1,27 @@
+/*
+ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
/*-
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -48,28 +72,4 @@
#define strbase(name, addr, field) \
((struct name *)((char *)(addr) - fldoff(name, field)))
-/* Number of elements in a statically-defined array */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && __GNUC__
-#define countof(arr) ({ \
- _Static_assert( \
- !__builtin_types_compatible_p(typeof(arr), typeof(&(arr)[0])), \
- "array must be statically defined"); \
- (sizeof(arr) / sizeof(arr[0])); \
-})
-#else
-#define countof(arr) \
- (sizeof(arr) / sizeof(arr[0]))
-#endif
-
-/*
- * countof() cannot be safely used in a _Static_assert statement, so we provide
- * an unsafe variant that does not verify the input array is statically-defined.
- */
-#define countof_unsafe(arr) \
- (sizeof(arr) / sizeof(arr[0]))
-
-/* Length of a statically-defined string (does not include null terminator) */
-#define lenof(str) \
- (sizeof(str) - 1)
-
#endif /* !_STRUCT_H_ */