|
1 | | -/* only under gcc (Linux)*/ |
2 | | -#if defined(__GNUC__) && (__linux__) |
3 | | - |
4 | | -/* for glibc version */ |
5 | | -#include <features.h> |
6 | | -#include <math.h> /* powf call */ |
7 | | - /* glibc redefined powf in 2.27, breaks compatibility with prior versions */ |
8 | | -#if (defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 27)) || (defined(__GNUC__) && (__GNUC__ <= 10)) |
9 | | - |
10 | | -/* 64 bit glibc powf was defined in 2.2.5 */ |
11 | | -#if __LP64__ |
12 | | -# define SYMVER "GLIBC_2.2.5" |
13 | | - |
14 | | -/* 32-bit glibc powf was defined in 2.0 */ |
15 | | -#else |
16 | | -# define SYMVER "GLIBC_2.0" |
17 | | - |
18 | | -/* endif Architecture check */ |
19 | | -#endif |
20 | | - |
21 | | -/* to replace the function with the old call */ |
22 | | -#define USE_OLD_SYM(F,V) __asm__(".symver " #F ", " #F "@" V) |
23 | | - |
24 | | -/* force powf to be from earlier compatible glibc */ |
25 | | -USE_OLD_SYM(powf,SYMVER); |
26 | | - |
27 | | -/* endif GLIBC >= 2.27 */ |
28 | | -#endif |
29 | | - |
30 | | -/* wrap the function requires gcc -Wl,--wrap=powf when linking */ |
31 | | -float __wrap_powf( float base, float exponent ) { |
32 | | - /* call into the supported version of powf */ |
33 | | - return powf(base, exponent); |
34 | | -} |
35 | | - |
36 | | -/* so gets reloaded if necessary */ |
37 | | -#undef _FEATURES_H |
38 | | - |
39 | | -/* endif gcc & linux */ |
40 | | -#endif |
| 1 | +/* only under gcc (Linux)*/ |
| 2 | +#if defined(__GNUC__) && (__linux__) |
| 3 | + |
| 4 | +/* for glibc version */ |
| 5 | +#include <features.h> |
| 6 | +#include <math.h> /* powf call */ |
| 7 | + /* glibc redefined powf in 2.27, breaks compatibility with prior versions */ |
| 8 | +#if (defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 27)) || (defined(__GNUC__) && (__GNUC__ <= 10)) |
| 9 | + |
| 10 | +/* 64 bit glibc powf was defined in 2.2.5 */ |
| 11 | +#if __LP64__ |
| 12 | +# define SYMVER "GLIBC_2.2.5" |
| 13 | + |
| 14 | +/* 32-bit glibc powf was defined in 2.0 */ |
| 15 | +#else |
| 16 | +# define SYMVER "GLIBC_2.0" |
| 17 | + |
| 18 | +/* endif Architecture check */ |
| 19 | +#endif |
| 20 | + |
| 21 | +/* to replace the function with the old call */ |
| 22 | +#define USE_OLD_SYM(F,V) __asm__(".symver " #F ", " #F "@" V) |
| 23 | + |
| 24 | +/* force powf to be from earlier compatible glibc */ |
| 25 | +USE_OLD_SYM(powf,SYMVER); |
| 26 | + |
| 27 | +/* endif GLIBC >= 2.27 */ |
| 28 | +#endif |
| 29 | + |
| 30 | +/* wrap the function requires gcc -Wl,--wrap=powf when linking */ |
| 31 | +float __wrap_powf( float base, float exponent ) { |
| 32 | + /* call into the supported version of powf */ |
| 33 | + return powf(base, exponent); |
| 34 | +} |
| 35 | + |
| 36 | +/* so gets reloaded if necessary */ |
| 37 | +#undef _FEATURES_H |
| 38 | + |
| 39 | +/* endif gcc & linux */ |
| 40 | +#endif |
0 commit comments