Blender
V5.0
intern
libc_compat
libc_compat.c
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2020 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
/* On Linux, precompiled libraries may be made with an glibc version that is
6
* incompatible with the system libraries that Blender is built on. To solve
7
* this we add a few -ffast-math symbols that can be missing. */
8
12
13
#ifdef __linux__
14
# include <features.h>
15
# include <math.h>
16
# include <stdlib.h>
17
18
# if defined(__GLIBC_PREREQ)
19
# if __GLIBC_PREREQ(2, 31)
20
21
double
__exp_finite(
double
x
);
22
double
__exp2_finite(
double
x
);
23
double
__acos_finite(
double
x
);
24
double
__asin_finite(
double
x
);
25
double
__log2_finite(
double
x
);
26
double
__log10_finite(
double
x
);
27
double
__log_finite(
double
x
);
28
double
__pow_finite(
double
x
,
double
y
);
29
double
__atan2_finite(
double
x
,
double
y
);
30
float
__expf_finite(
float
x
);
31
float
__exp2f_finite(
float
x
);
32
float
__acosf_finite(
float
x
);
33
float
__asinf_finite(
float
x
);
34
float
__log2f_finite(
float
x
);
35
float
__log10f_finite(
float
x
);
36
float
__logf_finite(
float
x
);
37
float
__powf_finite(
float
x
,
float
y
);
38
float
__atan2f_finite(
float
x
,
float
y
);
39
40
double
__exp_finite(
double
x
)
41
{
42
return
exp
(
x
);
43
}
44
45
double
__exp2_finite(
double
x
)
46
{
47
return
exp2
(
x
);
48
}
49
50
double
__acos_finite(
double
x
)
51
{
52
return
acos
(
x
);
53
}
54
55
double
__asin_finite(
double
x
)
56
{
57
return
asin
(
x
);
58
}
59
60
double
__log2_finite(
double
x
)
61
{
62
return
log2
(
x
);
63
}
64
65
double
__log10_finite(
double
x
)
66
{
67
return
log10(
x
);
68
}
69
70
double
__log_finite(
double
x
)
71
{
72
return
log
(
x
);
73
}
74
75
double
__pow_finite(
double
x
,
double
y
)
76
{
77
return
pow
(
x
,
y
);
78
}
79
80
double
__atan2_finite(
double
x
,
double
y
)
81
{
82
return
atan2
(
x
,
y
);
83
}
84
85
float
__expf_finite(
float
x
)
86
{
87
return
expf
(
x
);
88
}
89
90
float
__exp2f_finite(
float
x
)
91
{
92
return
exp2f(
x
);
93
}
94
95
float
__acosf_finite(
float
x
)
96
{
97
return
acosf
(
x
);
98
}
99
100
float
__asinf_finite(
float
x
)
101
{
102
return
asinf
(
x
);
103
}
104
105
float
__log2f_finite(
float
x
)
106
{
107
return
log2f(
x
);
108
}
109
110
float
__log10f_finite(
float
x
)
111
{
112
return
log10f(
x
);
113
}
114
115
float
__logf_finite(
float
x
)
116
{
117
return
logf
(
x
);
118
}
119
120
float
__powf_finite(
float
x
,
float
y
)
121
{
122
return
powf
(
x
,
y
);
123
}
124
125
float
__atan2f_finite(
float
x
,
float
y
)
126
{
127
return
atan2f
(
x
,
y
);
128
}
129
130
# endif
/* __GLIBC_PREREQ(2, 31) */
131
132
# if __GLIBC_PREREQ(2, 34) && defined(WITH_LIBC_MALLOC_HOOK_WORKAROUND)
133
134
extern
void
*(*__malloc_hook)(
size_t
__size,
const
void
*);
135
extern
void
*(*__realloc_hook)(
void
*__ptr,
size_t
__size,
const
void
*);
136
extern
void
*(*__memalign_hook)(
size_t
__alignment,
size_t
__size,
const
void
*);
137
extern
void (*__free_hook)(
void
*__ptr,
const
void
*);
138
139
void
*(*__malloc_hook)(
size_t
__size,
const
void
*) = NULL;
140
void
*(*__realloc_hook)(
void
*__ptr,
size_t
__size,
const
void
*) = NULL;
141
void
*(*__memalign_hook)(
size_t
__alignment,
size_t
__size,
const
void
*) = NULL;
142
void (*__free_hook)(
void
*__ptr,
const
void
*) = NULL;
143
144
# endif
/* __GLIBC_PREREQ(2, 34) */
145
146
# endif
/* __GLIBC_PREREQ */
147
#endif
/* __linux__ */
x
x
Definition
BLI_expr_pylike_eval_test.cc:345
y
y
Definition
compositor_morphological_blur_infos.hh:22
logf
#define logf(x)
Definition
device/cuda/compat.h:94
expf
#define expf(x)
Definition
device/cuda/compat.h:95
powf
#define powf(x, y)
Definition
device/cuda/compat.h:92
asinf
#define asinf(x)
Definition
device/metal/compat.h:265
acosf
#define acosf(x)
Definition
device/metal/compat.h:266
log
#define log
Definition
gpu_shader_cxx_builtin.hh:114
exp2
#define exp2
Definition
gpu_shader_cxx_builtin.hh:108
pow
#define pow
Definition
gpu_shader_cxx_builtin.hh:117
exp
#define exp
Definition
gpu_shader_cxx_builtin.hh:107
log2
#define log2
Definition
gpu_shader_cxx_builtin.hh:115
asin
#define asin
Definition
gpu_shader_cxx_builtin.hh:124
acos
#define acos
Definition
gpu_shader_cxx_builtin.hh:122
atan2
ccl_device_inline float3 atan2(const float3 y, const float3 x)
Definition
math_float3.h:491
atan2f
#define atan2f
Generated on
for Blender by
doxygen
1.16.1