From 6477b5295d1df42274cabfcffeddbe3ea7f5b629 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 31 Mar 2011 23:31:53 -0700 Subject: [PATCH] better check for strnlen --- ol-unix.c | 5 +++-- ol.h | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ol-unix.c b/ol-unix.c index 40307f38..caf4861f 100644 --- a/ol-unix.c +++ b/ol-unix.c @@ -13,7 +13,8 @@ #include #include -#if !defined(HAVE_STRNLEN) /* Implement for platforms that lack strnlen */ + +#ifndef strnlen size_t strnlen (register const char* s, size_t maxlen) { register const char *e; size_t n; @@ -21,7 +22,7 @@ size_t strnlen (register const char* s, size_t maxlen) { for (e = s, n = 0; *e && n < maxlen; e++, n++); return n; } -#endif +#endif /* strnlen */ void ol_tcp_io(EV_P_ ev_io* watcher, int revents); diff --git a/ol.h b/ol.h index bbc9eaf6..60e2fd9e 100644 --- a/ol.h +++ b/ol.h @@ -25,11 +25,6 @@ typedef void (*ol_shutdown_cb)(ol_req* req); #endif -#if !defined(__APPLE__) /* FIXME: detect during configure */ -# define HAVE_STRNLEN -#endif - - typedef enum { OL_UNKNOWN_HANDLE = 0, OL_TCP,