From 100f324fcd0db19e3db9a9776377a0391e82f775 Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Fri, 22 Nov 2013 05:15:13 +0100 Subject: lib/socket_wrapper fix compilation when libreplace is not around Signed-off-by: Christian Ambach Reviewed-by: Jelmer Vernooij --- lib/socket_wrapper/socket_wrapper.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/socket_wrapper/socket_wrapper.c') diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c index 3c9d0f1a9c..a8369ad49d 100644 --- a/lib/socket_wrapper/socket_wrapper.c +++ b/lib/socket_wrapper/socket_wrapper.c @@ -56,7 +56,9 @@ #include #include #include +#ifdef HAVE_SYS_FILIO_H #include +#endif #include #include #include @@ -67,9 +69,27 @@ #include #include #include +#include + +#ifndef MIN +#define MIN(a,b) ((a)<(b)?(a):(b)) +#endif + +#ifndef discard_const_p +#define discard_const_p(type, ptr) ((type *)discard_const(ptr)) +#endif + +/** + * zero a structure + */ +#ifndef ZERO_STRUCT +#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) +#endif #endif /* HAVE_LIBREPLACE */ +#include "socket_wrapper.h" + #ifndef _PUBLIC_ #define _PUBLIC_ #endif -- cgit