1 //===-- Map from signal numbers to strings ----------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_SIGNAL_TABLE_H 10 #define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_SIGNAL_TABLE_H 11 12 #include "src/__support/StringUtil/message_mapper.h" 13 14 #include "posix_signals.h" 15 #include "stdc_signals.h" 16 17 #if defined(__linux__) || defined(__Fuchsia__) 18 #define USE_LINUX_PLATFORM_SIGNALS 1 19 #else 20 #define USE_LINUX_PLATFORM_SIGNALS 0 21 #endif 22 23 #if USE_LINUX_PLATFORM_SIGNALS 24 #include "linux_extension_signals.h" 25 #endif 26 27 namespace LIBC_NAMESPACE::internal { 28 29 LIBC_INLINE_VAR constexpr auto PLATFORM_SIGNALS = []() { 30 if constexpr (USE_LINUX_PLATFORM_SIGNALS) { 31 return STDC_SIGNALS + POSIX_SIGNALS + LINUX_SIGNALS; 32 } else { 33 return STDC_SIGNALS; 34 } 35 }(); 36 37 } // namespace LIBC_NAMESPACE::internal 38 39 #endif // LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_SIGNAL_TABLE_H 40