Fix build for Apple/OSX.
This commit is contained in:
parent
37ea7d572d
commit
3ad2274989
10
ol-unix.c
10
ol-unix.c
@ -13,6 +13,16 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
#if !defined(HAVE_STRNLEN) /* Implement for platforms that lack strnlen */
|
||||||
|
size_t strnlen (register const char* s, size_t maxlen) {
|
||||||
|
register const char *e;
|
||||||
|
size_t n;
|
||||||
|
|
||||||
|
for (e = s, n = 0; *e && n < maxlen; e++, n++);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void ol_tcp_io(EV_P_ ev_io* watcher, int revents);
|
void ol_tcp_io(EV_P_ ev_io* watcher, int revents);
|
||||||
void ol_tcp_connect(ol_handle* handle, ol_req* req);
|
void ol_tcp_connect(ol_handle* handle, ol_req* req);
|
||||||
|
|||||||
7
ol.h
7
ol.h
@ -18,13 +18,18 @@ typedef void (*ol_connect_cb)(ol_req* req, ol_err e);
|
|||||||
typedef void (*ol_shutdown_cb)(ol_req* req);
|
typedef void (*ol_shutdown_cb)(ol_req* req);
|
||||||
|
|
||||||
|
|
||||||
#if defined(__unix__) || defined(__POSIX__)
|
#if defined(__unix__) || defined(__POSIX__) || defined(__APPLE__)
|
||||||
# include "ol-unix.h"
|
# include "ol-unix.h"
|
||||||
#else
|
#else
|
||||||
# include "ol-win.h"
|
# include "ol-win.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(__APPLE__) /* FIXME: detect during configure */
|
||||||
|
# define HAVE_STRNLEN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OL_UNKNOWN_HANDLE = 0,
|
OL_UNKNOWN_HANDLE = 0,
|
||||||
OL_TCP,
|
OL_TCP,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user