Loading...
--- Libc/Libc-1725.40.4/include/struct.h
+++ Libc/Libc-1272.200.26/include/struct.h
@@ -48,13 +48,6 @@
#define strbase(name, addr, field) \
((struct name *)((char *)(addr) - fldoff(name, field)))
-/*
- * 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]))
-
/* Number of elements in a statically-defined array */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && __GNUC__
#define countof(arr) ({ \
@@ -65,15 +58,11 @@
})
#else
#define countof(arr) \
- countof_unsafe(arr)
+ (sizeof(arr) / sizeof(arr[0]))
#endif
/* Length of a statically-defined string (does not include null terminator) */
#define lenof(str) \
(sizeof(str) - 1)
-/* Last index of a statically-defined array */
-#define lastof(arr) \
- (countof(arr) - 1)
-
#endif /* !_STRUCT_H_ */