summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/macro.h
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-09-22 11:30:30 +0800
committerDaniel Mack <daniel@caiaq.de>2009-09-22 11:30:30 +0800
commit94aa9097f4ded68623160d754a4bf2632b8efc79 (patch)
tree94a5e1192a18f760dc00ff5b36e1f7ba36fd449b /src/pulsecore/macro.h
parentc1e59f7d762fb147bc5250ebddb9cf5639aba522 (diff)
parentc194db71b0ff853b4f46df26e135edf63b215451 (diff)
Merge branch 'master' of git://0pointer.de/pulseaudio
Diffstat (limited to 'src/pulsecore/macro.h')
-rw-r--r--src/pulsecore/macro.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
index bffcc264..9a5a2670 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.h
@@ -304,6 +304,18 @@ typedef int pa_bool_t;
#define pa_memzero(x,l) (memset((x), 0, (l)))
#define pa_zero(x) (pa_memzero(&(x), sizeof(x)))
+#define PA_INT_TYPE_SIGNED(type) (!!((type) 0 > (type) -1))
+
+#define PA_INT_TYPE_MAX(type) \
+ ((type) (PA_INT_TYPE_SIGNED(type) \
+ ? ~(~(type) 0 << (8*sizeof(type)-1)) \
+ : (type) -1))
+
+#define PA_INT_TYPE_MIN(type) \
+ ((type) (PA_INT_TYPE_SIGNED(type) \
+ ? (~(type) 0 << (8*sizeof(type)-1)) \
+ : (type) 0))
+
/* We include this at the very last place */
#include <pulsecore/log.h>