Fixmath  1.4
fixmath_arch.h
Go to the documentation of this file.
1 /* Copyright (C) 2005-2011, Axis Communications AB, LUND, SWEDEN
2  *
3  * This file is part of Fixmath.
4  *
5  * Fixmath is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published
7  * by the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  * You can use the comments under either the terms of the GNU Lesser General
10  * Public License version 3 as published by the Free Software Foundation,
11  * either version 3 of the License or (at your option) any later version, or
12  * the GNU Free Documentation License version 1.3 or any later version
13  * published by the Free Software Foundation; with no Invariant Sections, no
14  * Front-Cover Texts, and no Back-Cover Texts.
15  * A copy of the license is included in the documentation section entitled
16  * "GNU Free Documentation License".
17  *
18  * Fixmath is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public
24  * License and a copy of the GNU Free Documentation License along
25  * with Fixmath. If not, see <http://www.gnu.org/licenses/>.
26  */
27 
33 #ifndef FIXMATH_ARCH_H
34 #define FIXMATH_ARCH_H
35 
36 #ifndef FIXMATH_H
37 #error "Do not include this file directly - use fixmath.h instead!"
38 #endif /* !FIXMATH_H */
39 
40 /*
41  * Set GCC-specific built-in functions.
42  */
43 #ifdef __GNUC__
44 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
45 #define fx_clz __builtin_clz
46 #define fx_ctz __builtin_ctz
47 #define fx_bitcount __builtin_popcount
48 #endif /* __GNUC__ > 3 ... */
49 #endif /* __GNUC__ */
50 
51 #endif /* FIXMATH_ARCH_H */