Commit 8f88197c authored by Adam Wujek's avatar Adam Wujek 💬

include: move min macro from lib/net.c to include/wrc.h

Additionally use type checking
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 8f3e46d4
...@@ -21,6 +21,13 @@ ...@@ -21,6 +21,13 @@
#define vprintf pp_vprintf #define vprintf pp_vprintf
#define sprintf pp_sprintf #define sprintf pp_sprintf
#ifndef min
#define min(a, b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
#endif
#undef offsetof #undef offsetof
#define offsetof(TYPE, MEMBER) ((long) &((TYPE *)0)->MEMBER) #define offsetof(TYPE, MEMBER) ((long) &((TYPE *)0)->MEMBER)
#undef ARRAY_SIZE #undef ARRAY_SIZE
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#include "softpll_ng.h" #include "softpll_ng.h"
#include "ipv4.h" #include "ipv4.h"
#define min(x,y) ((x) < (y) ? (x) : (y))
static struct wrpc_socket *socks[NET_MAX_SOCKETS]; static struct wrpc_socket *socks[NET_MAX_SOCKETS];
//#define net_verbose pp_printf //#define net_verbose pp_printf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment