LibC: Fix duplicated function symbols

Commit cccb6c7287 has moved some function
definitions into complex.h. The functions were marked inline, but not
static, so a symbol definition was emited for them in any compilation
unit that included complex.h. If multiple such compilation units get
linked into the same binary, we get a duplicate symbol error.

Fix this by declaring the functions static inline.
This commit is contained in:
Sergey Bugaev 2023-07-23 15:29:31 +03:00 committed by Andrew Kaster
parent 005184e4a4
commit 8c8ba4cfe4
Notes: sideshowbarker 2024-07-17 01:46:00 +09:00

View file

@ -43,33 +43,33 @@ __BEGIN_DECLS
// functions are here to provide external linkage to their macro implementations.
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/creal.html
inline float(crealf)(float complex z)
static inline float(crealf)(float complex z)
{
return crealf(z);
}
inline double(creal)(double complex z)
static inline double(creal)(double complex z)
{
return creal(z);
}
inline long double(creall)(long double complex z)
static inline long double(creall)(long double complex z)
{
return creall(z);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/cimag.html
inline double(cimag)(double complex z)
static inline double(cimag)(double complex z)
{
return cimag(z);
}
inline float(cimagf)(float complex z)
static inline float(cimagf)(float complex z)
{
return cimagf(z);
}
inline long double(cimagl)(long double complex z)
static inline long double(cimagl)(long double complex z)
{
return cimagl(z);
}