Balint Dobszay | 82753b7 | 2022-03-03 11:30:31 +0100 | [diff] [blame] | 1 | This patch enables using libfdt's strlen() implementation. |
| 2 | |
| 3 | diff --git i/libfdt/libfdt_env.h w/libfdt/libfdt_env.h |
| 4 | index 73b6d40..3a2d38c 100644 |
| 5 | --- i/libfdt/libfdt_env.h |
| 6 | +++ w/libfdt/libfdt_env.h |
| 7 | @@ -66,13 +66,6 @@ static inline fdt64_t cpu_to_fdt64(uint64_t x) |
| 8 | #undef CPU_TO_FDT16 |
| 9 | #undef EXTRACT_BYTE |
| 10 | |
| 11 | -#ifdef __APPLE__ |
| 12 | -#include <AvailabilityMacros.h> |
| 13 | - |
| 14 | -/* strnlen() is not available on Mac OS < 10.7 */ |
| 15 | -# if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < \ |
| 16 | - MAC_OS_X_VERSION_10_7) |
| 17 | - |
| 18 | #define strnlen fdt_strnlen |
| 19 | |
| 20 | /* |
| 21 | @@ -88,9 +81,4 @@ static inline size_t fdt_strnlen(const char *string, size_t max_count) |
| 22 | return p ? p - string : max_count; |
| 23 | } |
| 24 | |
| 25 | -#endif /* !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < |
| 26 | - MAC_OS_X_VERSION_10_7) */ |
| 27 | - |
| 28 | -#endif /* __APPLE__ */ |
| 29 | - |
| 30 | #endif /* LIBFDT_ENV_H */ |