Build doom on clipv2 and clip+
[kugel-rb.git] / apps / codecs / libmusepack / minimax.h
blob11926265678a3becdf9283a9a4230d13b7acc7f2
1 /*
2 * Musepack audio compression
3 * Copyright (C) 1999-2004 Buschmann/Klemm/Piecha/Wolf
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #pragma once
22 # define clip(x,min,max) ( (x) < (min) ? (min) : (x) > (max) ? (max) : (x) )
24 #ifdef __cplusplus
26 # define maxi(A,B) ( (A) >? (B) )
27 # define mini(A,B) ( (A) <? (B) )
28 # define maxd(A,B) ( (A) >? (B) )
29 # define mind(A,B) ( (A) <? (B) )
30 # define maxf(A,B) ( (A) >? (B) )
31 # define minf(A,B) ( (A) <? (B) )
33 #else
35 # define maxi(A,B) ( (A) > (B) ? (A) : (B) )
36 # define mini(A,B) ( (A) < (B) ? (A) : (B) )
37 # define maxd(A,B) ( (A) > (B) ? (A) : (B) )
38 # define mind(A,B) ( (A) < (B) ? (A) : (B) )
39 # define maxf(A,B) ( (A) > (B) ? (A) : (B) )
40 # define minf(A,B) ( (A) < (B) ? (A) : (B) )
42 #endif
44 #ifdef __GNUC__
46 # define absi(A) abs (A)
47 # define absf(A) fabsf (A)
48 # define absd(A) fabs (A)
50 #else
52 # define absi(A) ( (A) >= 0 ? (A) : -(A) )
53 # define absf(A) ( (A) >= 0.f ? (A) : -(A) )
54 # define absd(A) ( (A) >= 0. ? (A) : -(A) )
56 #endif