SimpleMacroDef<"MATH_ERREXCEPT", "2">,
MathErrHandlingMacro,
+ SimpleMacroDef<"HUGE_VAL", "__builtin_huge_val()">,
SimpleMacroDef<"INFINITY", "__builtin_inff()">,
SimpleMacroDef<"NAN", "__builtin_nanf(\"\")">,
def SignalAPI : PublicAPI<"signal.h"> {
let Types = [
+ "sig_atomic_t",
"sigset_t",
"struct sigaction",
"union sigval",
../config/${LIBC_TARGET_OS}/signal.h.in
DEPENDS
.llvm-libc-macros.signal_macros
- .llvm-libc-types.struct_sigaction
.llvm-libc-types.__sighandler_t
- .llvm-libc-types.stack_t
.llvm-libc-types.sigset_t
+ .llvm-libc-types.sig_atomic_t
+ .llvm-libc-types.stack_t
+ .llvm-libc-types.struct_sigaction
.llvm-libc-types.pid_t
)
DEPENDS
.llvm_libc_common_h
.llvm-libc-macros.file_seek_macros
+ .llvm-libc-macros.stdio_macros
.llvm-libc-types.cookie_io_functions_t
.llvm-libc-types.FILE
.llvm-libc-types.size_t
)
add_header(
+ stdio_macros
+ HDR
+ stdio-macros.h
+)
+
+add_header(
stdlib_macros
HDR
stdlib-macros.h
#define WTERMSIG(status) (((status)&0x7F))
#define WIFEXITED(status) (WTERMSIG(status) == 0)
#define WEXITSTATUS(status) (((status)&0xFF00) >> 8)
+#define WIFSIGNALED(status) \
+ ((WTERMSIG(status) < 0x7F) && (WTERMSIG(status) > 0))
#endif // __LLVM_LIBC_MACROS_LINUX_SYS_WAIT_MACROS_H
--- /dev/null
+//===-- Macros defined in stdio.h header file -----------------------------===//
+//
+// 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_MACROS_STDIO_MACROS_H
+#define __LLVM_LIBC_MACROS_STDIO_MACROS_H
+
+#define BUFSIZ 1024
+
+#endif // __LLVM_LIBC_MACROS_STDIO_MACROS_H
#ifndef __LLVM_LIBC_MACROS_STDLIB_MACROS_H
#define __LLVM_LIBC_MACROS_STDLIB_MACROS_H
+#ifndef NULL
+#define __need_NULL
+#include <stddef.h>
+#endif // NULL
+
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+
#define RAND_MAX 32767
#endif // __LLVM_LIBC_MACROS_STDLIB_MACROS_H
add_header(struct_dirent HDR struct_dirent.h DEPENDS .ino_t .off_t)
add_header(union_sigval HDR union_sigval.h)
add_header(siginfo_t HDR siginfo_t.h DEPENDS .union_sigval .pid_t .uid_t)
+add_header(sig_atomic_t HDR sig_atomic_t.h)
add_header(sigset_t HDR sigset_t.h DEPENDS libc.include.llvm-libc-macros.signal_macros)
add_header(struct_sigaction HDR struct_sigaction.h DEPENDS .sigset_t .siginfo_t)
add_header(struct_timespec HDR struct_timespec.h DEPENDS .time_t)
--- /dev/null
+//===-- Definition of sig_atomic_t type -----------------------------------===//
+//
+// 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_TYPES_SIG_ATOMIC_T_H__
+#define __LLVM_LIBC_TYPES_SIG_ATOMIC_T_H__
+
+typedef int sig_atomic_t;
+
+#endif // __LLVM_LIBC_TYPES_SIG_ATOMIC_T_H__
#include <__llvm-libc-common.h>
#include <llvm-libc-macros/file-seek-macros.h>
+#include <llvm-libc-macros/stdio-macros.h>
%%public_api()
Macro<"MATH_ERREXCEPT">,
Macro<"math_errhandling">,
+ Macro<"HUGE_VAL">,
Macro<"INFINITY">,
Macro<"NAN">,
]
>;
+ NamedType SigAtomicT = NamedType<"sig_atomic_t">;
HeaderSpec Signal = HeaderSpec<
"signal.h",
[
],
[
SizeTType,
+ SigAtomicT,
SigHandlerT,
],
[], // Enumerations