| 52 | #ifdef _DARWIN |
| 53 | #if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_6 |
| 54 | size_t strnlen (const char *str, size_t max) |
| 55 | { |
| 56 | const char *end = (const char*)memchr(str, 0, max); |
| 57 | return end ? (size_t)(end - str) : max; |
| 58 | } |
| 59 | #endif |
| 60 | #endif |
| 61 |