From 57fb77134b319c6f7eaf262c561082fcae49c1a3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 24 Aug 2009 17:01:44 +0200 Subject: remap: fix build for non-x86 builds --- src/pulsecore/remap_mmx.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pulsecore') diff --git a/src/pulsecore/remap_mmx.c b/src/pulsecore/remap_mmx.c index bfcae6c5..00252dac 100644 --- a/src/pulsecore/remap_mmx.c +++ b/src/pulsecore/remap_mmx.c @@ -95,6 +95,7 @@ "4: \n\t" \ " emms \n\t" +#if defined (__i386__) || defined (__amd64__) static void remap_mono_to_stereo_mmx (pa_remap_t *m, void *dst, const void *src, unsigned n) { pa_reg_x86 temp; @@ -138,6 +139,7 @@ static void init_remap_mmx (pa_remap_t *m) { pa_log_info("Using MMX mono to stereo remapping"); } } +#endif /* defined (__i386__) || defined (__amd64__) */ void pa_remap_func_init_mmx (pa_cpu_x86_flag_t flags) { #if defined (__i386__) || defined (__amd64__) -- cgit From 827ae07c1ec73c8fe48dc4182726c38c3e9c992f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 26 Aug 2009 01:41:34 +0200 Subject: macro: add PA_CLIP_SUB() for saturated subtraction --- src/pulsecore/macro.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/pulsecore') 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; -- cgit