Skip to content

Commit 062e630

Browse files
committed
Create an emscripten-specific platform errors.h
1 parent 50c3b02 commit 062e630

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

libc/src/__support/StringUtil/platform_errors.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
#ifndef LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_PLATFORM_ERRORS_H
1010
#define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_PLATFORM_ERRORS_H
1111

12-
#if defined(__linux__) || defined(__Fuchsia__) || defined(__EMSCRIPTEN__)
12+
#if defined(__linux__) || defined(__Fuchsia__)
1313
#include "tables/linux_platform_errors.h"
14+
#elif defined(__EMSCRIPTEN__)
15+
#include "tables/emscripten_platform_errors.h"
1416
#else
1517
#include "tables/minimal_platform_errors.h"
1618
#endif
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//===-- Map of error numbers to strings for the Emscripten platform --*- 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_EMSCRPITEN_PLATFORM_ERRORS_H
10+
#define LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_EMSCRPITEN_PLATFORM_ERRORS_H
11+
12+
#include "posix_errors.h"
13+
#include "src/__support/macros/config.h"
14+
#include "stdc_errors.h"
15+
16+
namespace LIBC_NAMESPACE_DECL {
17+
18+
LIBC_INLINE_VAR constexpr auto PLATFORM_ERRORS =
19+
STDC_ERRORS + POSIX_ERRORS;
20+
21+
LIBC_INLINE_VAR constexpr auto PLATFORM_ERRNO_NAMES =
22+
STDC_ERRNO_NAMES + POSIX_ERRNO_NAMES;
23+
24+
} // namespace LIBC_NAMESPACE_DECL
25+
26+
#endif // LLVM_LIBC_SRC___SUPPORT_STRINGUTIL_TABLES_EMSCRPITEN_PLATFORM_ERRORS_H

libc/src/setjmp/wasm/sigsetjmp.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
//===-- Implementation of sigsetjmp ---------------------------------------===//
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+
19
#include "src/setjmp/sigsetjmp.h"
210
#include "hdr/offsetof_macros.h"
311
#include "src/__support/common.h"

0 commit comments

Comments
 (0)