# HG changeset patch # User jbe # Date 1435000548 -7200 # Node ID 5f529cb9b5c15c2a13eeffa40521bc626add9d07 # Parent 77dc29ce7948143b02642b8b048cdf1072d3c6a2 Avoid compiler warnings on GNU/Linux diff -r 77dc29ce7948 -r 5f529cb9b5c1 moonbridge_io.c --- a/moonbridge_io.c Mon Jun 22 00:19:19 2015 +0200 +++ b/moonbridge_io.c Mon Jun 22 21:15:48 2015 +0200 @@ -1,3 +1,7 @@ + +#ifndef __has_include +#define __has_include(x) 0 +#endif #if defined(__linux__) #define _GNU_SOURCE @@ -20,7 +24,10 @@ #include #include #include - +#if defined(__linux__) || __has_include() +#include +#endif + #include #include #include @@ -175,7 +182,7 @@ moonbr_io_handle_t *handle; lua_Integer maxread; const char *terminatorstr; - size_t terminatorlen; + size_t terminatorlen = 0; /* initialize to avoid compiler warning */ char terminator; luaL_Buffer luabuf; size_t luabufcnt = 0;