Blender  V3.3
libc_compat.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2020 Blender Foundation. All rights reserved. */
3 
4 /* On Linux, precompiled libraries may be made with an glibc version that is
5  * incompatible with the system libraries that Blender is built on. To solve
6  * this we add a few -ffast-math symbols that can be missing. */
7 
12 #ifdef __linux__
13 # include <features.h>
14 # include <math.h>
15 # include <stdlib.h>
16 
17 # if defined(__GLIBC_PREREQ)
18 # if __GLIBC_PREREQ(2, 31)
19 
20 double __exp_finite(double x);
21 double __exp2_finite(double x);
22 double __acos_finite(double x);
23 double __asin_finite(double x);
24 double __log2_finite(double x);
25 double __log10_finite(double x);
26 double __log_finite(double x);
27 double __pow_finite(double x, double y);
28 float __expf_finite(float x);
29 float __exp2f_finite(float x);
30 float __acosf_finite(float x);
31 float __asinf_finite(float x);
32 float __log2f_finite(float x);
33 float __log10f_finite(float x);
34 float __logf_finite(float x);
35 float __powf_finite(float x, float y);
36 
37 double __exp_finite(double x)
38 {
39  return exp(x);
40 }
41 
42 double __exp2_finite(double x)
43 {
44  return exp2(x);
45 }
46 
47 double __acos_finite(double x)
48 {
49  return acos(x);
50 }
51 
52 double __asin_finite(double x)
53 {
54  return asin(x);
55 }
56 
57 double __log2_finite(double x)
58 {
59  return log2(x);
60 }
61 
62 double __log10_finite(double x)
63 {
64  return log10(x);
65 }
66 
67 double __log_finite(double x)
68 {
69  return log(x);
70 }
71 
72 double __pow_finite(double x, double y)
73 {
74  return pow(x, y);
75 }
76 
77 float __expf_finite(float x)
78 {
79  return expf(x);
80 }
81 
82 float __exp2f_finite(float x)
83 {
84  return exp2f(x);
85 }
86 
87 float __acosf_finite(float x)
88 {
89  return acosf(x);
90 }
91 
92 float __asinf_finite(float x)
93 {
94  return asinf(x);
95 }
96 
97 float __log2f_finite(float x)
98 {
99  return log2f(x);
100 }
101 
102 float __log10f_finite(float x)
103 {
104  return log10f(x);
105 }
106 
107 float __logf_finite(float x)
108 {
109  return logf(x);
110 }
111 
112 float __powf_finite(float x, float y)
113 {
114  return powf(x, y);
115 }
116 
117 # endif /* __GLIBC_PREREQ(2, 31) */
118 
119 # if __GLIBC_PREREQ(2, 34) && defined(WITH_LIBC_MALLOC_HOOK_WORKAROUND)
120 
121 extern void *(*__malloc_hook)(size_t __size, const void *);
122 extern void *(*__realloc_hook)(void *__ptr, size_t __size, const void *);
123 extern void *(*__memalign_hook)(size_t __alignment, size_t __size, const void *);
124 extern void (*__free_hook)(void *__ptr, const void *);
125 
126 void *(*__malloc_hook)(size_t __size, const void *) = NULL;
127 void *(*__realloc_hook)(void *__ptr, size_t __size, const void *) = NULL;
128 void *(*__memalign_hook)(size_t __alignment, size_t __size, const void *) = NULL;
129 void (*__free_hook)(void *__ptr, const void *) = NULL;
130 
131 # endif /* __GLIBC_PREREQ(2, 34) */
132 
133 # endif /* __GLIBC_PREREQ */
134 #endif /* __linux__ */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define logf(x)
Definition: cuda/compat.h:105
#define expf(x)
Definition: cuda/compat.h:106
#define powf(x, y)
Definition: cuda/compat.h:103
SyclQueue void void size_t num_bytes void
ccl_device_inline float3 exp(float3 v)
Definition: math_float3.h:392
ccl_device_inline float3 pow(float3 v, float e)
Definition: math_float3.h:533
ccl_device_inline float3 log(float3 v)
Definition: math_float3.h:397
#define asinf(x)
Definition: metal/compat.h:221
#define acosf(x)
Definition: metal/compat.h:222
INLINE Rall1d< T, V, S > asin(const Rall1d< T, V, S > &x)
Definition: rall1d.h:391
INLINE Rall1d< T, V, S > acos(const Rall1d< T, V, S > &x)
Definition: rall1d.h:399