Move max() to util.h
authorPetri Lehtinen <petri@digip.org>
Thu, 11 Jun 2009 05:54:40 +0000 (08:54 +0300)
committerPetri Lehtinen <petri@digip.org>
Thu, 11 Jun 2009 05:54:40 +0000 (08:54 +0300)
src/Makefile.am
src/util.h [new file with mode: 0644]
src/value.c

index 4471220..b75a60d 100644 (file)
@@ -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 (file)
index 0000000..5bffa9b
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef UTIL_H
+#define UTIL_H
+
+#define max(a, b)  ((a) > (b) ? (a) : (b))
+
+#endif
index ea539ff..998446c 100644 (file)
@@ -4,8 +4,7 @@
 
 #include <jansson.h>
 #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_))