From a94ce2548af3e04e355abee74e0ef8840527bbad Mon Sep 17 00:00:00 2001 From: rofl0r Date: Thu, 15 Oct 2015 19:49:44 +0100 Subject: [PATCH] rocksockserver: make libulz usage optional --- rocksockserver.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rocksockserver.c b/rocksockserver.c index 5cb8ba1..e3a763f 100644 --- a/rocksockserver.c +++ b/rocksockserver.c @@ -25,8 +25,21 @@ #define LOGP(X) do { if(srv->perr) srv->perr(X); } while(0) +#ifdef USE_LIBULZ #include "../lib/include/strlib.h" #include "../lib/include/timelib.h" +#else +#include +#include +#define microsleep(X) usleep(X) +static inline char* my_intToString(int i, char *b, size_t s) { + int x = snprintf(b, s, "%d", i); + if(x > 0 && x < s) return b; + return 0; +} +#define intToString(i, b) my_intToString(i, b, sizeof(b)) +#define ipv4fromstring(s, b) inet_aton(s, (struct in_addr *)(void*)(b)) +#endif typedef struct { const char* host; -- 2.11.4.GIT