From 9b825f7b1832381a6f25199ffff3f88e0bee3295 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Thu, 11 Jun 2009 08:54:40 +0300 Subject: [PATCH] Move max() to util.h --- src/Makefile.am | 8 +++++++- src/util.h | 6 ++++++ src/value.c | 3 +-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 src/util.h diff --git a/src/Makefile.am b/src/Makefile.am index 4471220..b75a60d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,13 @@ include_HEADERS = jansson.h lib_LTLIBRARIES = libjansson.la -libjansson_la_SOURCES = dump.c hashtable.h hashtable.c load.c value.c +libjansson_la_SOURCES = \ + dump.c \ + hashtable.c \ + hashtable.h \ + load.c \ + util.h \ + value.c libjansson_la_LDFLAGS = -version-info 0:0:0 AM_CFLAGS = -Wall -Wextra -std=c99 diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..5bffa9b --- /dev/null +++ b/src/util.h @@ -0,0 +1,6 @@ +#ifndef UTIL_H +#define UTIL_H + +#define max(a, b) ((a) > (b) ? (a) : (b)) + +#endif diff --git a/src/value.c b/src/value.c index ea539ff..998446c 100644 --- a/src/value.c +++ b/src/value.c @@ -4,8 +4,7 @@ #include #include "hashtable.h" - -#define max(a, b) ((a) > (b) ? (a) : (b)) +#include "util.h" #define container_of(ptr_, type_, member_) \ ((type_ *)((char *)ptr_ - (size_t)&((type_ *)0)->member_))