summaryrefslogtreecommitdiffstats
path: root/macro.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-05-12 23:38:38 +0000
committerLennart Poettering <lennart@poettering.net>2007-05-12 23:38:38 +0000
commita64e85acf96bc0c55363fe55c9e9116aef2a8584 (patch)
tree69ec57b46bdebe0e7496bf11ea9a54cdf5806904 /macro.h
parent2eb6dec8e9f0114bdbad59cf8f11f197f8fdaaf3 (diff)
resampling works
git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@4 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce
Diffstat (limited to 'macro.h')
-rw-r--r--macro.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/macro.h b/macro.h
index d2edead..368555d 100644
--- a/macro.h
+++ b/macro.h
@@ -13,7 +13,7 @@
#define sa_return_if_fail(expr) \
do { \
if (!(expr)) { \
- fprintf(stderr, PRETTY_FUNCTION ": Assertion <" #expr "> failed.\n"); \
+ fprintf(stderr, "%s: Assertion <%s> failed.\n", PRETTY_FUNCTION, #expr ); \
return; \
} \
} while(0)
@@ -21,7 +21,7 @@
#define sa_return_val_if_fail(expr, val) \
do { \
if (!(expr)) { \
- fprintf(stderr, "%s: Assertion <" #expr "> failed.\n", PRETTY_FUNCTION ); \
+ fprintf(stderr, "%s: Assertion <%s> failed.\n", PRETTY_FUNCTION, #expr ); \
return (val); \
} \
} while(0)
@@ -30,4 +30,13 @@
#define sa_assert_not_reached() sa_assert(!"Should not be reached.")
+#define elementsof(x) (sizeof(x)/sizeof((x)[0]))
+
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
#endif