summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/macro.h
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2009-08-26 14:29:55 +0300
committerTanu Kaskinen <tanuk@iki.fi>2009-08-26 14:29:55 +0300
commit7bc8a793b8ae4c46e59a444313e4d06186de1680 (patch)
tree6abd784d94df0e8eef5811dd65f6bda21ca9f554 /src/pulsecore/macro.h
parent219f7508f6420f94ad8c426c6aa3dc79df246f36 (diff)
parent4614412f94eef8ed65076c6fc76b463547f8f072 (diff)
Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts: src/Makefile.am
Diffstat (limited to 'src/pulsecore/macro.h')
-rw-r--r--src/pulsecore/macro.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
index ce88c1b9..87684ad3 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.h
@@ -157,6 +157,17 @@ static inline size_t PA_PAGE_ALIGN(size_t l) {
#define PA_ROUND_DOWN(a, b) (((a) / (b)) * (b))
#endif
+#ifdef __GNUC__
+#define PA_CLIP_SUB(a, b) \
+ __extension__ ({ \
+ typeof(a) _a = (a); \
+ typeof(b) _b = (b); \
+ _a > _b ? _a - _b : 0; \
+ })
+#else
+#define PA_CLIP_SUB(a, b) ((a) > (b) ? (a) - (b) : 0)
+#endif
+
/* This type is not intended to be used in exported APIs! Use classic "int" there! */
#ifdef HAVE_STD_BOOL
typedef _Bool pa_bool_t;