1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

better check for strnlen

This commit is contained in:
Ryan Dahl 2011-03-31 23:31:53 -07:00
parent 3ad2274989
commit 6477b5295d
2 changed files with 3 additions and 7 deletions

View File

@ -13,7 +13,8 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#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);

5
ol.h
View File

@ -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,