360 changes: 0 additions & 360 deletions libc/include/math.h

This file was deleted.

16 changes: 16 additions & 0 deletions libc/include/math.h.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===----------------- C standard library header math.h -----------------*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_MATH_H
#define LLVM_LIBC_MATH_H

#include <__llvm-libc-common.h>

%%public_api()

#endif // LLVM_LIBC_MATH_H
19 changes: 16 additions & 3 deletions libc/spec/stdc.td
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,28 @@ def StdC : StandardSpec<"stdc"> {

HeaderSpec Math = HeaderSpec<
"math.h",
[], // Macros
[
Macro<"MATH_ERRNO">,
Macro<"MATH_ERREXCEPT">,
Macro<"math_errhandling">,

Macro<"INFINITY">,
Macro<"NAN">,

Macro<"isfinite">,
Macro<"isinf">,
Macro<"isnan">,
],
[
NamedType<"float_t">,
NamedType<"double_t">,
],
[], // Enumerations
[
FunctionSpec<"acos", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
FunctionSpec<"acosl", RetValSpec<LongDoubleType>, [ArgSpec<LongDoubleType>]>,
FunctionSpec<"cosf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
FunctionSpec<"sinf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,

FunctionSpec<"round", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
]
>;

Expand Down