mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibC: Add barebones <complex.h>
This commit is contained in:
parent
8a007e755d
commit
3f0be4e9ea
Notes:
sideshowbarker
2024-07-17 10:42:44 +09:00
Author: https://github.com/petelliott
Commit: 3f0be4e9ea
Pull-request: https://github.com/SerenityOS/serenity/pull/14059
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/BertalanD
Reviewed-by: https://github.com/EWouters
Reviewed-by: https://github.com/gmta
3 changed files with 91 additions and 0 deletions
46
Userland/Libraries/LibC/complex.cpp
Normal file
46
Userland/Libraries/LibC/complex.cpp
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Peter Elliott <pelliott@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <complex.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
// Function definitions of this form "type (name)(args)" are intentional, to
|
||||
// prevent macro versions of "name" from being incorrectly expanded. These
|
||||
// functions are here to provide external linkage to their macro implementations.
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/creal.html
|
||||
float(crealf)(float complex z)
|
||||
{
|
||||
return crealf(z);
|
||||
}
|
||||
|
||||
double(creal)(double complex z)
|
||||
{
|
||||
return creal(z);
|
||||
}
|
||||
|
||||
long double(creall)(long double complex z)
|
||||
{
|
||||
return creall(z);
|
||||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/cimag.html
|
||||
double(cimag)(double complex z)
|
||||
{
|
||||
return cimag(z);
|
||||
}
|
||||
|
||||
float(cimagf)(float complex z)
|
||||
{
|
||||
return cimagf(z);
|
||||
}
|
||||
|
||||
long double(cimagl)(long double complex z)
|
||||
{
|
||||
return cimagl(z);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue