diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8a6c241 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Preserve upstream document bytes and original whitespace on every platform. +upstream/** -text -whitespace diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4be85f7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,88 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + mcpp: + name: mcpp (${{ matrix.os }}, ${{ matrix.toolchain }}${{ matrix.args && format(', {0}', matrix.args) || '' }}) + strategy: + fail-fast: false + matrix: + # Each C library with each C++ standard library mcpp builds against. + include: + - { os: ubuntu-24.04, toolchain: 'gcc@16.1.0' } # glibc, libstdc++ + - { os: ubuntu-24.04, toolchain: 'gcc@16.1.0', args: '--target x86_64-linux-musl' } # musl, libstdc++ + - { os: ubuntu-24.04, toolchain: 'llvm@23.1.3' } # glibc, libc++ + - { os: ubuntu-24.04, toolchain: 'llvm@23.1.3', args: '--target x86_64-openkal --platform openkal-platform@0.24.0' } # openkal-musl, libc++ + - { os: macos-15, toolchain: 'llvm@23.1.3' } # libSystem, libc++ + - { os: windows-2025, toolchain: 'llvm@23.1.3' } # the Windows CRT + - { os: windows-2025, toolchain: 'msvc@system' } # the Windows CRT, the MSVC STL + - { os: windows-2025, toolchain: 'llvm@23.1.3', args: '--target x86_64-windows-gnu' } # mingw-w64 + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + defaults: + run: + shell: bash + env: + XLINGS_NON_INTERACTIVE: 1 + ARGS: ${{ matrix.args }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Mwrap identity and bilingual README contract + run: python3 tools/check_mwrap_release.py + + - name: Install Xlings (Linux/macOS) + if: runner.os != 'Windows' + run: | + curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/refs/heads/main/tools/other/quick_install.sh | bash + echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" + + - name: Install Xlings (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + irm https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.ps1 | iex + "$env:USERPROFILE\.xlings\subos\current\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Install project tools (.xlings.json) + run: | + for attempt in 1 2 3; do + xlings update > /dev/null 2>&1 || true + if xlings install; then break; fi + [ "$attempt" = 3 ] && exit 1 + sleep 30 + done + mcpp --version + + - name: Select the toolchain + run: | + name="${{ matrix.toolchain }}" + [ "$name" = msvc@system ] || mcpp toolchain install "${name%@*}" "${name#*@}" + mcpp toolchain default "$name" + + - name: Build the modules + run: mcpp build $ARGS + + - name: Tests (the streams, errno, the stdio constants, limits, the function-like macros, every mapping against its macro, header mixing) + run: mcpp test $ARGS + + - name: Mapping audit (the macros as clang reads them on this host) + if: startsWith(matrix.toolchain, 'llvm') && !matrix.args + run: python3 tools/generate.py --check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f0c6447 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Release +on: + push: + tags: ["mwrap-*"] +permissions: + contents: read +jobs: + publish: + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: write + actions: read + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Check tag, upstream version and bilingual entry pages + run: python3 tools/check_mwrap_release.py --tag "$GITHUB_REF_NAME" + - name: Require successful source CI at this exact commit + env: + GH_TOKEN: ${{ github.token }} + shell: bash + run: | + set -euo pipefail + result=$(gh run list --repo "$GITHUB_REPOSITORY" --workflow ci.yml --commit "$GITHUB_SHA" --limit 1 --json status,conclusion --jq '.[0] | .status == "completed" and .conclusion == "success"') + test "$result" = true || { echo 'No successful source CI at the tag commit'; exit 1; } + - name: Build immutable source asset and publish + env: + GH_TOKEN: ${{ github.token }} + shell: bash + run: | + set -euo pipefail + version="${GITHUB_REF_NAME#mwrap-}" + repo="${GITHUB_REPOSITORY#*/}" + asset="${repo}-${version}.tar.gz" + git archive --format=tar.gz --prefix="${repo}-${version}/" "$GITHUB_SHA" > "$RUNNER_TEMP/$asset" + (cd "$RUNNER_TEMP" && sha256sum "$asset" > "$asset.sha256") + if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then + echo 'Release already exists; refusing to change immutable assets'; exit 1 + fi + extra=() + if [[ "$version" == *-rc* ]]; then extra+=(--prerelease); fi + gh release create "$GITHUB_REF_NAME" "$RUNNER_TEMP/$asset" "$RUNNER_TEMP/$asset.sha256" \ + --repo "$GITHUB_REPOSITORY" --verify-tag --title "$repo $version" \ + --notes "Module wrapper for upstream $version. New mwrap package identities become installable after mcpp-index publication; see the bilingual README for the tested support scope." "${extra[@]}" diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml new file mode 100644 index 0000000..4bcfe74 --- /dev/null +++ b/.github/workflows/templates.yml @@ -0,0 +1,28 @@ +name: Actual project templates +on: + push: + branches: [main] + pull_request: + workflow_dispatch: +permissions: + contents: read +concurrency: + group: templates-${{ github.ref }} + cancel-in-progress: true +env: + MCPP_VERSION: "2026.11.5.1" +jobs: + templates: + runs-on: ubuntu-24.04 + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - name: Install the pinned mcpp + shell: bash + run: | + archive="mcpp-${MCPP_VERSION}-linux-x86_64.tar.gz" + curl -L -fsS -o "$archive" "https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/$archive" + tar -xzf "$archive" + echo "$PWD/mcpp-${MCPP_VERSION}-linux-x86_64/bin" >> "$GITHUB_PATH" + - name: Actual scaffold, strict build and run of the default template + run: python3 tools/test_template.py --toolchain gcc@16.1.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7c7b405 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +target/ +.mcpp/ +mcpp.lock +compile_commands.json +__pycache__/ +.xlings/ diff --git a/.xlings.json b/.xlings.json new file mode 100644 index 0000000..0ee91fd --- /dev/null +++ b/.xlings.json @@ -0,0 +1,5 @@ +{ + "workspace": { + "xim:mcpp": "2026.11.5.1" + } +} diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..aeefa68 --- /dev/null +++ b/NOTICE @@ -0,0 +1,9 @@ +libc-m: C++ module wrapper +Copyright (c) 2026 mcpp-community contributors + +The wrapper contributions are licensed under the Apache License, Version 2.0. +The upstream is the ISO C standard (ISO/IEC 9899:2018), whose library summary +names the macros this package maps; no text of the standard is included. The +implementation is the target's C library, under its own license, and the +function-like macros of include/mwrap/libc/macros.hpp are that library's own +definitions, reached through its headers. diff --git a/README.md b/README.md index e0b8e55..cc5ca0d 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,9 @@ target leaves out (`FP_FAST_FMA` where `fma` is not fast) is not mapped there. POSIX names that ISO C does not have (`ENOENT`, `EACCES` …) are not mapped: `std::errc` gives them portably. `NULL` is `nullptr`. The function-like macros that no function can replace stay macros in ``, which -includes the five headers that define them; in a unit that includes it, the -object-like macros of those headers (`SIZE_MAX` …) are active and are used as -macros ([docs/usage.md](docs/usage.md)). +includes the five headers that define them and then undefines every +object-like macro of ISO C, so the mapped names work in that unit on every C +library ([docs/usage.md](docs/usage.md)). ## Build and testing diff --git a/README.zh.md b/README.zh.md new file mode 100644 index 0000000..75626f6 --- /dev/null +++ b/README.zh.md @@ -0,0 +1,72 @@ +# libc + +> C 标准库(ISO C17)以 C++23 模块提供,其宏成为 C++ 名字。 + +[English](README.md) · **简体中文** · [上游](https://www.iso.org/standard/74528.html) · [发布](https://github.com/mcpplibs/libc-m/releases) · [mcpp](https://github.com/mcpp-community/mcpp) · [索引](https://github.com/mcpplibs/mcpp-index) + +[![C++23](https://img.shields.io/badge/C%2B%2B-23-blue.svg)](https://en.cppreference.com/w/cpp/23) +[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE) +[![mcpp-community](https://img.shields.io/badge/mcpp--community-mwrap-blue)](https://github.com/mcpp-community) +[![CI](https://github.com/mcpplibs/libc-m/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mcpplibs/libc-m/actions/workflows/ci.yml) + +`import std.compat` 给 C++ 程序提供 C 库的函数与类型,但不提供宏:命名模块不能导出宏,而 `stdout`、`errno`、`EOF`、 +`BUFSIZ`、`INT_MAX` 在每个 C 库中都是宏。本包把 ISO C17 的对象宏以原名映射:常量为 `inline constexpr`,其余(`stdout`、 +`errno`、`MB_CUR_MAX` 等)为返回宏表达式的函数。本包不实现任何东西:实现是目标的 C 库;版本 17.0.0 指所依据的标准 +(ISO/IEC 9899:2018,C++23 规范性引用的版本)。 + +## 模块 + +- `import mcpplibs.mwrap.libc;`:重新导出 `std.compat`,以及宏模块 +- `import mcpplibs.mwrap.libc.macros;`:`stdout()`、`stderr()`、`stdin()`、`errno()`、`EOF`、`BUFSIZ`、`SEEK_SET`、`EDOM`、`ERANGE`、`EILSEQ`、`CHAR_BIT`、`INT_MAX`、`SIZE_MAX`、`DBL_EPSILON`、`PRId64`、`EXIT_FAILURE`、`LC_ALL`、`SIGINT` 等,位于 `mcpplibs::mwrap::libc::macros` +- `#include `:`assert`、`setjmp`、`va_start` … `va_end`、`offsetof`、`INT64_C` 等,即 C 库自己的定义 + +> 更多模块 API -> [用法与 API](docs/usage.md) + +## 快速开始 + +```sh +mcpp new stdio --template mcpplibs.mwrap.libc@17.0.0 +cd stdio +mcpp run +``` + +默认模板用 C stdio 打开一个文件,打不开时报告 C 库的 `errno()` 与 `strerror`,并打印几个极限值。 + +```toml +[dependencies] +"mcpplibs.mwrap.libc" = "17.0.0" +``` + +```cpp +import mcpplibs.mwrap.libc; + +namespace c = mcpplibs::mwrap::libc::macros; + +int main() { + std::fprintf(c::stderr(), "BUFSIZ is %d\n", int(c::BUFSIZ)); + c::errno() = 0; + std::strtol("99999999999999999999", nullptr, 10); + return c::errno() == c::ERANGE ? c::EXIT_SUCCESS : c::EXIT_FAILURE; +} +``` + +## 映射范围 + +ISO C17 库摘要(附录 B)中目标所定义的每个对象宏:``、``、``、``、``、 +``、``、``、``、``、``、``、`` 中共 334 个名字。 +目标未定义的宏(例如 `fma` 不快时的 `FP_FAST_FMA`)在该目标上不映射。ISO C 没有的 POSIX 名字(`ENOENT`、`EACCES` 等) +不映射:`std::errc` 可移植地给出它们。`NULL` 即 `nullptr`。无法用函数替代的函数式宏保留在 ``, +它包含定义这些宏的五个头文件,随后取消定义 ISO C 的全部对象宏,使映射后的名字在该翻译单元中于每种 C 库上都可用 +([docs/usage.md](docs/usage.md))。 + +## 构建与测试 + +CI 在 mcpp 所面向的每种 C 库与每种 C++ 标准库组合上构建并测试:glibc 加 libstdc++ 与 libc++、musl、openkal-musl(经 +okrun 运行)、macOS libSystem、Windows CRT 加 libc++ 与 MSVC STL、mingw-w64。测试经 `stdout()` 与 `stderr()` 写出,读取 C 库 +设置的 `errno()`,在临时文件上使用 stdio 常量,调用函数式宏,在该目标上比较每个映射与其宏,并混用头文件与模块。映射审计 +([tools/generate.py](tools/generate.py) `--check`)由 [tools/iso_c.toml](tools/iso_c.toml) 重新生成映射,并在每个 LLVM +宿主上检查被归为常量的宏在该宿主上确为常量。另一个作业把默认模板当作已安装的包生成项目并运行。 + +## 许可 + +包装部分为 [Apache-2.0](LICENSE),作者 mcpp-community([NOTICE](NOTICE))。各目标的 C 库仍遵循其自身的许可。 diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 0000000..5c519ec --- /dev/null +++ b/docs/usage.md @@ -0,0 +1,78 @@ +# Usage and API + +`mcpplibs.mwrap.libc` 17.0.0 maps the object-like macros of ISO C17 for C++ +modules. This page lists what the modules hold, how each macro is mapped, and +how the package relates to `std.compat` and to the C headers. + +## Modules + +| Module | Holds | +|---|---| +| `mcpplibs.mwrap.libc` | `export import std.compat;` (the functions and types of the C library, in `std` and in the global namespace) and `export import mcpplibs.mwrap.libc.macros;` | +| `mcpplibs.mwrap.libc.macros` | in `mcpplibs::mwrap::libc::macros`, every object-like macro of ISO C17 Annex B that the target defines (tools/iso_c.toml lists the 334 names by header) | + +## How a macro is mapped + +- **A constant expression** is an `inline constexpr` of the same name and + value: `EOF`, `BUFSIZ`, `SEEK_SET`, `EDOM`, `ERANGE`, `EILSEQ`, `CHAR_BIT`, + `INT_MAX`, `SIZE_MAX`, the `` limits, `PRId64` and the other format + strings (a `const char*`), `EXIT_SUCCESS`, `LC_ALL`, `SIGINT`, `CLOCKS_PER_SEC` …. +- **Anything else** is a function of the same name, `constexpr` and returning + the macro's expression (`decltype(auto)`): + - `errno()` is the C library's error number, an `int&`: `errno() = 0` clears it; + - `stdin()`, `stdout()`, `stderr()` are the streams (`std::FILE*`); + - `MB_CUR_MAX()` follows the locale; `SIG_ERR()`, `SIG_IGN()` and + `FE_DFL_ENV()` are pointers that are not constants where glibc spells them; + - `INFINITY()`, `NAN()`, `HUGE_VAL()`, `HUGE_VALF()`, `HUGE_VALL()`, + `math_errhandling()`, `FLT_ROUNDS()` and `FLT_EVAL_METHOD()` are constants + with some C libraries and not with others (the Windows CRT, macOS), so they + take the function form everywhere (tools/surface.toml). Where the target + allows, the call is a constant expression; `std::numeric_limits` gives + `infinity()` and `quiet_NaN()` as constants on every target. +- **A macro the target does not define** is not mapped there: `FP_FAST_FMA`, + `FP_FAST_FMAF` and `FP_FAST_FMAL` exist where `fma` is fast, and a `FE_*` + exception or rounding mode exists where the hardware has it. Test with + `requires { mcpplibs::mwrap::libc::macros::FP_FAST_FMA(); }`. + +tests/macros.cpp compares every mapping with its macro on each target: values +equal, and `errno()` and the streams the same objects. + +## What is not mapped + +| Macros | Reason | +|---|---| +| `ENOENT`, `EACCES`, `ENOEXEC`, `EPIPE` and the other POSIX error numbers | not ISO C; their values differ between C libraries. `std::errc` names them portably: `std::make_error_code(std::errc::no_such_file_or_directory)` | +| `NULL` | C++ has `nullptr` | +| ``, `` | in C++ these headers are C++'s (`std::complex`, the overloads of ``) | +| ``, ``, ``, `` | their macros spell C++ keywords and attributes | +| ``, `` | C++ has `std::atomic` and `std::thread` | +| `fpclassify`, `isnan`, `signbit`, `isgreater` … | functions of `` in C++ (`std::isnan`) | +| `__STDC_*` | predefined by the compiler | +| Annex K (`L_tmpnam_s`, `RSIZE_MAX` …) | optional; the C libraries targeted here do not provide it | + +## The function-like macros + +`assert`, `setjmp`, `va_start`, `va_arg`, `va_copy`, `va_end`, `offsetof` and +`INT8_C` … `UINTMAX_C` take a type or a member name, act at the call site, or +must be macros by the standard. `` includes the five +headers that define them (``, ``, ``, +``, ``), so they are the C library's own. Include it before +the import. Those headers also define object-like macros, and which ones +differs between C libraries: the Windows CRT's `` defines `errno`, +and macOS's headers bring `MB_CUR_MAX` and `NAN`. A macro expands even inside a +qualified name, so the header undefines every object-like macro of +tools/iso_c.toml after the includes: in the unit, `errno()` and `SIZE_MAX` are +the mapped names on every target. A C header included later in the same unit +is already included and defines nothing again. + +A unit that includes a C header itself, beside the module, has that header's +macros active; it uses them as macros, or reads their values under other names +and `#undef`s them before naming the mapped ones (tests/header_mix_test.cpp). + +## The implementation + +The package has no sources and no dependency: the C library is the target's, +as mcpp selects it (glibc, musl, openkal-musl, the Windows CRT, macOS +libSystem, mingw-w64). The version names the standard: 17.0.0 is ISO/IEC +9899:2018, which C++23 references normatively. A release for C23, when C++ +references it, will be 23.0.0. diff --git a/include/mwrap/libc/macros.hpp b/include/mwrap/libc/macros.hpp new file mode 100644 index 0000000..92d7e1a --- /dev/null +++ b/include/mwrap/libc/macros.hpp @@ -0,0 +1,357 @@ +// --- the function-like macros of ISO C17 that no function can stand +// in for: assert (), setjmp (), va_arg, va_copy, va_end, va_start +// (), offsetof (), INT8_C, INT16_C, INT32_C, INT64_C, UINT8_C, +// UINT16_C, UINT32_C, UINT64_C, INTMAX_C, UINTMAX_C (). +// They take a type or a member name, act at the call site, or must be macros by the +// standard, so they stay macros, as the target's C library defines them: this header +// includes the headers that define them. Include it before `import mcpplibs.mwrap.libc;`. +// +// Those headers also define object-like macros, and which ones differs between C libraries +// (the Windows CRT's defines errno; macOS's headers bring MB_CUR_MAX and NAN). +// Each object-like macro of ISO C is undefined after them, so that the unit names it as +// mcpplibs::mwrap::libc::macros does on every target. Written by tools/generate.py. +#ifndef MWRAP_LIBC_MACROS_HPP +#define MWRAP_LIBC_MACROS_HPP + +#include +#include +#include +#include +#include + +#undef EDOM +#undef EILSEQ +#undef ERANGE +#undef errno +#undef FE_DIVBYZERO +#undef FE_INEXACT +#undef FE_INVALID +#undef FE_OVERFLOW +#undef FE_UNDERFLOW +#undef FE_ALL_EXCEPT +#undef FE_DOWNWARD +#undef FE_TONEAREST +#undef FE_TOWARDZERO +#undef FE_UPWARD +#undef FE_DFL_ENV +#undef FLT_ROUNDS +#undef FLT_EVAL_METHOD +#undef FLT_HAS_SUBNORM +#undef DBL_HAS_SUBNORM +#undef LDBL_HAS_SUBNORM +#undef FLT_RADIX +#undef DECIMAL_DIG +#undef FLT_MANT_DIG +#undef DBL_MANT_DIG +#undef LDBL_MANT_DIG +#undef FLT_DECIMAL_DIG +#undef DBL_DECIMAL_DIG +#undef LDBL_DECIMAL_DIG +#undef FLT_DIG +#undef DBL_DIG +#undef LDBL_DIG +#undef FLT_MIN_EXP +#undef DBL_MIN_EXP +#undef LDBL_MIN_EXP +#undef FLT_MIN_10_EXP +#undef DBL_MIN_10_EXP +#undef LDBL_MIN_10_EXP +#undef FLT_MAX_EXP +#undef DBL_MAX_EXP +#undef LDBL_MAX_EXP +#undef FLT_MAX_10_EXP +#undef DBL_MAX_10_EXP +#undef LDBL_MAX_10_EXP +#undef FLT_MAX +#undef DBL_MAX +#undef LDBL_MAX +#undef FLT_EPSILON +#undef DBL_EPSILON +#undef LDBL_EPSILON +#undef FLT_MIN +#undef DBL_MIN +#undef LDBL_MIN +#undef FLT_TRUE_MIN +#undef DBL_TRUE_MIN +#undef LDBL_TRUE_MIN +#undef PRId8 +#undef PRId16 +#undef PRId32 +#undef PRId64 +#undef PRIdLEAST8 +#undef PRIdLEAST16 +#undef PRIdLEAST32 +#undef PRIdLEAST64 +#undef PRIdFAST8 +#undef PRIdFAST16 +#undef PRIdFAST32 +#undef PRIdFAST64 +#undef PRIdMAX +#undef PRIdPTR +#undef PRIi8 +#undef PRIi16 +#undef PRIi32 +#undef PRIi64 +#undef PRIiLEAST8 +#undef PRIiLEAST16 +#undef PRIiLEAST32 +#undef PRIiLEAST64 +#undef PRIiFAST8 +#undef PRIiFAST16 +#undef PRIiFAST32 +#undef PRIiFAST64 +#undef PRIiMAX +#undef PRIiPTR +#undef PRIo8 +#undef PRIo16 +#undef PRIo32 +#undef PRIo64 +#undef PRIoLEAST8 +#undef PRIoLEAST16 +#undef PRIoLEAST32 +#undef PRIoLEAST64 +#undef PRIoFAST8 +#undef PRIoFAST16 +#undef PRIoFAST32 +#undef PRIoFAST64 +#undef PRIoMAX +#undef PRIoPTR +#undef PRIu8 +#undef PRIu16 +#undef PRIu32 +#undef PRIu64 +#undef PRIuLEAST8 +#undef PRIuLEAST16 +#undef PRIuLEAST32 +#undef PRIuLEAST64 +#undef PRIuFAST8 +#undef PRIuFAST16 +#undef PRIuFAST32 +#undef PRIuFAST64 +#undef PRIuMAX +#undef PRIuPTR +#undef PRIx8 +#undef PRIx16 +#undef PRIx32 +#undef PRIx64 +#undef PRIxLEAST8 +#undef PRIxLEAST16 +#undef PRIxLEAST32 +#undef PRIxLEAST64 +#undef PRIxFAST8 +#undef PRIxFAST16 +#undef PRIxFAST32 +#undef PRIxFAST64 +#undef PRIxMAX +#undef PRIxPTR +#undef PRIX8 +#undef PRIX16 +#undef PRIX32 +#undef PRIX64 +#undef PRIXLEAST8 +#undef PRIXLEAST16 +#undef PRIXLEAST32 +#undef PRIXLEAST64 +#undef PRIXFAST8 +#undef PRIXFAST16 +#undef PRIXFAST32 +#undef PRIXFAST64 +#undef PRIXMAX +#undef PRIXPTR +#undef SCNd8 +#undef SCNd16 +#undef SCNd32 +#undef SCNd64 +#undef SCNdLEAST8 +#undef SCNdLEAST16 +#undef SCNdLEAST32 +#undef SCNdLEAST64 +#undef SCNdFAST8 +#undef SCNdFAST16 +#undef SCNdFAST32 +#undef SCNdFAST64 +#undef SCNdMAX +#undef SCNdPTR +#undef SCNi8 +#undef SCNi16 +#undef SCNi32 +#undef SCNi64 +#undef SCNiLEAST8 +#undef SCNiLEAST16 +#undef SCNiLEAST32 +#undef SCNiLEAST64 +#undef SCNiFAST8 +#undef SCNiFAST16 +#undef SCNiFAST32 +#undef SCNiFAST64 +#undef SCNiMAX +#undef SCNiPTR +#undef SCNo8 +#undef SCNo16 +#undef SCNo32 +#undef SCNo64 +#undef SCNoLEAST8 +#undef SCNoLEAST16 +#undef SCNoLEAST32 +#undef SCNoLEAST64 +#undef SCNoFAST8 +#undef SCNoFAST16 +#undef SCNoFAST32 +#undef SCNoFAST64 +#undef SCNoMAX +#undef SCNoPTR +#undef SCNu8 +#undef SCNu16 +#undef SCNu32 +#undef SCNu64 +#undef SCNuLEAST8 +#undef SCNuLEAST16 +#undef SCNuLEAST32 +#undef SCNuLEAST64 +#undef SCNuFAST8 +#undef SCNuFAST16 +#undef SCNuFAST32 +#undef SCNuFAST64 +#undef SCNuMAX +#undef SCNuPTR +#undef SCNx8 +#undef SCNx16 +#undef SCNx32 +#undef SCNx64 +#undef SCNxLEAST8 +#undef SCNxLEAST16 +#undef SCNxLEAST32 +#undef SCNxLEAST64 +#undef SCNxFAST8 +#undef SCNxFAST16 +#undef SCNxFAST32 +#undef SCNxFAST64 +#undef SCNxMAX +#undef SCNxPTR +#undef CHAR_BIT +#undef SCHAR_MIN +#undef SCHAR_MAX +#undef UCHAR_MAX +#undef CHAR_MIN +#undef CHAR_MAX +#undef MB_LEN_MAX +#undef SHRT_MIN +#undef SHRT_MAX +#undef USHRT_MAX +#undef INT_MIN +#undef INT_MAX +#undef UINT_MAX +#undef LONG_MIN +#undef LONG_MAX +#undef ULONG_MAX +#undef LLONG_MIN +#undef LLONG_MAX +#undef ULLONG_MAX +#undef LC_ALL +#undef LC_COLLATE +#undef LC_CTYPE +#undef LC_MONETARY +#undef LC_NUMERIC +#undef LC_TIME +#undef HUGE_VAL +#undef HUGE_VALF +#undef HUGE_VALL +#undef INFINITY +#undef NAN +#undef FP_INFINITE +#undef FP_NAN +#undef FP_NORMAL +#undef FP_SUBNORMAL +#undef FP_ZERO +#undef FP_FAST_FMA +#undef FP_FAST_FMAF +#undef FP_FAST_FMAL +#undef FP_ILOGB0 +#undef FP_ILOGBNAN +#undef MATH_ERRNO +#undef MATH_ERREXCEPT +#undef math_errhandling +#undef SIG_DFL +#undef SIG_ERR +#undef SIG_IGN +#undef SIGABRT +#undef SIGFPE +#undef SIGILL +#undef SIGINT +#undef SIGSEGV +#undef SIGTERM +#undef INT8_MIN +#undef INT8_MAX +#undef UINT8_MAX +#undef INT_LEAST8_MIN +#undef INT_LEAST8_MAX +#undef UINT_LEAST8_MAX +#undef INT_FAST8_MIN +#undef INT_FAST8_MAX +#undef UINT_FAST8_MAX +#undef INT16_MIN +#undef INT16_MAX +#undef UINT16_MAX +#undef INT_LEAST16_MIN +#undef INT_LEAST16_MAX +#undef UINT_LEAST16_MAX +#undef INT_FAST16_MIN +#undef INT_FAST16_MAX +#undef UINT_FAST16_MAX +#undef INT32_MIN +#undef INT32_MAX +#undef UINT32_MAX +#undef INT_LEAST32_MIN +#undef INT_LEAST32_MAX +#undef UINT_LEAST32_MAX +#undef INT_FAST32_MIN +#undef INT_FAST32_MAX +#undef UINT_FAST32_MAX +#undef INT64_MIN +#undef INT64_MAX +#undef UINT64_MAX +#undef INT_LEAST64_MIN +#undef INT_LEAST64_MAX +#undef UINT_LEAST64_MAX +#undef INT_FAST64_MIN +#undef INT_FAST64_MAX +#undef UINT_FAST64_MAX +#undef INTPTR_MIN +#undef INTPTR_MAX +#undef UINTPTR_MAX +#undef INTMAX_MIN +#undef INTMAX_MAX +#undef UINTMAX_MAX +#undef PTRDIFF_MIN +#undef PTRDIFF_MAX +#undef SIG_ATOMIC_MIN +#undef SIG_ATOMIC_MAX +#undef SIZE_MAX +#undef WCHAR_MIN +#undef WCHAR_MAX +#undef WINT_MIN +#undef WINT_MAX +#undef _IOFBF +#undef _IOLBF +#undef _IONBF +#undef BUFSIZ +#undef EOF +#undef FOPEN_MAX +#undef FILENAME_MAX +#undef L_tmpnam +#undef SEEK_CUR +#undef SEEK_END +#undef SEEK_SET +#undef TMP_MAX +#undef stderr +#undef stdin +#undef stdout +#undef EXIT_FAILURE +#undef EXIT_SUCCESS +#undef RAND_MAX +#undef MB_CUR_MAX +#undef CLOCKS_PER_SEC +#undef TIME_UTC +#undef WEOF + +#endif // MWRAP_LIBC_MACROS_HPP diff --git a/mcpp.toml b/mcpp.toml new file mode 100644 index 0000000..16f8fd6 --- /dev/null +++ b/mcpp.toml @@ -0,0 +1,36 @@ +# Module wrapper; upstream API preserved. Policy: mcpp-index/docs/mwrap.md. +# The upstream is the ISO C standard; the implementation is the target's C library. +[package] +namespace = "mcpplibs.mwrap" +name = "libc" +version = "17.0.0" +description = "The C standard library (ISO C17) as C++ modules for mcpp (import mcpplibs.mwrap.libc;): std.compat with the object-like macros of ISO C (stdout, errno, EOF, BUFSIZ, INT_MAX …) as C++ constants and functions, over the target's C library" +license = "Apache-2.0" +authors = ["mcpp-community"] +repo = "https://github.com/mcpplibs/libc-m" +platforms = ["linux", "macos", "windows"] + +[targets.libc] +kind = "lib" + +[build] +sources = ["src/*.cppm"] +# : assert, va_*, offsetof, setjmp, INTn_C. +include_dirs = ["include"] + +[test] +discover = ["tests/*.cpp"] + +[package.metadata.mwrap] +upstream-version = "17.0.0" +# ISO/IEC 9899:2018 (C17), which C++23 references normatively ([intro.refs]). +standard = "ISO/IEC 9899:2018" +implementation = "the target's C library" + +[[runtime.deploy]] +from = "LICENSE" +to = "licenses/libc" + +[[runtime.deploy]] +from = "NOTICE" +to = "licenses/libc" diff --git a/src/libc.cppm b/src/libc.cppm new file mode 100644 index 0000000..3cff1e1 --- /dev/null +++ b/src/libc.cppm @@ -0,0 +1,8 @@ +// mcpplibs.mwrap.libc --- the C standard library as a C++ module: std.compat, which +// declares the functions and types of the C library in std and in the global +// namespace, with the object-like macros of ISO C mapped by +// mcpplibs.mwrap.libc.macros. The implementation is the target's C library. +export module mcpplibs.mwrap.libc; + +export import std.compat; +export import mcpplibs.mwrap.libc.macros; diff --git a/src/macros.cppm b/src/macros.cppm new file mode 100644 index 0000000..e4ab5ef --- /dev/null +++ b/src/macros.cppm @@ -0,0 +1,3368 @@ +// mcpplibs.mwrap.libc.macros --- the object-like macros of ISO C17 (ISO/IEC 9899:2018, +// Annex B) under their own names in mcpplibs::mwrap::libc::macros, wherever the target's +// C library defines them: a constant expression as an `inline constexpr` equal to the +// macro; anything else (errno, stdout, MB_CUR_MAX …) as a function returning the +// macro's expression. Written by tools/generate.py from tools/iso_c.toml. +module; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// The values, taken under other names while the macros are defined. +namespace mwrap_libc_capture { +#ifdef EDOM +inline constexpr auto value_EDOM = (EDOM); +#endif +#ifdef EILSEQ +inline constexpr auto value_EILSEQ = (EILSEQ); +#endif +#ifdef ERANGE +inline constexpr auto value_ERANGE = (ERANGE); +#endif +#ifdef errno +constexpr decltype(auto) get_errno() { return (errno); } +#endif +#ifdef FE_DIVBYZERO +inline constexpr auto value_FE_DIVBYZERO = (FE_DIVBYZERO); +#endif +#ifdef FE_INEXACT +inline constexpr auto value_FE_INEXACT = (FE_INEXACT); +#endif +#ifdef FE_INVALID +inline constexpr auto value_FE_INVALID = (FE_INVALID); +#endif +#ifdef FE_OVERFLOW +inline constexpr auto value_FE_OVERFLOW = (FE_OVERFLOW); +#endif +#ifdef FE_UNDERFLOW +inline constexpr auto value_FE_UNDERFLOW = (FE_UNDERFLOW); +#endif +#ifdef FE_ALL_EXCEPT +inline constexpr auto value_FE_ALL_EXCEPT = (FE_ALL_EXCEPT); +#endif +#ifdef FE_DOWNWARD +inline constexpr auto value_FE_DOWNWARD = (FE_DOWNWARD); +#endif +#ifdef FE_TONEAREST +inline constexpr auto value_FE_TONEAREST = (FE_TONEAREST); +#endif +#ifdef FE_TOWARDZERO +inline constexpr auto value_FE_TOWARDZERO = (FE_TOWARDZERO); +#endif +#ifdef FE_UPWARD +inline constexpr auto value_FE_UPWARD = (FE_UPWARD); +#endif +#ifdef FE_DFL_ENV +constexpr decltype(auto) get_FE_DFL_ENV() { return (FE_DFL_ENV); } +#endif +#ifdef FLT_ROUNDS +constexpr decltype(auto) get_FLT_ROUNDS() { return (FLT_ROUNDS); } +#endif +#ifdef FLT_EVAL_METHOD +constexpr decltype(auto) get_FLT_EVAL_METHOD() { return (FLT_EVAL_METHOD); } +#endif +#ifdef FLT_HAS_SUBNORM +inline constexpr auto value_FLT_HAS_SUBNORM = (FLT_HAS_SUBNORM); +#endif +#ifdef DBL_HAS_SUBNORM +inline constexpr auto value_DBL_HAS_SUBNORM = (DBL_HAS_SUBNORM); +#endif +#ifdef LDBL_HAS_SUBNORM +inline constexpr auto value_LDBL_HAS_SUBNORM = (LDBL_HAS_SUBNORM); +#endif +#ifdef FLT_RADIX +inline constexpr auto value_FLT_RADIX = (FLT_RADIX); +#endif +#ifdef DECIMAL_DIG +inline constexpr auto value_DECIMAL_DIG = (DECIMAL_DIG); +#endif +#ifdef FLT_MANT_DIG +inline constexpr auto value_FLT_MANT_DIG = (FLT_MANT_DIG); +#endif +#ifdef DBL_MANT_DIG +inline constexpr auto value_DBL_MANT_DIG = (DBL_MANT_DIG); +#endif +#ifdef LDBL_MANT_DIG +inline constexpr auto value_LDBL_MANT_DIG = (LDBL_MANT_DIG); +#endif +#ifdef FLT_DECIMAL_DIG +inline constexpr auto value_FLT_DECIMAL_DIG = (FLT_DECIMAL_DIG); +#endif +#ifdef DBL_DECIMAL_DIG +inline constexpr auto value_DBL_DECIMAL_DIG = (DBL_DECIMAL_DIG); +#endif +#ifdef LDBL_DECIMAL_DIG +inline constexpr auto value_LDBL_DECIMAL_DIG = (LDBL_DECIMAL_DIG); +#endif +#ifdef FLT_DIG +inline constexpr auto value_FLT_DIG = (FLT_DIG); +#endif +#ifdef DBL_DIG +inline constexpr auto value_DBL_DIG = (DBL_DIG); +#endif +#ifdef LDBL_DIG +inline constexpr auto value_LDBL_DIG = (LDBL_DIG); +#endif +#ifdef FLT_MIN_EXP +inline constexpr auto value_FLT_MIN_EXP = (FLT_MIN_EXP); +#endif +#ifdef DBL_MIN_EXP +inline constexpr auto value_DBL_MIN_EXP = (DBL_MIN_EXP); +#endif +#ifdef LDBL_MIN_EXP +inline constexpr auto value_LDBL_MIN_EXP = (LDBL_MIN_EXP); +#endif +#ifdef FLT_MIN_10_EXP +inline constexpr auto value_FLT_MIN_10_EXP = (FLT_MIN_10_EXP); +#endif +#ifdef DBL_MIN_10_EXP +inline constexpr auto value_DBL_MIN_10_EXP = (DBL_MIN_10_EXP); +#endif +#ifdef LDBL_MIN_10_EXP +inline constexpr auto value_LDBL_MIN_10_EXP = (LDBL_MIN_10_EXP); +#endif +#ifdef FLT_MAX_EXP +inline constexpr auto value_FLT_MAX_EXP = (FLT_MAX_EXP); +#endif +#ifdef DBL_MAX_EXP +inline constexpr auto value_DBL_MAX_EXP = (DBL_MAX_EXP); +#endif +#ifdef LDBL_MAX_EXP +inline constexpr auto value_LDBL_MAX_EXP = (LDBL_MAX_EXP); +#endif +#ifdef FLT_MAX_10_EXP +inline constexpr auto value_FLT_MAX_10_EXP = (FLT_MAX_10_EXP); +#endif +#ifdef DBL_MAX_10_EXP +inline constexpr auto value_DBL_MAX_10_EXP = (DBL_MAX_10_EXP); +#endif +#ifdef LDBL_MAX_10_EXP +inline constexpr auto value_LDBL_MAX_10_EXP = (LDBL_MAX_10_EXP); +#endif +#ifdef FLT_MAX +inline constexpr auto value_FLT_MAX = (FLT_MAX); +#endif +#ifdef DBL_MAX +inline constexpr auto value_DBL_MAX = (DBL_MAX); +#endif +#ifdef LDBL_MAX +inline constexpr auto value_LDBL_MAX = (LDBL_MAX); +#endif +#ifdef FLT_EPSILON +inline constexpr auto value_FLT_EPSILON = (FLT_EPSILON); +#endif +#ifdef DBL_EPSILON +inline constexpr auto value_DBL_EPSILON = (DBL_EPSILON); +#endif +#ifdef LDBL_EPSILON +inline constexpr auto value_LDBL_EPSILON = (LDBL_EPSILON); +#endif +#ifdef FLT_MIN +inline constexpr auto value_FLT_MIN = (FLT_MIN); +#endif +#ifdef DBL_MIN +inline constexpr auto value_DBL_MIN = (DBL_MIN); +#endif +#ifdef LDBL_MIN +inline constexpr auto value_LDBL_MIN = (LDBL_MIN); +#endif +#ifdef FLT_TRUE_MIN +inline constexpr auto value_FLT_TRUE_MIN = (FLT_TRUE_MIN); +#endif +#ifdef DBL_TRUE_MIN +inline constexpr auto value_DBL_TRUE_MIN = (DBL_TRUE_MIN); +#endif +#ifdef LDBL_TRUE_MIN +inline constexpr auto value_LDBL_TRUE_MIN = (LDBL_TRUE_MIN); +#endif +#ifdef PRId8 +inline constexpr auto value_PRId8 = (PRId8); +#endif +#ifdef PRId16 +inline constexpr auto value_PRId16 = (PRId16); +#endif +#ifdef PRId32 +inline constexpr auto value_PRId32 = (PRId32); +#endif +#ifdef PRId64 +inline constexpr auto value_PRId64 = (PRId64); +#endif +#ifdef PRIdLEAST8 +inline constexpr auto value_PRIdLEAST8 = (PRIdLEAST8); +#endif +#ifdef PRIdLEAST16 +inline constexpr auto value_PRIdLEAST16 = (PRIdLEAST16); +#endif +#ifdef PRIdLEAST32 +inline constexpr auto value_PRIdLEAST32 = (PRIdLEAST32); +#endif +#ifdef PRIdLEAST64 +inline constexpr auto value_PRIdLEAST64 = (PRIdLEAST64); +#endif +#ifdef PRIdFAST8 +inline constexpr auto value_PRIdFAST8 = (PRIdFAST8); +#endif +#ifdef PRIdFAST16 +inline constexpr auto value_PRIdFAST16 = (PRIdFAST16); +#endif +#ifdef PRIdFAST32 +inline constexpr auto value_PRIdFAST32 = (PRIdFAST32); +#endif +#ifdef PRIdFAST64 +inline constexpr auto value_PRIdFAST64 = (PRIdFAST64); +#endif +#ifdef PRIdMAX +inline constexpr auto value_PRIdMAX = (PRIdMAX); +#endif +#ifdef PRIdPTR +inline constexpr auto value_PRIdPTR = (PRIdPTR); +#endif +#ifdef PRIi8 +inline constexpr auto value_PRIi8 = (PRIi8); +#endif +#ifdef PRIi16 +inline constexpr auto value_PRIi16 = (PRIi16); +#endif +#ifdef PRIi32 +inline constexpr auto value_PRIi32 = (PRIi32); +#endif +#ifdef PRIi64 +inline constexpr auto value_PRIi64 = (PRIi64); +#endif +#ifdef PRIiLEAST8 +inline constexpr auto value_PRIiLEAST8 = (PRIiLEAST8); +#endif +#ifdef PRIiLEAST16 +inline constexpr auto value_PRIiLEAST16 = (PRIiLEAST16); +#endif +#ifdef PRIiLEAST32 +inline constexpr auto value_PRIiLEAST32 = (PRIiLEAST32); +#endif +#ifdef PRIiLEAST64 +inline constexpr auto value_PRIiLEAST64 = (PRIiLEAST64); +#endif +#ifdef PRIiFAST8 +inline constexpr auto value_PRIiFAST8 = (PRIiFAST8); +#endif +#ifdef PRIiFAST16 +inline constexpr auto value_PRIiFAST16 = (PRIiFAST16); +#endif +#ifdef PRIiFAST32 +inline constexpr auto value_PRIiFAST32 = (PRIiFAST32); +#endif +#ifdef PRIiFAST64 +inline constexpr auto value_PRIiFAST64 = (PRIiFAST64); +#endif +#ifdef PRIiMAX +inline constexpr auto value_PRIiMAX = (PRIiMAX); +#endif +#ifdef PRIiPTR +inline constexpr auto value_PRIiPTR = (PRIiPTR); +#endif +#ifdef PRIo8 +inline constexpr auto value_PRIo8 = (PRIo8); +#endif +#ifdef PRIo16 +inline constexpr auto value_PRIo16 = (PRIo16); +#endif +#ifdef PRIo32 +inline constexpr auto value_PRIo32 = (PRIo32); +#endif +#ifdef PRIo64 +inline constexpr auto value_PRIo64 = (PRIo64); +#endif +#ifdef PRIoLEAST8 +inline constexpr auto value_PRIoLEAST8 = (PRIoLEAST8); +#endif +#ifdef PRIoLEAST16 +inline constexpr auto value_PRIoLEAST16 = (PRIoLEAST16); +#endif +#ifdef PRIoLEAST32 +inline constexpr auto value_PRIoLEAST32 = (PRIoLEAST32); +#endif +#ifdef PRIoLEAST64 +inline constexpr auto value_PRIoLEAST64 = (PRIoLEAST64); +#endif +#ifdef PRIoFAST8 +inline constexpr auto value_PRIoFAST8 = (PRIoFAST8); +#endif +#ifdef PRIoFAST16 +inline constexpr auto value_PRIoFAST16 = (PRIoFAST16); +#endif +#ifdef PRIoFAST32 +inline constexpr auto value_PRIoFAST32 = (PRIoFAST32); +#endif +#ifdef PRIoFAST64 +inline constexpr auto value_PRIoFAST64 = (PRIoFAST64); +#endif +#ifdef PRIoMAX +inline constexpr auto value_PRIoMAX = (PRIoMAX); +#endif +#ifdef PRIoPTR +inline constexpr auto value_PRIoPTR = (PRIoPTR); +#endif +#ifdef PRIu8 +inline constexpr auto value_PRIu8 = (PRIu8); +#endif +#ifdef PRIu16 +inline constexpr auto value_PRIu16 = (PRIu16); +#endif +#ifdef PRIu32 +inline constexpr auto value_PRIu32 = (PRIu32); +#endif +#ifdef PRIu64 +inline constexpr auto value_PRIu64 = (PRIu64); +#endif +#ifdef PRIuLEAST8 +inline constexpr auto value_PRIuLEAST8 = (PRIuLEAST8); +#endif +#ifdef PRIuLEAST16 +inline constexpr auto value_PRIuLEAST16 = (PRIuLEAST16); +#endif +#ifdef PRIuLEAST32 +inline constexpr auto value_PRIuLEAST32 = (PRIuLEAST32); +#endif +#ifdef PRIuLEAST64 +inline constexpr auto value_PRIuLEAST64 = (PRIuLEAST64); +#endif +#ifdef PRIuFAST8 +inline constexpr auto value_PRIuFAST8 = (PRIuFAST8); +#endif +#ifdef PRIuFAST16 +inline constexpr auto value_PRIuFAST16 = (PRIuFAST16); +#endif +#ifdef PRIuFAST32 +inline constexpr auto value_PRIuFAST32 = (PRIuFAST32); +#endif +#ifdef PRIuFAST64 +inline constexpr auto value_PRIuFAST64 = (PRIuFAST64); +#endif +#ifdef PRIuMAX +inline constexpr auto value_PRIuMAX = (PRIuMAX); +#endif +#ifdef PRIuPTR +inline constexpr auto value_PRIuPTR = (PRIuPTR); +#endif +#ifdef PRIx8 +inline constexpr auto value_PRIx8 = (PRIx8); +#endif +#ifdef PRIx16 +inline constexpr auto value_PRIx16 = (PRIx16); +#endif +#ifdef PRIx32 +inline constexpr auto value_PRIx32 = (PRIx32); +#endif +#ifdef PRIx64 +inline constexpr auto value_PRIx64 = (PRIx64); +#endif +#ifdef PRIxLEAST8 +inline constexpr auto value_PRIxLEAST8 = (PRIxLEAST8); +#endif +#ifdef PRIxLEAST16 +inline constexpr auto value_PRIxLEAST16 = (PRIxLEAST16); +#endif +#ifdef PRIxLEAST32 +inline constexpr auto value_PRIxLEAST32 = (PRIxLEAST32); +#endif +#ifdef PRIxLEAST64 +inline constexpr auto value_PRIxLEAST64 = (PRIxLEAST64); +#endif +#ifdef PRIxFAST8 +inline constexpr auto value_PRIxFAST8 = (PRIxFAST8); +#endif +#ifdef PRIxFAST16 +inline constexpr auto value_PRIxFAST16 = (PRIxFAST16); +#endif +#ifdef PRIxFAST32 +inline constexpr auto value_PRIxFAST32 = (PRIxFAST32); +#endif +#ifdef PRIxFAST64 +inline constexpr auto value_PRIxFAST64 = (PRIxFAST64); +#endif +#ifdef PRIxMAX +inline constexpr auto value_PRIxMAX = (PRIxMAX); +#endif +#ifdef PRIxPTR +inline constexpr auto value_PRIxPTR = (PRIxPTR); +#endif +#ifdef PRIX8 +inline constexpr auto value_PRIX8 = (PRIX8); +#endif +#ifdef PRIX16 +inline constexpr auto value_PRIX16 = (PRIX16); +#endif +#ifdef PRIX32 +inline constexpr auto value_PRIX32 = (PRIX32); +#endif +#ifdef PRIX64 +inline constexpr auto value_PRIX64 = (PRIX64); +#endif +#ifdef PRIXLEAST8 +inline constexpr auto value_PRIXLEAST8 = (PRIXLEAST8); +#endif +#ifdef PRIXLEAST16 +inline constexpr auto value_PRIXLEAST16 = (PRIXLEAST16); +#endif +#ifdef PRIXLEAST32 +inline constexpr auto value_PRIXLEAST32 = (PRIXLEAST32); +#endif +#ifdef PRIXLEAST64 +inline constexpr auto value_PRIXLEAST64 = (PRIXLEAST64); +#endif +#ifdef PRIXFAST8 +inline constexpr auto value_PRIXFAST8 = (PRIXFAST8); +#endif +#ifdef PRIXFAST16 +inline constexpr auto value_PRIXFAST16 = (PRIXFAST16); +#endif +#ifdef PRIXFAST32 +inline constexpr auto value_PRIXFAST32 = (PRIXFAST32); +#endif +#ifdef PRIXFAST64 +inline constexpr auto value_PRIXFAST64 = (PRIXFAST64); +#endif +#ifdef PRIXMAX +inline constexpr auto value_PRIXMAX = (PRIXMAX); +#endif +#ifdef PRIXPTR +inline constexpr auto value_PRIXPTR = (PRIXPTR); +#endif +#ifdef SCNd8 +inline constexpr auto value_SCNd8 = (SCNd8); +#endif +#ifdef SCNd16 +inline constexpr auto value_SCNd16 = (SCNd16); +#endif +#ifdef SCNd32 +inline constexpr auto value_SCNd32 = (SCNd32); +#endif +#ifdef SCNd64 +inline constexpr auto value_SCNd64 = (SCNd64); +#endif +#ifdef SCNdLEAST8 +inline constexpr auto value_SCNdLEAST8 = (SCNdLEAST8); +#endif +#ifdef SCNdLEAST16 +inline constexpr auto value_SCNdLEAST16 = (SCNdLEAST16); +#endif +#ifdef SCNdLEAST32 +inline constexpr auto value_SCNdLEAST32 = (SCNdLEAST32); +#endif +#ifdef SCNdLEAST64 +inline constexpr auto value_SCNdLEAST64 = (SCNdLEAST64); +#endif +#ifdef SCNdFAST8 +inline constexpr auto value_SCNdFAST8 = (SCNdFAST8); +#endif +#ifdef SCNdFAST16 +inline constexpr auto value_SCNdFAST16 = (SCNdFAST16); +#endif +#ifdef SCNdFAST32 +inline constexpr auto value_SCNdFAST32 = (SCNdFAST32); +#endif +#ifdef SCNdFAST64 +inline constexpr auto value_SCNdFAST64 = (SCNdFAST64); +#endif +#ifdef SCNdMAX +inline constexpr auto value_SCNdMAX = (SCNdMAX); +#endif +#ifdef SCNdPTR +inline constexpr auto value_SCNdPTR = (SCNdPTR); +#endif +#ifdef SCNi8 +inline constexpr auto value_SCNi8 = (SCNi8); +#endif +#ifdef SCNi16 +inline constexpr auto value_SCNi16 = (SCNi16); +#endif +#ifdef SCNi32 +inline constexpr auto value_SCNi32 = (SCNi32); +#endif +#ifdef SCNi64 +inline constexpr auto value_SCNi64 = (SCNi64); +#endif +#ifdef SCNiLEAST8 +inline constexpr auto value_SCNiLEAST8 = (SCNiLEAST8); +#endif +#ifdef SCNiLEAST16 +inline constexpr auto value_SCNiLEAST16 = (SCNiLEAST16); +#endif +#ifdef SCNiLEAST32 +inline constexpr auto value_SCNiLEAST32 = (SCNiLEAST32); +#endif +#ifdef SCNiLEAST64 +inline constexpr auto value_SCNiLEAST64 = (SCNiLEAST64); +#endif +#ifdef SCNiFAST8 +inline constexpr auto value_SCNiFAST8 = (SCNiFAST8); +#endif +#ifdef SCNiFAST16 +inline constexpr auto value_SCNiFAST16 = (SCNiFAST16); +#endif +#ifdef SCNiFAST32 +inline constexpr auto value_SCNiFAST32 = (SCNiFAST32); +#endif +#ifdef SCNiFAST64 +inline constexpr auto value_SCNiFAST64 = (SCNiFAST64); +#endif +#ifdef SCNiMAX +inline constexpr auto value_SCNiMAX = (SCNiMAX); +#endif +#ifdef SCNiPTR +inline constexpr auto value_SCNiPTR = (SCNiPTR); +#endif +#ifdef SCNo8 +inline constexpr auto value_SCNo8 = (SCNo8); +#endif +#ifdef SCNo16 +inline constexpr auto value_SCNo16 = (SCNo16); +#endif +#ifdef SCNo32 +inline constexpr auto value_SCNo32 = (SCNo32); +#endif +#ifdef SCNo64 +inline constexpr auto value_SCNo64 = (SCNo64); +#endif +#ifdef SCNoLEAST8 +inline constexpr auto value_SCNoLEAST8 = (SCNoLEAST8); +#endif +#ifdef SCNoLEAST16 +inline constexpr auto value_SCNoLEAST16 = (SCNoLEAST16); +#endif +#ifdef SCNoLEAST32 +inline constexpr auto value_SCNoLEAST32 = (SCNoLEAST32); +#endif +#ifdef SCNoLEAST64 +inline constexpr auto value_SCNoLEAST64 = (SCNoLEAST64); +#endif +#ifdef SCNoFAST8 +inline constexpr auto value_SCNoFAST8 = (SCNoFAST8); +#endif +#ifdef SCNoFAST16 +inline constexpr auto value_SCNoFAST16 = (SCNoFAST16); +#endif +#ifdef SCNoFAST32 +inline constexpr auto value_SCNoFAST32 = (SCNoFAST32); +#endif +#ifdef SCNoFAST64 +inline constexpr auto value_SCNoFAST64 = (SCNoFAST64); +#endif +#ifdef SCNoMAX +inline constexpr auto value_SCNoMAX = (SCNoMAX); +#endif +#ifdef SCNoPTR +inline constexpr auto value_SCNoPTR = (SCNoPTR); +#endif +#ifdef SCNu8 +inline constexpr auto value_SCNu8 = (SCNu8); +#endif +#ifdef SCNu16 +inline constexpr auto value_SCNu16 = (SCNu16); +#endif +#ifdef SCNu32 +inline constexpr auto value_SCNu32 = (SCNu32); +#endif +#ifdef SCNu64 +inline constexpr auto value_SCNu64 = (SCNu64); +#endif +#ifdef SCNuLEAST8 +inline constexpr auto value_SCNuLEAST8 = (SCNuLEAST8); +#endif +#ifdef SCNuLEAST16 +inline constexpr auto value_SCNuLEAST16 = (SCNuLEAST16); +#endif +#ifdef SCNuLEAST32 +inline constexpr auto value_SCNuLEAST32 = (SCNuLEAST32); +#endif +#ifdef SCNuLEAST64 +inline constexpr auto value_SCNuLEAST64 = (SCNuLEAST64); +#endif +#ifdef SCNuFAST8 +inline constexpr auto value_SCNuFAST8 = (SCNuFAST8); +#endif +#ifdef SCNuFAST16 +inline constexpr auto value_SCNuFAST16 = (SCNuFAST16); +#endif +#ifdef SCNuFAST32 +inline constexpr auto value_SCNuFAST32 = (SCNuFAST32); +#endif +#ifdef SCNuFAST64 +inline constexpr auto value_SCNuFAST64 = (SCNuFAST64); +#endif +#ifdef SCNuMAX +inline constexpr auto value_SCNuMAX = (SCNuMAX); +#endif +#ifdef SCNuPTR +inline constexpr auto value_SCNuPTR = (SCNuPTR); +#endif +#ifdef SCNx8 +inline constexpr auto value_SCNx8 = (SCNx8); +#endif +#ifdef SCNx16 +inline constexpr auto value_SCNx16 = (SCNx16); +#endif +#ifdef SCNx32 +inline constexpr auto value_SCNx32 = (SCNx32); +#endif +#ifdef SCNx64 +inline constexpr auto value_SCNx64 = (SCNx64); +#endif +#ifdef SCNxLEAST8 +inline constexpr auto value_SCNxLEAST8 = (SCNxLEAST8); +#endif +#ifdef SCNxLEAST16 +inline constexpr auto value_SCNxLEAST16 = (SCNxLEAST16); +#endif +#ifdef SCNxLEAST32 +inline constexpr auto value_SCNxLEAST32 = (SCNxLEAST32); +#endif +#ifdef SCNxLEAST64 +inline constexpr auto value_SCNxLEAST64 = (SCNxLEAST64); +#endif +#ifdef SCNxFAST8 +inline constexpr auto value_SCNxFAST8 = (SCNxFAST8); +#endif +#ifdef SCNxFAST16 +inline constexpr auto value_SCNxFAST16 = (SCNxFAST16); +#endif +#ifdef SCNxFAST32 +inline constexpr auto value_SCNxFAST32 = (SCNxFAST32); +#endif +#ifdef SCNxFAST64 +inline constexpr auto value_SCNxFAST64 = (SCNxFAST64); +#endif +#ifdef SCNxMAX +inline constexpr auto value_SCNxMAX = (SCNxMAX); +#endif +#ifdef SCNxPTR +inline constexpr auto value_SCNxPTR = (SCNxPTR); +#endif +#ifdef CHAR_BIT +inline constexpr auto value_CHAR_BIT = (CHAR_BIT); +#endif +#ifdef SCHAR_MIN +inline constexpr auto value_SCHAR_MIN = (SCHAR_MIN); +#endif +#ifdef SCHAR_MAX +inline constexpr auto value_SCHAR_MAX = (SCHAR_MAX); +#endif +#ifdef UCHAR_MAX +inline constexpr auto value_UCHAR_MAX = (UCHAR_MAX); +#endif +#ifdef CHAR_MIN +inline constexpr auto value_CHAR_MIN = (CHAR_MIN); +#endif +#ifdef CHAR_MAX +inline constexpr auto value_CHAR_MAX = (CHAR_MAX); +#endif +#ifdef MB_LEN_MAX +inline constexpr auto value_MB_LEN_MAX = (MB_LEN_MAX); +#endif +#ifdef SHRT_MIN +inline constexpr auto value_SHRT_MIN = (SHRT_MIN); +#endif +#ifdef SHRT_MAX +inline constexpr auto value_SHRT_MAX = (SHRT_MAX); +#endif +#ifdef USHRT_MAX +inline constexpr auto value_USHRT_MAX = (USHRT_MAX); +#endif +#ifdef INT_MIN +inline constexpr auto value_INT_MIN = (INT_MIN); +#endif +#ifdef INT_MAX +inline constexpr auto value_INT_MAX = (INT_MAX); +#endif +#ifdef UINT_MAX +inline constexpr auto value_UINT_MAX = (UINT_MAX); +#endif +#ifdef LONG_MIN +inline constexpr auto value_LONG_MIN = (LONG_MIN); +#endif +#ifdef LONG_MAX +inline constexpr auto value_LONG_MAX = (LONG_MAX); +#endif +#ifdef ULONG_MAX +inline constexpr auto value_ULONG_MAX = (ULONG_MAX); +#endif +#ifdef LLONG_MIN +inline constexpr auto value_LLONG_MIN = (LLONG_MIN); +#endif +#ifdef LLONG_MAX +inline constexpr auto value_LLONG_MAX = (LLONG_MAX); +#endif +#ifdef ULLONG_MAX +inline constexpr auto value_ULLONG_MAX = (ULLONG_MAX); +#endif +#ifdef LC_ALL +inline constexpr auto value_LC_ALL = (LC_ALL); +#endif +#ifdef LC_COLLATE +inline constexpr auto value_LC_COLLATE = (LC_COLLATE); +#endif +#ifdef LC_CTYPE +inline constexpr auto value_LC_CTYPE = (LC_CTYPE); +#endif +#ifdef LC_MONETARY +inline constexpr auto value_LC_MONETARY = (LC_MONETARY); +#endif +#ifdef LC_NUMERIC +inline constexpr auto value_LC_NUMERIC = (LC_NUMERIC); +#endif +#ifdef LC_TIME +inline constexpr auto value_LC_TIME = (LC_TIME); +#endif +#ifdef HUGE_VAL +constexpr decltype(auto) get_HUGE_VAL() { return (HUGE_VAL); } +#endif +#ifdef HUGE_VALF +constexpr decltype(auto) get_HUGE_VALF() { return (HUGE_VALF); } +#endif +#ifdef HUGE_VALL +constexpr decltype(auto) get_HUGE_VALL() { return (HUGE_VALL); } +#endif +#ifdef INFINITY +constexpr decltype(auto) get_INFINITY() { return (INFINITY); } +#endif +#ifdef NAN +constexpr decltype(auto) get_NAN() { return (NAN); } +#endif +#ifdef FP_INFINITE +inline constexpr auto value_FP_INFINITE = (FP_INFINITE); +#endif +#ifdef FP_NAN +inline constexpr auto value_FP_NAN = (FP_NAN); +#endif +#ifdef FP_NORMAL +inline constexpr auto value_FP_NORMAL = (FP_NORMAL); +#endif +#ifdef FP_SUBNORMAL +inline constexpr auto value_FP_SUBNORMAL = (FP_SUBNORMAL); +#endif +#ifdef FP_ZERO +inline constexpr auto value_FP_ZERO = (FP_ZERO); +#endif +#ifdef FP_FAST_FMA +constexpr decltype(auto) get_FP_FAST_FMA() { return (FP_FAST_FMA); } +#endif +#ifdef FP_FAST_FMAF +constexpr decltype(auto) get_FP_FAST_FMAF() { return (FP_FAST_FMAF); } +#endif +#ifdef FP_FAST_FMAL +constexpr decltype(auto) get_FP_FAST_FMAL() { return (FP_FAST_FMAL); } +#endif +#ifdef FP_ILOGB0 +inline constexpr auto value_FP_ILOGB0 = (FP_ILOGB0); +#endif +#ifdef FP_ILOGBNAN +inline constexpr auto value_FP_ILOGBNAN = (FP_ILOGBNAN); +#endif +#ifdef MATH_ERRNO +inline constexpr auto value_MATH_ERRNO = (MATH_ERRNO); +#endif +#ifdef MATH_ERREXCEPT +inline constexpr auto value_MATH_ERREXCEPT = (MATH_ERREXCEPT); +#endif +#ifdef math_errhandling +constexpr decltype(auto) get_math_errhandling() { return (math_errhandling); } +#endif +#ifdef SIG_DFL +inline constexpr auto value_SIG_DFL = (SIG_DFL); +#endif +#ifdef SIG_ERR +constexpr decltype(auto) get_SIG_ERR() { return (SIG_ERR); } +#endif +#ifdef SIG_IGN +constexpr decltype(auto) get_SIG_IGN() { return (SIG_IGN); } +#endif +#ifdef SIGABRT +inline constexpr auto value_SIGABRT = (SIGABRT); +#endif +#ifdef SIGFPE +inline constexpr auto value_SIGFPE = (SIGFPE); +#endif +#ifdef SIGILL +inline constexpr auto value_SIGILL = (SIGILL); +#endif +#ifdef SIGINT +inline constexpr auto value_SIGINT = (SIGINT); +#endif +#ifdef SIGSEGV +inline constexpr auto value_SIGSEGV = (SIGSEGV); +#endif +#ifdef SIGTERM +inline constexpr auto value_SIGTERM = (SIGTERM); +#endif +#ifdef INT8_MIN +inline constexpr auto value_INT8_MIN = (INT8_MIN); +#endif +#ifdef INT8_MAX +inline constexpr auto value_INT8_MAX = (INT8_MAX); +#endif +#ifdef UINT8_MAX +inline constexpr auto value_UINT8_MAX = (UINT8_MAX); +#endif +#ifdef INT_LEAST8_MIN +inline constexpr auto value_INT_LEAST8_MIN = (INT_LEAST8_MIN); +#endif +#ifdef INT_LEAST8_MAX +inline constexpr auto value_INT_LEAST8_MAX = (INT_LEAST8_MAX); +#endif +#ifdef UINT_LEAST8_MAX +inline constexpr auto value_UINT_LEAST8_MAX = (UINT_LEAST8_MAX); +#endif +#ifdef INT_FAST8_MIN +inline constexpr auto value_INT_FAST8_MIN = (INT_FAST8_MIN); +#endif +#ifdef INT_FAST8_MAX +inline constexpr auto value_INT_FAST8_MAX = (INT_FAST8_MAX); +#endif +#ifdef UINT_FAST8_MAX +inline constexpr auto value_UINT_FAST8_MAX = (UINT_FAST8_MAX); +#endif +#ifdef INT16_MIN +inline constexpr auto value_INT16_MIN = (INT16_MIN); +#endif +#ifdef INT16_MAX +inline constexpr auto value_INT16_MAX = (INT16_MAX); +#endif +#ifdef UINT16_MAX +inline constexpr auto value_UINT16_MAX = (UINT16_MAX); +#endif +#ifdef INT_LEAST16_MIN +inline constexpr auto value_INT_LEAST16_MIN = (INT_LEAST16_MIN); +#endif +#ifdef INT_LEAST16_MAX +inline constexpr auto value_INT_LEAST16_MAX = (INT_LEAST16_MAX); +#endif +#ifdef UINT_LEAST16_MAX +inline constexpr auto value_UINT_LEAST16_MAX = (UINT_LEAST16_MAX); +#endif +#ifdef INT_FAST16_MIN +inline constexpr auto value_INT_FAST16_MIN = (INT_FAST16_MIN); +#endif +#ifdef INT_FAST16_MAX +inline constexpr auto value_INT_FAST16_MAX = (INT_FAST16_MAX); +#endif +#ifdef UINT_FAST16_MAX +inline constexpr auto value_UINT_FAST16_MAX = (UINT_FAST16_MAX); +#endif +#ifdef INT32_MIN +inline constexpr auto value_INT32_MIN = (INT32_MIN); +#endif +#ifdef INT32_MAX +inline constexpr auto value_INT32_MAX = (INT32_MAX); +#endif +#ifdef UINT32_MAX +inline constexpr auto value_UINT32_MAX = (UINT32_MAX); +#endif +#ifdef INT_LEAST32_MIN +inline constexpr auto value_INT_LEAST32_MIN = (INT_LEAST32_MIN); +#endif +#ifdef INT_LEAST32_MAX +inline constexpr auto value_INT_LEAST32_MAX = (INT_LEAST32_MAX); +#endif +#ifdef UINT_LEAST32_MAX +inline constexpr auto value_UINT_LEAST32_MAX = (UINT_LEAST32_MAX); +#endif +#ifdef INT_FAST32_MIN +inline constexpr auto value_INT_FAST32_MIN = (INT_FAST32_MIN); +#endif +#ifdef INT_FAST32_MAX +inline constexpr auto value_INT_FAST32_MAX = (INT_FAST32_MAX); +#endif +#ifdef UINT_FAST32_MAX +inline constexpr auto value_UINT_FAST32_MAX = (UINT_FAST32_MAX); +#endif +#ifdef INT64_MIN +inline constexpr auto value_INT64_MIN = (INT64_MIN); +#endif +#ifdef INT64_MAX +inline constexpr auto value_INT64_MAX = (INT64_MAX); +#endif +#ifdef UINT64_MAX +inline constexpr auto value_UINT64_MAX = (UINT64_MAX); +#endif +#ifdef INT_LEAST64_MIN +inline constexpr auto value_INT_LEAST64_MIN = (INT_LEAST64_MIN); +#endif +#ifdef INT_LEAST64_MAX +inline constexpr auto value_INT_LEAST64_MAX = (INT_LEAST64_MAX); +#endif +#ifdef UINT_LEAST64_MAX +inline constexpr auto value_UINT_LEAST64_MAX = (UINT_LEAST64_MAX); +#endif +#ifdef INT_FAST64_MIN +inline constexpr auto value_INT_FAST64_MIN = (INT_FAST64_MIN); +#endif +#ifdef INT_FAST64_MAX +inline constexpr auto value_INT_FAST64_MAX = (INT_FAST64_MAX); +#endif +#ifdef UINT_FAST64_MAX +inline constexpr auto value_UINT_FAST64_MAX = (UINT_FAST64_MAX); +#endif +#ifdef INTPTR_MIN +inline constexpr auto value_INTPTR_MIN = (INTPTR_MIN); +#endif +#ifdef INTPTR_MAX +inline constexpr auto value_INTPTR_MAX = (INTPTR_MAX); +#endif +#ifdef UINTPTR_MAX +inline constexpr auto value_UINTPTR_MAX = (UINTPTR_MAX); +#endif +#ifdef INTMAX_MIN +inline constexpr auto value_INTMAX_MIN = (INTMAX_MIN); +#endif +#ifdef INTMAX_MAX +inline constexpr auto value_INTMAX_MAX = (INTMAX_MAX); +#endif +#ifdef UINTMAX_MAX +inline constexpr auto value_UINTMAX_MAX = (UINTMAX_MAX); +#endif +#ifdef PTRDIFF_MIN +inline constexpr auto value_PTRDIFF_MIN = (PTRDIFF_MIN); +#endif +#ifdef PTRDIFF_MAX +inline constexpr auto value_PTRDIFF_MAX = (PTRDIFF_MAX); +#endif +#ifdef SIG_ATOMIC_MIN +inline constexpr auto value_SIG_ATOMIC_MIN = (SIG_ATOMIC_MIN); +#endif +#ifdef SIG_ATOMIC_MAX +inline constexpr auto value_SIG_ATOMIC_MAX = (SIG_ATOMIC_MAX); +#endif +#ifdef SIZE_MAX +inline constexpr auto value_SIZE_MAX = (SIZE_MAX); +#endif +#ifdef WCHAR_MIN +inline constexpr auto value_WCHAR_MIN = (WCHAR_MIN); +#endif +#ifdef WCHAR_MAX +inline constexpr auto value_WCHAR_MAX = (WCHAR_MAX); +#endif +#ifdef WINT_MIN +inline constexpr auto value_WINT_MIN = (WINT_MIN); +#endif +#ifdef WINT_MAX +inline constexpr auto value_WINT_MAX = (WINT_MAX); +#endif +#ifdef _IOFBF +inline constexpr auto value__IOFBF = (_IOFBF); +#endif +#ifdef _IOLBF +inline constexpr auto value__IOLBF = (_IOLBF); +#endif +#ifdef _IONBF +inline constexpr auto value__IONBF = (_IONBF); +#endif +#ifdef BUFSIZ +inline constexpr auto value_BUFSIZ = (BUFSIZ); +#endif +#ifdef EOF +inline constexpr auto value_EOF = (EOF); +#endif +#ifdef FOPEN_MAX +inline constexpr auto value_FOPEN_MAX = (FOPEN_MAX); +#endif +#ifdef FILENAME_MAX +inline constexpr auto value_FILENAME_MAX = (FILENAME_MAX); +#endif +#ifdef L_tmpnam +inline constexpr auto value_L_tmpnam = (L_tmpnam); +#endif +#ifdef SEEK_CUR +inline constexpr auto value_SEEK_CUR = (SEEK_CUR); +#endif +#ifdef SEEK_END +inline constexpr auto value_SEEK_END = (SEEK_END); +#endif +#ifdef SEEK_SET +inline constexpr auto value_SEEK_SET = (SEEK_SET); +#endif +#ifdef TMP_MAX +inline constexpr auto value_TMP_MAX = (TMP_MAX); +#endif +#ifdef stderr +constexpr decltype(auto) get_stderr() { return (stderr); } +#endif +#ifdef stdin +constexpr decltype(auto) get_stdin() { return (stdin); } +#endif +#ifdef stdout +constexpr decltype(auto) get_stdout() { return (stdout); } +#endif +#ifdef EXIT_FAILURE +inline constexpr auto value_EXIT_FAILURE = (EXIT_FAILURE); +#endif +#ifdef EXIT_SUCCESS +inline constexpr auto value_EXIT_SUCCESS = (EXIT_SUCCESS); +#endif +#ifdef RAND_MAX +inline constexpr auto value_RAND_MAX = (RAND_MAX); +#endif +#ifdef MB_CUR_MAX +constexpr decltype(auto) get_MB_CUR_MAX() { return (MB_CUR_MAX); } +#endif +#ifdef CLOCKS_PER_SEC +inline constexpr auto value_CLOCKS_PER_SEC = (CLOCKS_PER_SEC); +#endif +#ifdef TIME_UTC +inline constexpr auto value_TIME_UTC = (TIME_UTC); +#endif +#ifdef WEOF +inline constexpr auto value_WEOF = (WEOF); +#endif +} +#ifdef EDOM +#undef EDOM +#define MWRAP_LIBC_HAS_EDOM +#endif +#ifdef EILSEQ +#undef EILSEQ +#define MWRAP_LIBC_HAS_EILSEQ +#endif +#ifdef ERANGE +#undef ERANGE +#define MWRAP_LIBC_HAS_ERANGE +#endif +#ifdef errno +#undef errno +#define MWRAP_LIBC_HAS_errno +#endif +#ifdef FE_DIVBYZERO +#undef FE_DIVBYZERO +#define MWRAP_LIBC_HAS_FE_DIVBYZERO +#endif +#ifdef FE_INEXACT +#undef FE_INEXACT +#define MWRAP_LIBC_HAS_FE_INEXACT +#endif +#ifdef FE_INVALID +#undef FE_INVALID +#define MWRAP_LIBC_HAS_FE_INVALID +#endif +#ifdef FE_OVERFLOW +#undef FE_OVERFLOW +#define MWRAP_LIBC_HAS_FE_OVERFLOW +#endif +#ifdef FE_UNDERFLOW +#undef FE_UNDERFLOW +#define MWRAP_LIBC_HAS_FE_UNDERFLOW +#endif +#ifdef FE_ALL_EXCEPT +#undef FE_ALL_EXCEPT +#define MWRAP_LIBC_HAS_FE_ALL_EXCEPT +#endif +#ifdef FE_DOWNWARD +#undef FE_DOWNWARD +#define MWRAP_LIBC_HAS_FE_DOWNWARD +#endif +#ifdef FE_TONEAREST +#undef FE_TONEAREST +#define MWRAP_LIBC_HAS_FE_TONEAREST +#endif +#ifdef FE_TOWARDZERO +#undef FE_TOWARDZERO +#define MWRAP_LIBC_HAS_FE_TOWARDZERO +#endif +#ifdef FE_UPWARD +#undef FE_UPWARD +#define MWRAP_LIBC_HAS_FE_UPWARD +#endif +#ifdef FE_DFL_ENV +#undef FE_DFL_ENV +#define MWRAP_LIBC_HAS_FE_DFL_ENV +#endif +#ifdef FLT_ROUNDS +#undef FLT_ROUNDS +#define MWRAP_LIBC_HAS_FLT_ROUNDS +#endif +#ifdef FLT_EVAL_METHOD +#undef FLT_EVAL_METHOD +#define MWRAP_LIBC_HAS_FLT_EVAL_METHOD +#endif +#ifdef FLT_HAS_SUBNORM +#undef FLT_HAS_SUBNORM +#define MWRAP_LIBC_HAS_FLT_HAS_SUBNORM +#endif +#ifdef DBL_HAS_SUBNORM +#undef DBL_HAS_SUBNORM +#define MWRAP_LIBC_HAS_DBL_HAS_SUBNORM +#endif +#ifdef LDBL_HAS_SUBNORM +#undef LDBL_HAS_SUBNORM +#define MWRAP_LIBC_HAS_LDBL_HAS_SUBNORM +#endif +#ifdef FLT_RADIX +#undef FLT_RADIX +#define MWRAP_LIBC_HAS_FLT_RADIX +#endif +#ifdef DECIMAL_DIG +#undef DECIMAL_DIG +#define MWRAP_LIBC_HAS_DECIMAL_DIG +#endif +#ifdef FLT_MANT_DIG +#undef FLT_MANT_DIG +#define MWRAP_LIBC_HAS_FLT_MANT_DIG +#endif +#ifdef DBL_MANT_DIG +#undef DBL_MANT_DIG +#define MWRAP_LIBC_HAS_DBL_MANT_DIG +#endif +#ifdef LDBL_MANT_DIG +#undef LDBL_MANT_DIG +#define MWRAP_LIBC_HAS_LDBL_MANT_DIG +#endif +#ifdef FLT_DECIMAL_DIG +#undef FLT_DECIMAL_DIG +#define MWRAP_LIBC_HAS_FLT_DECIMAL_DIG +#endif +#ifdef DBL_DECIMAL_DIG +#undef DBL_DECIMAL_DIG +#define MWRAP_LIBC_HAS_DBL_DECIMAL_DIG +#endif +#ifdef LDBL_DECIMAL_DIG +#undef LDBL_DECIMAL_DIG +#define MWRAP_LIBC_HAS_LDBL_DECIMAL_DIG +#endif +#ifdef FLT_DIG +#undef FLT_DIG +#define MWRAP_LIBC_HAS_FLT_DIG +#endif +#ifdef DBL_DIG +#undef DBL_DIG +#define MWRAP_LIBC_HAS_DBL_DIG +#endif +#ifdef LDBL_DIG +#undef LDBL_DIG +#define MWRAP_LIBC_HAS_LDBL_DIG +#endif +#ifdef FLT_MIN_EXP +#undef FLT_MIN_EXP +#define MWRAP_LIBC_HAS_FLT_MIN_EXP +#endif +#ifdef DBL_MIN_EXP +#undef DBL_MIN_EXP +#define MWRAP_LIBC_HAS_DBL_MIN_EXP +#endif +#ifdef LDBL_MIN_EXP +#undef LDBL_MIN_EXP +#define MWRAP_LIBC_HAS_LDBL_MIN_EXP +#endif +#ifdef FLT_MIN_10_EXP +#undef FLT_MIN_10_EXP +#define MWRAP_LIBC_HAS_FLT_MIN_10_EXP +#endif +#ifdef DBL_MIN_10_EXP +#undef DBL_MIN_10_EXP +#define MWRAP_LIBC_HAS_DBL_MIN_10_EXP +#endif +#ifdef LDBL_MIN_10_EXP +#undef LDBL_MIN_10_EXP +#define MWRAP_LIBC_HAS_LDBL_MIN_10_EXP +#endif +#ifdef FLT_MAX_EXP +#undef FLT_MAX_EXP +#define MWRAP_LIBC_HAS_FLT_MAX_EXP +#endif +#ifdef DBL_MAX_EXP +#undef DBL_MAX_EXP +#define MWRAP_LIBC_HAS_DBL_MAX_EXP +#endif +#ifdef LDBL_MAX_EXP +#undef LDBL_MAX_EXP +#define MWRAP_LIBC_HAS_LDBL_MAX_EXP +#endif +#ifdef FLT_MAX_10_EXP +#undef FLT_MAX_10_EXP +#define MWRAP_LIBC_HAS_FLT_MAX_10_EXP +#endif +#ifdef DBL_MAX_10_EXP +#undef DBL_MAX_10_EXP +#define MWRAP_LIBC_HAS_DBL_MAX_10_EXP +#endif +#ifdef LDBL_MAX_10_EXP +#undef LDBL_MAX_10_EXP +#define MWRAP_LIBC_HAS_LDBL_MAX_10_EXP +#endif +#ifdef FLT_MAX +#undef FLT_MAX +#define MWRAP_LIBC_HAS_FLT_MAX +#endif +#ifdef DBL_MAX +#undef DBL_MAX +#define MWRAP_LIBC_HAS_DBL_MAX +#endif +#ifdef LDBL_MAX +#undef LDBL_MAX +#define MWRAP_LIBC_HAS_LDBL_MAX +#endif +#ifdef FLT_EPSILON +#undef FLT_EPSILON +#define MWRAP_LIBC_HAS_FLT_EPSILON +#endif +#ifdef DBL_EPSILON +#undef DBL_EPSILON +#define MWRAP_LIBC_HAS_DBL_EPSILON +#endif +#ifdef LDBL_EPSILON +#undef LDBL_EPSILON +#define MWRAP_LIBC_HAS_LDBL_EPSILON +#endif +#ifdef FLT_MIN +#undef FLT_MIN +#define MWRAP_LIBC_HAS_FLT_MIN +#endif +#ifdef DBL_MIN +#undef DBL_MIN +#define MWRAP_LIBC_HAS_DBL_MIN +#endif +#ifdef LDBL_MIN +#undef LDBL_MIN +#define MWRAP_LIBC_HAS_LDBL_MIN +#endif +#ifdef FLT_TRUE_MIN +#undef FLT_TRUE_MIN +#define MWRAP_LIBC_HAS_FLT_TRUE_MIN +#endif +#ifdef DBL_TRUE_MIN +#undef DBL_TRUE_MIN +#define MWRAP_LIBC_HAS_DBL_TRUE_MIN +#endif +#ifdef LDBL_TRUE_MIN +#undef LDBL_TRUE_MIN +#define MWRAP_LIBC_HAS_LDBL_TRUE_MIN +#endif +#ifdef PRId8 +#undef PRId8 +#define MWRAP_LIBC_HAS_PRId8 +#endif +#ifdef PRId16 +#undef PRId16 +#define MWRAP_LIBC_HAS_PRId16 +#endif +#ifdef PRId32 +#undef PRId32 +#define MWRAP_LIBC_HAS_PRId32 +#endif +#ifdef PRId64 +#undef PRId64 +#define MWRAP_LIBC_HAS_PRId64 +#endif +#ifdef PRIdLEAST8 +#undef PRIdLEAST8 +#define MWRAP_LIBC_HAS_PRIdLEAST8 +#endif +#ifdef PRIdLEAST16 +#undef PRIdLEAST16 +#define MWRAP_LIBC_HAS_PRIdLEAST16 +#endif +#ifdef PRIdLEAST32 +#undef PRIdLEAST32 +#define MWRAP_LIBC_HAS_PRIdLEAST32 +#endif +#ifdef PRIdLEAST64 +#undef PRIdLEAST64 +#define MWRAP_LIBC_HAS_PRIdLEAST64 +#endif +#ifdef PRIdFAST8 +#undef PRIdFAST8 +#define MWRAP_LIBC_HAS_PRIdFAST8 +#endif +#ifdef PRIdFAST16 +#undef PRIdFAST16 +#define MWRAP_LIBC_HAS_PRIdFAST16 +#endif +#ifdef PRIdFAST32 +#undef PRIdFAST32 +#define MWRAP_LIBC_HAS_PRIdFAST32 +#endif +#ifdef PRIdFAST64 +#undef PRIdFAST64 +#define MWRAP_LIBC_HAS_PRIdFAST64 +#endif +#ifdef PRIdMAX +#undef PRIdMAX +#define MWRAP_LIBC_HAS_PRIdMAX +#endif +#ifdef PRIdPTR +#undef PRIdPTR +#define MWRAP_LIBC_HAS_PRIdPTR +#endif +#ifdef PRIi8 +#undef PRIi8 +#define MWRAP_LIBC_HAS_PRIi8 +#endif +#ifdef PRIi16 +#undef PRIi16 +#define MWRAP_LIBC_HAS_PRIi16 +#endif +#ifdef PRIi32 +#undef PRIi32 +#define MWRAP_LIBC_HAS_PRIi32 +#endif +#ifdef PRIi64 +#undef PRIi64 +#define MWRAP_LIBC_HAS_PRIi64 +#endif +#ifdef PRIiLEAST8 +#undef PRIiLEAST8 +#define MWRAP_LIBC_HAS_PRIiLEAST8 +#endif +#ifdef PRIiLEAST16 +#undef PRIiLEAST16 +#define MWRAP_LIBC_HAS_PRIiLEAST16 +#endif +#ifdef PRIiLEAST32 +#undef PRIiLEAST32 +#define MWRAP_LIBC_HAS_PRIiLEAST32 +#endif +#ifdef PRIiLEAST64 +#undef PRIiLEAST64 +#define MWRAP_LIBC_HAS_PRIiLEAST64 +#endif +#ifdef PRIiFAST8 +#undef PRIiFAST8 +#define MWRAP_LIBC_HAS_PRIiFAST8 +#endif +#ifdef PRIiFAST16 +#undef PRIiFAST16 +#define MWRAP_LIBC_HAS_PRIiFAST16 +#endif +#ifdef PRIiFAST32 +#undef PRIiFAST32 +#define MWRAP_LIBC_HAS_PRIiFAST32 +#endif +#ifdef PRIiFAST64 +#undef PRIiFAST64 +#define MWRAP_LIBC_HAS_PRIiFAST64 +#endif +#ifdef PRIiMAX +#undef PRIiMAX +#define MWRAP_LIBC_HAS_PRIiMAX +#endif +#ifdef PRIiPTR +#undef PRIiPTR +#define MWRAP_LIBC_HAS_PRIiPTR +#endif +#ifdef PRIo8 +#undef PRIo8 +#define MWRAP_LIBC_HAS_PRIo8 +#endif +#ifdef PRIo16 +#undef PRIo16 +#define MWRAP_LIBC_HAS_PRIo16 +#endif +#ifdef PRIo32 +#undef PRIo32 +#define MWRAP_LIBC_HAS_PRIo32 +#endif +#ifdef PRIo64 +#undef PRIo64 +#define MWRAP_LIBC_HAS_PRIo64 +#endif +#ifdef PRIoLEAST8 +#undef PRIoLEAST8 +#define MWRAP_LIBC_HAS_PRIoLEAST8 +#endif +#ifdef PRIoLEAST16 +#undef PRIoLEAST16 +#define MWRAP_LIBC_HAS_PRIoLEAST16 +#endif +#ifdef PRIoLEAST32 +#undef PRIoLEAST32 +#define MWRAP_LIBC_HAS_PRIoLEAST32 +#endif +#ifdef PRIoLEAST64 +#undef PRIoLEAST64 +#define MWRAP_LIBC_HAS_PRIoLEAST64 +#endif +#ifdef PRIoFAST8 +#undef PRIoFAST8 +#define MWRAP_LIBC_HAS_PRIoFAST8 +#endif +#ifdef PRIoFAST16 +#undef PRIoFAST16 +#define MWRAP_LIBC_HAS_PRIoFAST16 +#endif +#ifdef PRIoFAST32 +#undef PRIoFAST32 +#define MWRAP_LIBC_HAS_PRIoFAST32 +#endif +#ifdef PRIoFAST64 +#undef PRIoFAST64 +#define MWRAP_LIBC_HAS_PRIoFAST64 +#endif +#ifdef PRIoMAX +#undef PRIoMAX +#define MWRAP_LIBC_HAS_PRIoMAX +#endif +#ifdef PRIoPTR +#undef PRIoPTR +#define MWRAP_LIBC_HAS_PRIoPTR +#endif +#ifdef PRIu8 +#undef PRIu8 +#define MWRAP_LIBC_HAS_PRIu8 +#endif +#ifdef PRIu16 +#undef PRIu16 +#define MWRAP_LIBC_HAS_PRIu16 +#endif +#ifdef PRIu32 +#undef PRIu32 +#define MWRAP_LIBC_HAS_PRIu32 +#endif +#ifdef PRIu64 +#undef PRIu64 +#define MWRAP_LIBC_HAS_PRIu64 +#endif +#ifdef PRIuLEAST8 +#undef PRIuLEAST8 +#define MWRAP_LIBC_HAS_PRIuLEAST8 +#endif +#ifdef PRIuLEAST16 +#undef PRIuLEAST16 +#define MWRAP_LIBC_HAS_PRIuLEAST16 +#endif +#ifdef PRIuLEAST32 +#undef PRIuLEAST32 +#define MWRAP_LIBC_HAS_PRIuLEAST32 +#endif +#ifdef PRIuLEAST64 +#undef PRIuLEAST64 +#define MWRAP_LIBC_HAS_PRIuLEAST64 +#endif +#ifdef PRIuFAST8 +#undef PRIuFAST8 +#define MWRAP_LIBC_HAS_PRIuFAST8 +#endif +#ifdef PRIuFAST16 +#undef PRIuFAST16 +#define MWRAP_LIBC_HAS_PRIuFAST16 +#endif +#ifdef PRIuFAST32 +#undef PRIuFAST32 +#define MWRAP_LIBC_HAS_PRIuFAST32 +#endif +#ifdef PRIuFAST64 +#undef PRIuFAST64 +#define MWRAP_LIBC_HAS_PRIuFAST64 +#endif +#ifdef PRIuMAX +#undef PRIuMAX +#define MWRAP_LIBC_HAS_PRIuMAX +#endif +#ifdef PRIuPTR +#undef PRIuPTR +#define MWRAP_LIBC_HAS_PRIuPTR +#endif +#ifdef PRIx8 +#undef PRIx8 +#define MWRAP_LIBC_HAS_PRIx8 +#endif +#ifdef PRIx16 +#undef PRIx16 +#define MWRAP_LIBC_HAS_PRIx16 +#endif +#ifdef PRIx32 +#undef PRIx32 +#define MWRAP_LIBC_HAS_PRIx32 +#endif +#ifdef PRIx64 +#undef PRIx64 +#define MWRAP_LIBC_HAS_PRIx64 +#endif +#ifdef PRIxLEAST8 +#undef PRIxLEAST8 +#define MWRAP_LIBC_HAS_PRIxLEAST8 +#endif +#ifdef PRIxLEAST16 +#undef PRIxLEAST16 +#define MWRAP_LIBC_HAS_PRIxLEAST16 +#endif +#ifdef PRIxLEAST32 +#undef PRIxLEAST32 +#define MWRAP_LIBC_HAS_PRIxLEAST32 +#endif +#ifdef PRIxLEAST64 +#undef PRIxLEAST64 +#define MWRAP_LIBC_HAS_PRIxLEAST64 +#endif +#ifdef PRIxFAST8 +#undef PRIxFAST8 +#define MWRAP_LIBC_HAS_PRIxFAST8 +#endif +#ifdef PRIxFAST16 +#undef PRIxFAST16 +#define MWRAP_LIBC_HAS_PRIxFAST16 +#endif +#ifdef PRIxFAST32 +#undef PRIxFAST32 +#define MWRAP_LIBC_HAS_PRIxFAST32 +#endif +#ifdef PRIxFAST64 +#undef PRIxFAST64 +#define MWRAP_LIBC_HAS_PRIxFAST64 +#endif +#ifdef PRIxMAX +#undef PRIxMAX +#define MWRAP_LIBC_HAS_PRIxMAX +#endif +#ifdef PRIxPTR +#undef PRIxPTR +#define MWRAP_LIBC_HAS_PRIxPTR +#endif +#ifdef PRIX8 +#undef PRIX8 +#define MWRAP_LIBC_HAS_PRIX8 +#endif +#ifdef PRIX16 +#undef PRIX16 +#define MWRAP_LIBC_HAS_PRIX16 +#endif +#ifdef PRIX32 +#undef PRIX32 +#define MWRAP_LIBC_HAS_PRIX32 +#endif +#ifdef PRIX64 +#undef PRIX64 +#define MWRAP_LIBC_HAS_PRIX64 +#endif +#ifdef PRIXLEAST8 +#undef PRIXLEAST8 +#define MWRAP_LIBC_HAS_PRIXLEAST8 +#endif +#ifdef PRIXLEAST16 +#undef PRIXLEAST16 +#define MWRAP_LIBC_HAS_PRIXLEAST16 +#endif +#ifdef PRIXLEAST32 +#undef PRIXLEAST32 +#define MWRAP_LIBC_HAS_PRIXLEAST32 +#endif +#ifdef PRIXLEAST64 +#undef PRIXLEAST64 +#define MWRAP_LIBC_HAS_PRIXLEAST64 +#endif +#ifdef PRIXFAST8 +#undef PRIXFAST8 +#define MWRAP_LIBC_HAS_PRIXFAST8 +#endif +#ifdef PRIXFAST16 +#undef PRIXFAST16 +#define MWRAP_LIBC_HAS_PRIXFAST16 +#endif +#ifdef PRIXFAST32 +#undef PRIXFAST32 +#define MWRAP_LIBC_HAS_PRIXFAST32 +#endif +#ifdef PRIXFAST64 +#undef PRIXFAST64 +#define MWRAP_LIBC_HAS_PRIXFAST64 +#endif +#ifdef PRIXMAX +#undef PRIXMAX +#define MWRAP_LIBC_HAS_PRIXMAX +#endif +#ifdef PRIXPTR +#undef PRIXPTR +#define MWRAP_LIBC_HAS_PRIXPTR +#endif +#ifdef SCNd8 +#undef SCNd8 +#define MWRAP_LIBC_HAS_SCNd8 +#endif +#ifdef SCNd16 +#undef SCNd16 +#define MWRAP_LIBC_HAS_SCNd16 +#endif +#ifdef SCNd32 +#undef SCNd32 +#define MWRAP_LIBC_HAS_SCNd32 +#endif +#ifdef SCNd64 +#undef SCNd64 +#define MWRAP_LIBC_HAS_SCNd64 +#endif +#ifdef SCNdLEAST8 +#undef SCNdLEAST8 +#define MWRAP_LIBC_HAS_SCNdLEAST8 +#endif +#ifdef SCNdLEAST16 +#undef SCNdLEAST16 +#define MWRAP_LIBC_HAS_SCNdLEAST16 +#endif +#ifdef SCNdLEAST32 +#undef SCNdLEAST32 +#define MWRAP_LIBC_HAS_SCNdLEAST32 +#endif +#ifdef SCNdLEAST64 +#undef SCNdLEAST64 +#define MWRAP_LIBC_HAS_SCNdLEAST64 +#endif +#ifdef SCNdFAST8 +#undef SCNdFAST8 +#define MWRAP_LIBC_HAS_SCNdFAST8 +#endif +#ifdef SCNdFAST16 +#undef SCNdFAST16 +#define MWRAP_LIBC_HAS_SCNdFAST16 +#endif +#ifdef SCNdFAST32 +#undef SCNdFAST32 +#define MWRAP_LIBC_HAS_SCNdFAST32 +#endif +#ifdef SCNdFAST64 +#undef SCNdFAST64 +#define MWRAP_LIBC_HAS_SCNdFAST64 +#endif +#ifdef SCNdMAX +#undef SCNdMAX +#define MWRAP_LIBC_HAS_SCNdMAX +#endif +#ifdef SCNdPTR +#undef SCNdPTR +#define MWRAP_LIBC_HAS_SCNdPTR +#endif +#ifdef SCNi8 +#undef SCNi8 +#define MWRAP_LIBC_HAS_SCNi8 +#endif +#ifdef SCNi16 +#undef SCNi16 +#define MWRAP_LIBC_HAS_SCNi16 +#endif +#ifdef SCNi32 +#undef SCNi32 +#define MWRAP_LIBC_HAS_SCNi32 +#endif +#ifdef SCNi64 +#undef SCNi64 +#define MWRAP_LIBC_HAS_SCNi64 +#endif +#ifdef SCNiLEAST8 +#undef SCNiLEAST8 +#define MWRAP_LIBC_HAS_SCNiLEAST8 +#endif +#ifdef SCNiLEAST16 +#undef SCNiLEAST16 +#define MWRAP_LIBC_HAS_SCNiLEAST16 +#endif +#ifdef SCNiLEAST32 +#undef SCNiLEAST32 +#define MWRAP_LIBC_HAS_SCNiLEAST32 +#endif +#ifdef SCNiLEAST64 +#undef SCNiLEAST64 +#define MWRAP_LIBC_HAS_SCNiLEAST64 +#endif +#ifdef SCNiFAST8 +#undef SCNiFAST8 +#define MWRAP_LIBC_HAS_SCNiFAST8 +#endif +#ifdef SCNiFAST16 +#undef SCNiFAST16 +#define MWRAP_LIBC_HAS_SCNiFAST16 +#endif +#ifdef SCNiFAST32 +#undef SCNiFAST32 +#define MWRAP_LIBC_HAS_SCNiFAST32 +#endif +#ifdef SCNiFAST64 +#undef SCNiFAST64 +#define MWRAP_LIBC_HAS_SCNiFAST64 +#endif +#ifdef SCNiMAX +#undef SCNiMAX +#define MWRAP_LIBC_HAS_SCNiMAX +#endif +#ifdef SCNiPTR +#undef SCNiPTR +#define MWRAP_LIBC_HAS_SCNiPTR +#endif +#ifdef SCNo8 +#undef SCNo8 +#define MWRAP_LIBC_HAS_SCNo8 +#endif +#ifdef SCNo16 +#undef SCNo16 +#define MWRAP_LIBC_HAS_SCNo16 +#endif +#ifdef SCNo32 +#undef SCNo32 +#define MWRAP_LIBC_HAS_SCNo32 +#endif +#ifdef SCNo64 +#undef SCNo64 +#define MWRAP_LIBC_HAS_SCNo64 +#endif +#ifdef SCNoLEAST8 +#undef SCNoLEAST8 +#define MWRAP_LIBC_HAS_SCNoLEAST8 +#endif +#ifdef SCNoLEAST16 +#undef SCNoLEAST16 +#define MWRAP_LIBC_HAS_SCNoLEAST16 +#endif +#ifdef SCNoLEAST32 +#undef SCNoLEAST32 +#define MWRAP_LIBC_HAS_SCNoLEAST32 +#endif +#ifdef SCNoLEAST64 +#undef SCNoLEAST64 +#define MWRAP_LIBC_HAS_SCNoLEAST64 +#endif +#ifdef SCNoFAST8 +#undef SCNoFAST8 +#define MWRAP_LIBC_HAS_SCNoFAST8 +#endif +#ifdef SCNoFAST16 +#undef SCNoFAST16 +#define MWRAP_LIBC_HAS_SCNoFAST16 +#endif +#ifdef SCNoFAST32 +#undef SCNoFAST32 +#define MWRAP_LIBC_HAS_SCNoFAST32 +#endif +#ifdef SCNoFAST64 +#undef SCNoFAST64 +#define MWRAP_LIBC_HAS_SCNoFAST64 +#endif +#ifdef SCNoMAX +#undef SCNoMAX +#define MWRAP_LIBC_HAS_SCNoMAX +#endif +#ifdef SCNoPTR +#undef SCNoPTR +#define MWRAP_LIBC_HAS_SCNoPTR +#endif +#ifdef SCNu8 +#undef SCNu8 +#define MWRAP_LIBC_HAS_SCNu8 +#endif +#ifdef SCNu16 +#undef SCNu16 +#define MWRAP_LIBC_HAS_SCNu16 +#endif +#ifdef SCNu32 +#undef SCNu32 +#define MWRAP_LIBC_HAS_SCNu32 +#endif +#ifdef SCNu64 +#undef SCNu64 +#define MWRAP_LIBC_HAS_SCNu64 +#endif +#ifdef SCNuLEAST8 +#undef SCNuLEAST8 +#define MWRAP_LIBC_HAS_SCNuLEAST8 +#endif +#ifdef SCNuLEAST16 +#undef SCNuLEAST16 +#define MWRAP_LIBC_HAS_SCNuLEAST16 +#endif +#ifdef SCNuLEAST32 +#undef SCNuLEAST32 +#define MWRAP_LIBC_HAS_SCNuLEAST32 +#endif +#ifdef SCNuLEAST64 +#undef SCNuLEAST64 +#define MWRAP_LIBC_HAS_SCNuLEAST64 +#endif +#ifdef SCNuFAST8 +#undef SCNuFAST8 +#define MWRAP_LIBC_HAS_SCNuFAST8 +#endif +#ifdef SCNuFAST16 +#undef SCNuFAST16 +#define MWRAP_LIBC_HAS_SCNuFAST16 +#endif +#ifdef SCNuFAST32 +#undef SCNuFAST32 +#define MWRAP_LIBC_HAS_SCNuFAST32 +#endif +#ifdef SCNuFAST64 +#undef SCNuFAST64 +#define MWRAP_LIBC_HAS_SCNuFAST64 +#endif +#ifdef SCNuMAX +#undef SCNuMAX +#define MWRAP_LIBC_HAS_SCNuMAX +#endif +#ifdef SCNuPTR +#undef SCNuPTR +#define MWRAP_LIBC_HAS_SCNuPTR +#endif +#ifdef SCNx8 +#undef SCNx8 +#define MWRAP_LIBC_HAS_SCNx8 +#endif +#ifdef SCNx16 +#undef SCNx16 +#define MWRAP_LIBC_HAS_SCNx16 +#endif +#ifdef SCNx32 +#undef SCNx32 +#define MWRAP_LIBC_HAS_SCNx32 +#endif +#ifdef SCNx64 +#undef SCNx64 +#define MWRAP_LIBC_HAS_SCNx64 +#endif +#ifdef SCNxLEAST8 +#undef SCNxLEAST8 +#define MWRAP_LIBC_HAS_SCNxLEAST8 +#endif +#ifdef SCNxLEAST16 +#undef SCNxLEAST16 +#define MWRAP_LIBC_HAS_SCNxLEAST16 +#endif +#ifdef SCNxLEAST32 +#undef SCNxLEAST32 +#define MWRAP_LIBC_HAS_SCNxLEAST32 +#endif +#ifdef SCNxLEAST64 +#undef SCNxLEAST64 +#define MWRAP_LIBC_HAS_SCNxLEAST64 +#endif +#ifdef SCNxFAST8 +#undef SCNxFAST8 +#define MWRAP_LIBC_HAS_SCNxFAST8 +#endif +#ifdef SCNxFAST16 +#undef SCNxFAST16 +#define MWRAP_LIBC_HAS_SCNxFAST16 +#endif +#ifdef SCNxFAST32 +#undef SCNxFAST32 +#define MWRAP_LIBC_HAS_SCNxFAST32 +#endif +#ifdef SCNxFAST64 +#undef SCNxFAST64 +#define MWRAP_LIBC_HAS_SCNxFAST64 +#endif +#ifdef SCNxMAX +#undef SCNxMAX +#define MWRAP_LIBC_HAS_SCNxMAX +#endif +#ifdef SCNxPTR +#undef SCNxPTR +#define MWRAP_LIBC_HAS_SCNxPTR +#endif +#ifdef CHAR_BIT +#undef CHAR_BIT +#define MWRAP_LIBC_HAS_CHAR_BIT +#endif +#ifdef SCHAR_MIN +#undef SCHAR_MIN +#define MWRAP_LIBC_HAS_SCHAR_MIN +#endif +#ifdef SCHAR_MAX +#undef SCHAR_MAX +#define MWRAP_LIBC_HAS_SCHAR_MAX +#endif +#ifdef UCHAR_MAX +#undef UCHAR_MAX +#define MWRAP_LIBC_HAS_UCHAR_MAX +#endif +#ifdef CHAR_MIN +#undef CHAR_MIN +#define MWRAP_LIBC_HAS_CHAR_MIN +#endif +#ifdef CHAR_MAX +#undef CHAR_MAX +#define MWRAP_LIBC_HAS_CHAR_MAX +#endif +#ifdef MB_LEN_MAX +#undef MB_LEN_MAX +#define MWRAP_LIBC_HAS_MB_LEN_MAX +#endif +#ifdef SHRT_MIN +#undef SHRT_MIN +#define MWRAP_LIBC_HAS_SHRT_MIN +#endif +#ifdef SHRT_MAX +#undef SHRT_MAX +#define MWRAP_LIBC_HAS_SHRT_MAX +#endif +#ifdef USHRT_MAX +#undef USHRT_MAX +#define MWRAP_LIBC_HAS_USHRT_MAX +#endif +#ifdef INT_MIN +#undef INT_MIN +#define MWRAP_LIBC_HAS_INT_MIN +#endif +#ifdef INT_MAX +#undef INT_MAX +#define MWRAP_LIBC_HAS_INT_MAX +#endif +#ifdef UINT_MAX +#undef UINT_MAX +#define MWRAP_LIBC_HAS_UINT_MAX +#endif +#ifdef LONG_MIN +#undef LONG_MIN +#define MWRAP_LIBC_HAS_LONG_MIN +#endif +#ifdef LONG_MAX +#undef LONG_MAX +#define MWRAP_LIBC_HAS_LONG_MAX +#endif +#ifdef ULONG_MAX +#undef ULONG_MAX +#define MWRAP_LIBC_HAS_ULONG_MAX +#endif +#ifdef LLONG_MIN +#undef LLONG_MIN +#define MWRAP_LIBC_HAS_LLONG_MIN +#endif +#ifdef LLONG_MAX +#undef LLONG_MAX +#define MWRAP_LIBC_HAS_LLONG_MAX +#endif +#ifdef ULLONG_MAX +#undef ULLONG_MAX +#define MWRAP_LIBC_HAS_ULLONG_MAX +#endif +#ifdef LC_ALL +#undef LC_ALL +#define MWRAP_LIBC_HAS_LC_ALL +#endif +#ifdef LC_COLLATE +#undef LC_COLLATE +#define MWRAP_LIBC_HAS_LC_COLLATE +#endif +#ifdef LC_CTYPE +#undef LC_CTYPE +#define MWRAP_LIBC_HAS_LC_CTYPE +#endif +#ifdef LC_MONETARY +#undef LC_MONETARY +#define MWRAP_LIBC_HAS_LC_MONETARY +#endif +#ifdef LC_NUMERIC +#undef LC_NUMERIC +#define MWRAP_LIBC_HAS_LC_NUMERIC +#endif +#ifdef LC_TIME +#undef LC_TIME +#define MWRAP_LIBC_HAS_LC_TIME +#endif +#ifdef HUGE_VAL +#undef HUGE_VAL +#define MWRAP_LIBC_HAS_HUGE_VAL +#endif +#ifdef HUGE_VALF +#undef HUGE_VALF +#define MWRAP_LIBC_HAS_HUGE_VALF +#endif +#ifdef HUGE_VALL +#undef HUGE_VALL +#define MWRAP_LIBC_HAS_HUGE_VALL +#endif +#ifdef INFINITY +#undef INFINITY +#define MWRAP_LIBC_HAS_INFINITY +#endif +#ifdef NAN +#undef NAN +#define MWRAP_LIBC_HAS_NAN +#endif +#ifdef FP_INFINITE +#undef FP_INFINITE +#define MWRAP_LIBC_HAS_FP_INFINITE +#endif +#ifdef FP_NAN +#undef FP_NAN +#define MWRAP_LIBC_HAS_FP_NAN +#endif +#ifdef FP_NORMAL +#undef FP_NORMAL +#define MWRAP_LIBC_HAS_FP_NORMAL +#endif +#ifdef FP_SUBNORMAL +#undef FP_SUBNORMAL +#define MWRAP_LIBC_HAS_FP_SUBNORMAL +#endif +#ifdef FP_ZERO +#undef FP_ZERO +#define MWRAP_LIBC_HAS_FP_ZERO +#endif +#ifdef FP_FAST_FMA +#undef FP_FAST_FMA +#define MWRAP_LIBC_HAS_FP_FAST_FMA +#endif +#ifdef FP_FAST_FMAF +#undef FP_FAST_FMAF +#define MWRAP_LIBC_HAS_FP_FAST_FMAF +#endif +#ifdef FP_FAST_FMAL +#undef FP_FAST_FMAL +#define MWRAP_LIBC_HAS_FP_FAST_FMAL +#endif +#ifdef FP_ILOGB0 +#undef FP_ILOGB0 +#define MWRAP_LIBC_HAS_FP_ILOGB0 +#endif +#ifdef FP_ILOGBNAN +#undef FP_ILOGBNAN +#define MWRAP_LIBC_HAS_FP_ILOGBNAN +#endif +#ifdef MATH_ERRNO +#undef MATH_ERRNO +#define MWRAP_LIBC_HAS_MATH_ERRNO +#endif +#ifdef MATH_ERREXCEPT +#undef MATH_ERREXCEPT +#define MWRAP_LIBC_HAS_MATH_ERREXCEPT +#endif +#ifdef math_errhandling +#undef math_errhandling +#define MWRAP_LIBC_HAS_math_errhandling +#endif +#ifdef SIG_DFL +#undef SIG_DFL +#define MWRAP_LIBC_HAS_SIG_DFL +#endif +#ifdef SIG_ERR +#undef SIG_ERR +#define MWRAP_LIBC_HAS_SIG_ERR +#endif +#ifdef SIG_IGN +#undef SIG_IGN +#define MWRAP_LIBC_HAS_SIG_IGN +#endif +#ifdef SIGABRT +#undef SIGABRT +#define MWRAP_LIBC_HAS_SIGABRT +#endif +#ifdef SIGFPE +#undef SIGFPE +#define MWRAP_LIBC_HAS_SIGFPE +#endif +#ifdef SIGILL +#undef SIGILL +#define MWRAP_LIBC_HAS_SIGILL +#endif +#ifdef SIGINT +#undef SIGINT +#define MWRAP_LIBC_HAS_SIGINT +#endif +#ifdef SIGSEGV +#undef SIGSEGV +#define MWRAP_LIBC_HAS_SIGSEGV +#endif +#ifdef SIGTERM +#undef SIGTERM +#define MWRAP_LIBC_HAS_SIGTERM +#endif +#ifdef INT8_MIN +#undef INT8_MIN +#define MWRAP_LIBC_HAS_INT8_MIN +#endif +#ifdef INT8_MAX +#undef INT8_MAX +#define MWRAP_LIBC_HAS_INT8_MAX +#endif +#ifdef UINT8_MAX +#undef UINT8_MAX +#define MWRAP_LIBC_HAS_UINT8_MAX +#endif +#ifdef INT_LEAST8_MIN +#undef INT_LEAST8_MIN +#define MWRAP_LIBC_HAS_INT_LEAST8_MIN +#endif +#ifdef INT_LEAST8_MAX +#undef INT_LEAST8_MAX +#define MWRAP_LIBC_HAS_INT_LEAST8_MAX +#endif +#ifdef UINT_LEAST8_MAX +#undef UINT_LEAST8_MAX +#define MWRAP_LIBC_HAS_UINT_LEAST8_MAX +#endif +#ifdef INT_FAST8_MIN +#undef INT_FAST8_MIN +#define MWRAP_LIBC_HAS_INT_FAST8_MIN +#endif +#ifdef INT_FAST8_MAX +#undef INT_FAST8_MAX +#define MWRAP_LIBC_HAS_INT_FAST8_MAX +#endif +#ifdef UINT_FAST8_MAX +#undef UINT_FAST8_MAX +#define MWRAP_LIBC_HAS_UINT_FAST8_MAX +#endif +#ifdef INT16_MIN +#undef INT16_MIN +#define MWRAP_LIBC_HAS_INT16_MIN +#endif +#ifdef INT16_MAX +#undef INT16_MAX +#define MWRAP_LIBC_HAS_INT16_MAX +#endif +#ifdef UINT16_MAX +#undef UINT16_MAX +#define MWRAP_LIBC_HAS_UINT16_MAX +#endif +#ifdef INT_LEAST16_MIN +#undef INT_LEAST16_MIN +#define MWRAP_LIBC_HAS_INT_LEAST16_MIN +#endif +#ifdef INT_LEAST16_MAX +#undef INT_LEAST16_MAX +#define MWRAP_LIBC_HAS_INT_LEAST16_MAX +#endif +#ifdef UINT_LEAST16_MAX +#undef UINT_LEAST16_MAX +#define MWRAP_LIBC_HAS_UINT_LEAST16_MAX +#endif +#ifdef INT_FAST16_MIN +#undef INT_FAST16_MIN +#define MWRAP_LIBC_HAS_INT_FAST16_MIN +#endif +#ifdef INT_FAST16_MAX +#undef INT_FAST16_MAX +#define MWRAP_LIBC_HAS_INT_FAST16_MAX +#endif +#ifdef UINT_FAST16_MAX +#undef UINT_FAST16_MAX +#define MWRAP_LIBC_HAS_UINT_FAST16_MAX +#endif +#ifdef INT32_MIN +#undef INT32_MIN +#define MWRAP_LIBC_HAS_INT32_MIN +#endif +#ifdef INT32_MAX +#undef INT32_MAX +#define MWRAP_LIBC_HAS_INT32_MAX +#endif +#ifdef UINT32_MAX +#undef UINT32_MAX +#define MWRAP_LIBC_HAS_UINT32_MAX +#endif +#ifdef INT_LEAST32_MIN +#undef INT_LEAST32_MIN +#define MWRAP_LIBC_HAS_INT_LEAST32_MIN +#endif +#ifdef INT_LEAST32_MAX +#undef INT_LEAST32_MAX +#define MWRAP_LIBC_HAS_INT_LEAST32_MAX +#endif +#ifdef UINT_LEAST32_MAX +#undef UINT_LEAST32_MAX +#define MWRAP_LIBC_HAS_UINT_LEAST32_MAX +#endif +#ifdef INT_FAST32_MIN +#undef INT_FAST32_MIN +#define MWRAP_LIBC_HAS_INT_FAST32_MIN +#endif +#ifdef INT_FAST32_MAX +#undef INT_FAST32_MAX +#define MWRAP_LIBC_HAS_INT_FAST32_MAX +#endif +#ifdef UINT_FAST32_MAX +#undef UINT_FAST32_MAX +#define MWRAP_LIBC_HAS_UINT_FAST32_MAX +#endif +#ifdef INT64_MIN +#undef INT64_MIN +#define MWRAP_LIBC_HAS_INT64_MIN +#endif +#ifdef INT64_MAX +#undef INT64_MAX +#define MWRAP_LIBC_HAS_INT64_MAX +#endif +#ifdef UINT64_MAX +#undef UINT64_MAX +#define MWRAP_LIBC_HAS_UINT64_MAX +#endif +#ifdef INT_LEAST64_MIN +#undef INT_LEAST64_MIN +#define MWRAP_LIBC_HAS_INT_LEAST64_MIN +#endif +#ifdef INT_LEAST64_MAX +#undef INT_LEAST64_MAX +#define MWRAP_LIBC_HAS_INT_LEAST64_MAX +#endif +#ifdef UINT_LEAST64_MAX +#undef UINT_LEAST64_MAX +#define MWRAP_LIBC_HAS_UINT_LEAST64_MAX +#endif +#ifdef INT_FAST64_MIN +#undef INT_FAST64_MIN +#define MWRAP_LIBC_HAS_INT_FAST64_MIN +#endif +#ifdef INT_FAST64_MAX +#undef INT_FAST64_MAX +#define MWRAP_LIBC_HAS_INT_FAST64_MAX +#endif +#ifdef UINT_FAST64_MAX +#undef UINT_FAST64_MAX +#define MWRAP_LIBC_HAS_UINT_FAST64_MAX +#endif +#ifdef INTPTR_MIN +#undef INTPTR_MIN +#define MWRAP_LIBC_HAS_INTPTR_MIN +#endif +#ifdef INTPTR_MAX +#undef INTPTR_MAX +#define MWRAP_LIBC_HAS_INTPTR_MAX +#endif +#ifdef UINTPTR_MAX +#undef UINTPTR_MAX +#define MWRAP_LIBC_HAS_UINTPTR_MAX +#endif +#ifdef INTMAX_MIN +#undef INTMAX_MIN +#define MWRAP_LIBC_HAS_INTMAX_MIN +#endif +#ifdef INTMAX_MAX +#undef INTMAX_MAX +#define MWRAP_LIBC_HAS_INTMAX_MAX +#endif +#ifdef UINTMAX_MAX +#undef UINTMAX_MAX +#define MWRAP_LIBC_HAS_UINTMAX_MAX +#endif +#ifdef PTRDIFF_MIN +#undef PTRDIFF_MIN +#define MWRAP_LIBC_HAS_PTRDIFF_MIN +#endif +#ifdef PTRDIFF_MAX +#undef PTRDIFF_MAX +#define MWRAP_LIBC_HAS_PTRDIFF_MAX +#endif +#ifdef SIG_ATOMIC_MIN +#undef SIG_ATOMIC_MIN +#define MWRAP_LIBC_HAS_SIG_ATOMIC_MIN +#endif +#ifdef SIG_ATOMIC_MAX +#undef SIG_ATOMIC_MAX +#define MWRAP_LIBC_HAS_SIG_ATOMIC_MAX +#endif +#ifdef SIZE_MAX +#undef SIZE_MAX +#define MWRAP_LIBC_HAS_SIZE_MAX +#endif +#ifdef WCHAR_MIN +#undef WCHAR_MIN +#define MWRAP_LIBC_HAS_WCHAR_MIN +#endif +#ifdef WCHAR_MAX +#undef WCHAR_MAX +#define MWRAP_LIBC_HAS_WCHAR_MAX +#endif +#ifdef WINT_MIN +#undef WINT_MIN +#define MWRAP_LIBC_HAS_WINT_MIN +#endif +#ifdef WINT_MAX +#undef WINT_MAX +#define MWRAP_LIBC_HAS_WINT_MAX +#endif +#ifdef _IOFBF +#undef _IOFBF +#define MWRAP_LIBC_HAS__IOFBF +#endif +#ifdef _IOLBF +#undef _IOLBF +#define MWRAP_LIBC_HAS__IOLBF +#endif +#ifdef _IONBF +#undef _IONBF +#define MWRAP_LIBC_HAS__IONBF +#endif +#ifdef BUFSIZ +#undef BUFSIZ +#define MWRAP_LIBC_HAS_BUFSIZ +#endif +#ifdef EOF +#undef EOF +#define MWRAP_LIBC_HAS_EOF +#endif +#ifdef FOPEN_MAX +#undef FOPEN_MAX +#define MWRAP_LIBC_HAS_FOPEN_MAX +#endif +#ifdef FILENAME_MAX +#undef FILENAME_MAX +#define MWRAP_LIBC_HAS_FILENAME_MAX +#endif +#ifdef L_tmpnam +#undef L_tmpnam +#define MWRAP_LIBC_HAS_L_tmpnam +#endif +#ifdef SEEK_CUR +#undef SEEK_CUR +#define MWRAP_LIBC_HAS_SEEK_CUR +#endif +#ifdef SEEK_END +#undef SEEK_END +#define MWRAP_LIBC_HAS_SEEK_END +#endif +#ifdef SEEK_SET +#undef SEEK_SET +#define MWRAP_LIBC_HAS_SEEK_SET +#endif +#ifdef TMP_MAX +#undef TMP_MAX +#define MWRAP_LIBC_HAS_TMP_MAX +#endif +#ifdef stderr +#undef stderr +#define MWRAP_LIBC_HAS_stderr +#endif +#ifdef stdin +#undef stdin +#define MWRAP_LIBC_HAS_stdin +#endif +#ifdef stdout +#undef stdout +#define MWRAP_LIBC_HAS_stdout +#endif +#ifdef EXIT_FAILURE +#undef EXIT_FAILURE +#define MWRAP_LIBC_HAS_EXIT_FAILURE +#endif +#ifdef EXIT_SUCCESS +#undef EXIT_SUCCESS +#define MWRAP_LIBC_HAS_EXIT_SUCCESS +#endif +#ifdef RAND_MAX +#undef RAND_MAX +#define MWRAP_LIBC_HAS_RAND_MAX +#endif +#ifdef MB_CUR_MAX +#undef MB_CUR_MAX +#define MWRAP_LIBC_HAS_MB_CUR_MAX +#endif +#ifdef CLOCKS_PER_SEC +#undef CLOCKS_PER_SEC +#define MWRAP_LIBC_HAS_CLOCKS_PER_SEC +#endif +#ifdef TIME_UTC +#undef TIME_UTC +#define MWRAP_LIBC_HAS_TIME_UTC +#endif +#ifdef WEOF +#undef WEOF +#define MWRAP_LIBC_HAS_WEOF +#endif + +export module mcpplibs.mwrap.libc.macros; + +export namespace mcpplibs::mwrap::libc::macros { +#ifdef MWRAP_LIBC_HAS_EDOM +inline constexpr auto EDOM = mwrap_libc_capture::value_EDOM; +#endif +#ifdef MWRAP_LIBC_HAS_EILSEQ +inline constexpr auto EILSEQ = mwrap_libc_capture::value_EILSEQ; +#endif +#ifdef MWRAP_LIBC_HAS_ERANGE +inline constexpr auto ERANGE = mwrap_libc_capture::value_ERANGE; +#endif +#ifdef MWRAP_LIBC_HAS_errno +constexpr decltype(auto) errno() { return mwrap_libc_capture::get_errno(); } +#endif +#ifdef MWRAP_LIBC_HAS_FE_DIVBYZERO +inline constexpr auto FE_DIVBYZERO = mwrap_libc_capture::value_FE_DIVBYZERO; +#endif +#ifdef MWRAP_LIBC_HAS_FE_INEXACT +inline constexpr auto FE_INEXACT = mwrap_libc_capture::value_FE_INEXACT; +#endif +#ifdef MWRAP_LIBC_HAS_FE_INVALID +inline constexpr auto FE_INVALID = mwrap_libc_capture::value_FE_INVALID; +#endif +#ifdef MWRAP_LIBC_HAS_FE_OVERFLOW +inline constexpr auto FE_OVERFLOW = mwrap_libc_capture::value_FE_OVERFLOW; +#endif +#ifdef MWRAP_LIBC_HAS_FE_UNDERFLOW +inline constexpr auto FE_UNDERFLOW = mwrap_libc_capture::value_FE_UNDERFLOW; +#endif +#ifdef MWRAP_LIBC_HAS_FE_ALL_EXCEPT +inline constexpr auto FE_ALL_EXCEPT = mwrap_libc_capture::value_FE_ALL_EXCEPT; +#endif +#ifdef MWRAP_LIBC_HAS_FE_DOWNWARD +inline constexpr auto FE_DOWNWARD = mwrap_libc_capture::value_FE_DOWNWARD; +#endif +#ifdef MWRAP_LIBC_HAS_FE_TONEAREST +inline constexpr auto FE_TONEAREST = mwrap_libc_capture::value_FE_TONEAREST; +#endif +#ifdef MWRAP_LIBC_HAS_FE_TOWARDZERO +inline constexpr auto FE_TOWARDZERO = mwrap_libc_capture::value_FE_TOWARDZERO; +#endif +#ifdef MWRAP_LIBC_HAS_FE_UPWARD +inline constexpr auto FE_UPWARD = mwrap_libc_capture::value_FE_UPWARD; +#endif +#ifdef MWRAP_LIBC_HAS_FE_DFL_ENV +constexpr decltype(auto) FE_DFL_ENV() { return mwrap_libc_capture::get_FE_DFL_ENV(); } +#endif +#ifdef MWRAP_LIBC_HAS_FLT_ROUNDS +constexpr decltype(auto) FLT_ROUNDS() { return mwrap_libc_capture::get_FLT_ROUNDS(); } +#endif +#ifdef MWRAP_LIBC_HAS_FLT_EVAL_METHOD +constexpr decltype(auto) FLT_EVAL_METHOD() { return mwrap_libc_capture::get_FLT_EVAL_METHOD(); } +#endif +#ifdef MWRAP_LIBC_HAS_FLT_HAS_SUBNORM +inline constexpr auto FLT_HAS_SUBNORM = mwrap_libc_capture::value_FLT_HAS_SUBNORM; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_HAS_SUBNORM +inline constexpr auto DBL_HAS_SUBNORM = mwrap_libc_capture::value_DBL_HAS_SUBNORM; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_HAS_SUBNORM +inline constexpr auto LDBL_HAS_SUBNORM = mwrap_libc_capture::value_LDBL_HAS_SUBNORM; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_RADIX +inline constexpr auto FLT_RADIX = mwrap_libc_capture::value_FLT_RADIX; +#endif +#ifdef MWRAP_LIBC_HAS_DECIMAL_DIG +inline constexpr auto DECIMAL_DIG = mwrap_libc_capture::value_DECIMAL_DIG; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MANT_DIG +inline constexpr auto FLT_MANT_DIG = mwrap_libc_capture::value_FLT_MANT_DIG; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MANT_DIG +inline constexpr auto DBL_MANT_DIG = mwrap_libc_capture::value_DBL_MANT_DIG; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MANT_DIG +inline constexpr auto LDBL_MANT_DIG = mwrap_libc_capture::value_LDBL_MANT_DIG; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_DECIMAL_DIG +inline constexpr auto FLT_DECIMAL_DIG = mwrap_libc_capture::value_FLT_DECIMAL_DIG; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_DECIMAL_DIG +inline constexpr auto DBL_DECIMAL_DIG = mwrap_libc_capture::value_DBL_DECIMAL_DIG; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_DECIMAL_DIG +inline constexpr auto LDBL_DECIMAL_DIG = mwrap_libc_capture::value_LDBL_DECIMAL_DIG; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_DIG +inline constexpr auto FLT_DIG = mwrap_libc_capture::value_FLT_DIG; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_DIG +inline constexpr auto DBL_DIG = mwrap_libc_capture::value_DBL_DIG; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_DIG +inline constexpr auto LDBL_DIG = mwrap_libc_capture::value_LDBL_DIG; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MIN_EXP +inline constexpr auto FLT_MIN_EXP = mwrap_libc_capture::value_FLT_MIN_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MIN_EXP +inline constexpr auto DBL_MIN_EXP = mwrap_libc_capture::value_DBL_MIN_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MIN_EXP +inline constexpr auto LDBL_MIN_EXP = mwrap_libc_capture::value_LDBL_MIN_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MIN_10_EXP +inline constexpr auto FLT_MIN_10_EXP = mwrap_libc_capture::value_FLT_MIN_10_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MIN_10_EXP +inline constexpr auto DBL_MIN_10_EXP = mwrap_libc_capture::value_DBL_MIN_10_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MIN_10_EXP +inline constexpr auto LDBL_MIN_10_EXP = mwrap_libc_capture::value_LDBL_MIN_10_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MAX_EXP +inline constexpr auto FLT_MAX_EXP = mwrap_libc_capture::value_FLT_MAX_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MAX_EXP +inline constexpr auto DBL_MAX_EXP = mwrap_libc_capture::value_DBL_MAX_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MAX_EXP +inline constexpr auto LDBL_MAX_EXP = mwrap_libc_capture::value_LDBL_MAX_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MAX_10_EXP +inline constexpr auto FLT_MAX_10_EXP = mwrap_libc_capture::value_FLT_MAX_10_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MAX_10_EXP +inline constexpr auto DBL_MAX_10_EXP = mwrap_libc_capture::value_DBL_MAX_10_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MAX_10_EXP +inline constexpr auto LDBL_MAX_10_EXP = mwrap_libc_capture::value_LDBL_MAX_10_EXP; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MAX +inline constexpr auto FLT_MAX = mwrap_libc_capture::value_FLT_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MAX +inline constexpr auto DBL_MAX = mwrap_libc_capture::value_DBL_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MAX +inline constexpr auto LDBL_MAX = mwrap_libc_capture::value_LDBL_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_EPSILON +inline constexpr auto FLT_EPSILON = mwrap_libc_capture::value_FLT_EPSILON; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_EPSILON +inline constexpr auto DBL_EPSILON = mwrap_libc_capture::value_DBL_EPSILON; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_EPSILON +inline constexpr auto LDBL_EPSILON = mwrap_libc_capture::value_LDBL_EPSILON; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MIN +inline constexpr auto FLT_MIN = mwrap_libc_capture::value_FLT_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MIN +inline constexpr auto DBL_MIN = mwrap_libc_capture::value_DBL_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MIN +inline constexpr auto LDBL_MIN = mwrap_libc_capture::value_LDBL_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_FLT_TRUE_MIN +inline constexpr auto FLT_TRUE_MIN = mwrap_libc_capture::value_FLT_TRUE_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_DBL_TRUE_MIN +inline constexpr auto DBL_TRUE_MIN = mwrap_libc_capture::value_DBL_TRUE_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_TRUE_MIN +inline constexpr auto LDBL_TRUE_MIN = mwrap_libc_capture::value_LDBL_TRUE_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_PRId8 +inline constexpr auto PRId8 = mwrap_libc_capture::value_PRId8; +#endif +#ifdef MWRAP_LIBC_HAS_PRId16 +inline constexpr auto PRId16 = mwrap_libc_capture::value_PRId16; +#endif +#ifdef MWRAP_LIBC_HAS_PRId32 +inline constexpr auto PRId32 = mwrap_libc_capture::value_PRId32; +#endif +#ifdef MWRAP_LIBC_HAS_PRId64 +inline constexpr auto PRId64 = mwrap_libc_capture::value_PRId64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIdLEAST8 +inline constexpr auto PRIdLEAST8 = mwrap_libc_capture::value_PRIdLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIdLEAST16 +inline constexpr auto PRIdLEAST16 = mwrap_libc_capture::value_PRIdLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIdLEAST32 +inline constexpr auto PRIdLEAST32 = mwrap_libc_capture::value_PRIdLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIdLEAST64 +inline constexpr auto PRIdLEAST64 = mwrap_libc_capture::value_PRIdLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIdFAST8 +inline constexpr auto PRIdFAST8 = mwrap_libc_capture::value_PRIdFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIdFAST16 +inline constexpr auto PRIdFAST16 = mwrap_libc_capture::value_PRIdFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIdFAST32 +inline constexpr auto PRIdFAST32 = mwrap_libc_capture::value_PRIdFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIdFAST64 +inline constexpr auto PRIdFAST64 = mwrap_libc_capture::value_PRIdFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIdMAX +inline constexpr auto PRIdMAX = mwrap_libc_capture::value_PRIdMAX; +#endif +#ifdef MWRAP_LIBC_HAS_PRIdPTR +inline constexpr auto PRIdPTR = mwrap_libc_capture::value_PRIdPTR; +#endif +#ifdef MWRAP_LIBC_HAS_PRIi8 +inline constexpr auto PRIi8 = mwrap_libc_capture::value_PRIi8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIi16 +inline constexpr auto PRIi16 = mwrap_libc_capture::value_PRIi16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIi32 +inline constexpr auto PRIi32 = mwrap_libc_capture::value_PRIi32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIi64 +inline constexpr auto PRIi64 = mwrap_libc_capture::value_PRIi64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIiLEAST8 +inline constexpr auto PRIiLEAST8 = mwrap_libc_capture::value_PRIiLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIiLEAST16 +inline constexpr auto PRIiLEAST16 = mwrap_libc_capture::value_PRIiLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIiLEAST32 +inline constexpr auto PRIiLEAST32 = mwrap_libc_capture::value_PRIiLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIiLEAST64 +inline constexpr auto PRIiLEAST64 = mwrap_libc_capture::value_PRIiLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIiFAST8 +inline constexpr auto PRIiFAST8 = mwrap_libc_capture::value_PRIiFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIiFAST16 +inline constexpr auto PRIiFAST16 = mwrap_libc_capture::value_PRIiFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIiFAST32 +inline constexpr auto PRIiFAST32 = mwrap_libc_capture::value_PRIiFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIiFAST64 +inline constexpr auto PRIiFAST64 = mwrap_libc_capture::value_PRIiFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIiMAX +inline constexpr auto PRIiMAX = mwrap_libc_capture::value_PRIiMAX; +#endif +#ifdef MWRAP_LIBC_HAS_PRIiPTR +inline constexpr auto PRIiPTR = mwrap_libc_capture::value_PRIiPTR; +#endif +#ifdef MWRAP_LIBC_HAS_PRIo8 +inline constexpr auto PRIo8 = mwrap_libc_capture::value_PRIo8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIo16 +inline constexpr auto PRIo16 = mwrap_libc_capture::value_PRIo16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIo32 +inline constexpr auto PRIo32 = mwrap_libc_capture::value_PRIo32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIo64 +inline constexpr auto PRIo64 = mwrap_libc_capture::value_PRIo64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIoLEAST8 +inline constexpr auto PRIoLEAST8 = mwrap_libc_capture::value_PRIoLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIoLEAST16 +inline constexpr auto PRIoLEAST16 = mwrap_libc_capture::value_PRIoLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIoLEAST32 +inline constexpr auto PRIoLEAST32 = mwrap_libc_capture::value_PRIoLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIoLEAST64 +inline constexpr auto PRIoLEAST64 = mwrap_libc_capture::value_PRIoLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIoFAST8 +inline constexpr auto PRIoFAST8 = mwrap_libc_capture::value_PRIoFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIoFAST16 +inline constexpr auto PRIoFAST16 = mwrap_libc_capture::value_PRIoFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIoFAST32 +inline constexpr auto PRIoFAST32 = mwrap_libc_capture::value_PRIoFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIoFAST64 +inline constexpr auto PRIoFAST64 = mwrap_libc_capture::value_PRIoFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIoMAX +inline constexpr auto PRIoMAX = mwrap_libc_capture::value_PRIoMAX; +#endif +#ifdef MWRAP_LIBC_HAS_PRIoPTR +inline constexpr auto PRIoPTR = mwrap_libc_capture::value_PRIoPTR; +#endif +#ifdef MWRAP_LIBC_HAS_PRIu8 +inline constexpr auto PRIu8 = mwrap_libc_capture::value_PRIu8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIu16 +inline constexpr auto PRIu16 = mwrap_libc_capture::value_PRIu16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIu32 +inline constexpr auto PRIu32 = mwrap_libc_capture::value_PRIu32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIu64 +inline constexpr auto PRIu64 = mwrap_libc_capture::value_PRIu64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIuLEAST8 +inline constexpr auto PRIuLEAST8 = mwrap_libc_capture::value_PRIuLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIuLEAST16 +inline constexpr auto PRIuLEAST16 = mwrap_libc_capture::value_PRIuLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIuLEAST32 +inline constexpr auto PRIuLEAST32 = mwrap_libc_capture::value_PRIuLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIuLEAST64 +inline constexpr auto PRIuLEAST64 = mwrap_libc_capture::value_PRIuLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIuFAST8 +inline constexpr auto PRIuFAST8 = mwrap_libc_capture::value_PRIuFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIuFAST16 +inline constexpr auto PRIuFAST16 = mwrap_libc_capture::value_PRIuFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIuFAST32 +inline constexpr auto PRIuFAST32 = mwrap_libc_capture::value_PRIuFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIuFAST64 +inline constexpr auto PRIuFAST64 = mwrap_libc_capture::value_PRIuFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIuMAX +inline constexpr auto PRIuMAX = mwrap_libc_capture::value_PRIuMAX; +#endif +#ifdef MWRAP_LIBC_HAS_PRIuPTR +inline constexpr auto PRIuPTR = mwrap_libc_capture::value_PRIuPTR; +#endif +#ifdef MWRAP_LIBC_HAS_PRIx8 +inline constexpr auto PRIx8 = mwrap_libc_capture::value_PRIx8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIx16 +inline constexpr auto PRIx16 = mwrap_libc_capture::value_PRIx16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIx32 +inline constexpr auto PRIx32 = mwrap_libc_capture::value_PRIx32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIx64 +inline constexpr auto PRIx64 = mwrap_libc_capture::value_PRIx64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIxLEAST8 +inline constexpr auto PRIxLEAST8 = mwrap_libc_capture::value_PRIxLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIxLEAST16 +inline constexpr auto PRIxLEAST16 = mwrap_libc_capture::value_PRIxLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIxLEAST32 +inline constexpr auto PRIxLEAST32 = mwrap_libc_capture::value_PRIxLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIxLEAST64 +inline constexpr auto PRIxLEAST64 = mwrap_libc_capture::value_PRIxLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIxFAST8 +inline constexpr auto PRIxFAST8 = mwrap_libc_capture::value_PRIxFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIxFAST16 +inline constexpr auto PRIxFAST16 = mwrap_libc_capture::value_PRIxFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIxFAST32 +inline constexpr auto PRIxFAST32 = mwrap_libc_capture::value_PRIxFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIxFAST64 +inline constexpr auto PRIxFAST64 = mwrap_libc_capture::value_PRIxFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIxMAX +inline constexpr auto PRIxMAX = mwrap_libc_capture::value_PRIxMAX; +#endif +#ifdef MWRAP_LIBC_HAS_PRIxPTR +inline constexpr auto PRIxPTR = mwrap_libc_capture::value_PRIxPTR; +#endif +#ifdef MWRAP_LIBC_HAS_PRIX8 +inline constexpr auto PRIX8 = mwrap_libc_capture::value_PRIX8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIX16 +inline constexpr auto PRIX16 = mwrap_libc_capture::value_PRIX16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIX32 +inline constexpr auto PRIX32 = mwrap_libc_capture::value_PRIX32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIX64 +inline constexpr auto PRIX64 = mwrap_libc_capture::value_PRIX64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIXLEAST8 +inline constexpr auto PRIXLEAST8 = mwrap_libc_capture::value_PRIXLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIXLEAST16 +inline constexpr auto PRIXLEAST16 = mwrap_libc_capture::value_PRIXLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIXLEAST32 +inline constexpr auto PRIXLEAST32 = mwrap_libc_capture::value_PRIXLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIXLEAST64 +inline constexpr auto PRIXLEAST64 = mwrap_libc_capture::value_PRIXLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIXFAST8 +inline constexpr auto PRIXFAST8 = mwrap_libc_capture::value_PRIXFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_PRIXFAST16 +inline constexpr auto PRIXFAST16 = mwrap_libc_capture::value_PRIXFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_PRIXFAST32 +inline constexpr auto PRIXFAST32 = mwrap_libc_capture::value_PRIXFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_PRIXFAST64 +inline constexpr auto PRIXFAST64 = mwrap_libc_capture::value_PRIXFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_PRIXMAX +inline constexpr auto PRIXMAX = mwrap_libc_capture::value_PRIXMAX; +#endif +#ifdef MWRAP_LIBC_HAS_PRIXPTR +inline constexpr auto PRIXPTR = mwrap_libc_capture::value_PRIXPTR; +#endif +#ifdef MWRAP_LIBC_HAS_SCNd8 +inline constexpr auto SCNd8 = mwrap_libc_capture::value_SCNd8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNd16 +inline constexpr auto SCNd16 = mwrap_libc_capture::value_SCNd16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNd32 +inline constexpr auto SCNd32 = mwrap_libc_capture::value_SCNd32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNd64 +inline constexpr auto SCNd64 = mwrap_libc_capture::value_SCNd64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNdLEAST8 +inline constexpr auto SCNdLEAST8 = mwrap_libc_capture::value_SCNdLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNdLEAST16 +inline constexpr auto SCNdLEAST16 = mwrap_libc_capture::value_SCNdLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNdLEAST32 +inline constexpr auto SCNdLEAST32 = mwrap_libc_capture::value_SCNdLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNdLEAST64 +inline constexpr auto SCNdLEAST64 = mwrap_libc_capture::value_SCNdLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNdFAST8 +inline constexpr auto SCNdFAST8 = mwrap_libc_capture::value_SCNdFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNdFAST16 +inline constexpr auto SCNdFAST16 = mwrap_libc_capture::value_SCNdFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNdFAST32 +inline constexpr auto SCNdFAST32 = mwrap_libc_capture::value_SCNdFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNdFAST64 +inline constexpr auto SCNdFAST64 = mwrap_libc_capture::value_SCNdFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNdMAX +inline constexpr auto SCNdMAX = mwrap_libc_capture::value_SCNdMAX; +#endif +#ifdef MWRAP_LIBC_HAS_SCNdPTR +inline constexpr auto SCNdPTR = mwrap_libc_capture::value_SCNdPTR; +#endif +#ifdef MWRAP_LIBC_HAS_SCNi8 +inline constexpr auto SCNi8 = mwrap_libc_capture::value_SCNi8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNi16 +inline constexpr auto SCNi16 = mwrap_libc_capture::value_SCNi16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNi32 +inline constexpr auto SCNi32 = mwrap_libc_capture::value_SCNi32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNi64 +inline constexpr auto SCNi64 = mwrap_libc_capture::value_SCNi64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNiLEAST8 +inline constexpr auto SCNiLEAST8 = mwrap_libc_capture::value_SCNiLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNiLEAST16 +inline constexpr auto SCNiLEAST16 = mwrap_libc_capture::value_SCNiLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNiLEAST32 +inline constexpr auto SCNiLEAST32 = mwrap_libc_capture::value_SCNiLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNiLEAST64 +inline constexpr auto SCNiLEAST64 = mwrap_libc_capture::value_SCNiLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNiFAST8 +inline constexpr auto SCNiFAST8 = mwrap_libc_capture::value_SCNiFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNiFAST16 +inline constexpr auto SCNiFAST16 = mwrap_libc_capture::value_SCNiFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNiFAST32 +inline constexpr auto SCNiFAST32 = mwrap_libc_capture::value_SCNiFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNiFAST64 +inline constexpr auto SCNiFAST64 = mwrap_libc_capture::value_SCNiFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNiMAX +inline constexpr auto SCNiMAX = mwrap_libc_capture::value_SCNiMAX; +#endif +#ifdef MWRAP_LIBC_HAS_SCNiPTR +inline constexpr auto SCNiPTR = mwrap_libc_capture::value_SCNiPTR; +#endif +#ifdef MWRAP_LIBC_HAS_SCNo8 +inline constexpr auto SCNo8 = mwrap_libc_capture::value_SCNo8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNo16 +inline constexpr auto SCNo16 = mwrap_libc_capture::value_SCNo16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNo32 +inline constexpr auto SCNo32 = mwrap_libc_capture::value_SCNo32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNo64 +inline constexpr auto SCNo64 = mwrap_libc_capture::value_SCNo64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNoLEAST8 +inline constexpr auto SCNoLEAST8 = mwrap_libc_capture::value_SCNoLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNoLEAST16 +inline constexpr auto SCNoLEAST16 = mwrap_libc_capture::value_SCNoLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNoLEAST32 +inline constexpr auto SCNoLEAST32 = mwrap_libc_capture::value_SCNoLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNoLEAST64 +inline constexpr auto SCNoLEAST64 = mwrap_libc_capture::value_SCNoLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNoFAST8 +inline constexpr auto SCNoFAST8 = mwrap_libc_capture::value_SCNoFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNoFAST16 +inline constexpr auto SCNoFAST16 = mwrap_libc_capture::value_SCNoFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNoFAST32 +inline constexpr auto SCNoFAST32 = mwrap_libc_capture::value_SCNoFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNoFAST64 +inline constexpr auto SCNoFAST64 = mwrap_libc_capture::value_SCNoFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNoMAX +inline constexpr auto SCNoMAX = mwrap_libc_capture::value_SCNoMAX; +#endif +#ifdef MWRAP_LIBC_HAS_SCNoPTR +inline constexpr auto SCNoPTR = mwrap_libc_capture::value_SCNoPTR; +#endif +#ifdef MWRAP_LIBC_HAS_SCNu8 +inline constexpr auto SCNu8 = mwrap_libc_capture::value_SCNu8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNu16 +inline constexpr auto SCNu16 = mwrap_libc_capture::value_SCNu16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNu32 +inline constexpr auto SCNu32 = mwrap_libc_capture::value_SCNu32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNu64 +inline constexpr auto SCNu64 = mwrap_libc_capture::value_SCNu64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNuLEAST8 +inline constexpr auto SCNuLEAST8 = mwrap_libc_capture::value_SCNuLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNuLEAST16 +inline constexpr auto SCNuLEAST16 = mwrap_libc_capture::value_SCNuLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNuLEAST32 +inline constexpr auto SCNuLEAST32 = mwrap_libc_capture::value_SCNuLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNuLEAST64 +inline constexpr auto SCNuLEAST64 = mwrap_libc_capture::value_SCNuLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNuFAST8 +inline constexpr auto SCNuFAST8 = mwrap_libc_capture::value_SCNuFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNuFAST16 +inline constexpr auto SCNuFAST16 = mwrap_libc_capture::value_SCNuFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNuFAST32 +inline constexpr auto SCNuFAST32 = mwrap_libc_capture::value_SCNuFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNuFAST64 +inline constexpr auto SCNuFAST64 = mwrap_libc_capture::value_SCNuFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNuMAX +inline constexpr auto SCNuMAX = mwrap_libc_capture::value_SCNuMAX; +#endif +#ifdef MWRAP_LIBC_HAS_SCNuPTR +inline constexpr auto SCNuPTR = mwrap_libc_capture::value_SCNuPTR; +#endif +#ifdef MWRAP_LIBC_HAS_SCNx8 +inline constexpr auto SCNx8 = mwrap_libc_capture::value_SCNx8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNx16 +inline constexpr auto SCNx16 = mwrap_libc_capture::value_SCNx16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNx32 +inline constexpr auto SCNx32 = mwrap_libc_capture::value_SCNx32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNx64 +inline constexpr auto SCNx64 = mwrap_libc_capture::value_SCNx64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNxLEAST8 +inline constexpr auto SCNxLEAST8 = mwrap_libc_capture::value_SCNxLEAST8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNxLEAST16 +inline constexpr auto SCNxLEAST16 = mwrap_libc_capture::value_SCNxLEAST16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNxLEAST32 +inline constexpr auto SCNxLEAST32 = mwrap_libc_capture::value_SCNxLEAST32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNxLEAST64 +inline constexpr auto SCNxLEAST64 = mwrap_libc_capture::value_SCNxLEAST64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNxFAST8 +inline constexpr auto SCNxFAST8 = mwrap_libc_capture::value_SCNxFAST8; +#endif +#ifdef MWRAP_LIBC_HAS_SCNxFAST16 +inline constexpr auto SCNxFAST16 = mwrap_libc_capture::value_SCNxFAST16; +#endif +#ifdef MWRAP_LIBC_HAS_SCNxFAST32 +inline constexpr auto SCNxFAST32 = mwrap_libc_capture::value_SCNxFAST32; +#endif +#ifdef MWRAP_LIBC_HAS_SCNxFAST64 +inline constexpr auto SCNxFAST64 = mwrap_libc_capture::value_SCNxFAST64; +#endif +#ifdef MWRAP_LIBC_HAS_SCNxMAX +inline constexpr auto SCNxMAX = mwrap_libc_capture::value_SCNxMAX; +#endif +#ifdef MWRAP_LIBC_HAS_SCNxPTR +inline constexpr auto SCNxPTR = mwrap_libc_capture::value_SCNxPTR; +#endif +#ifdef MWRAP_LIBC_HAS_CHAR_BIT +inline constexpr auto CHAR_BIT = mwrap_libc_capture::value_CHAR_BIT; +#endif +#ifdef MWRAP_LIBC_HAS_SCHAR_MIN +inline constexpr auto SCHAR_MIN = mwrap_libc_capture::value_SCHAR_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_SCHAR_MAX +inline constexpr auto SCHAR_MAX = mwrap_libc_capture::value_SCHAR_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UCHAR_MAX +inline constexpr auto UCHAR_MAX = mwrap_libc_capture::value_UCHAR_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_CHAR_MIN +inline constexpr auto CHAR_MIN = mwrap_libc_capture::value_CHAR_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_CHAR_MAX +inline constexpr auto CHAR_MAX = mwrap_libc_capture::value_CHAR_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_MB_LEN_MAX +inline constexpr auto MB_LEN_MAX = mwrap_libc_capture::value_MB_LEN_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_SHRT_MIN +inline constexpr auto SHRT_MIN = mwrap_libc_capture::value_SHRT_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_SHRT_MAX +inline constexpr auto SHRT_MAX = mwrap_libc_capture::value_SHRT_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_USHRT_MAX +inline constexpr auto USHRT_MAX = mwrap_libc_capture::value_USHRT_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT_MIN +inline constexpr auto INT_MIN = mwrap_libc_capture::value_INT_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT_MAX +inline constexpr auto INT_MAX = mwrap_libc_capture::value_INT_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT_MAX +inline constexpr auto UINT_MAX = mwrap_libc_capture::value_UINT_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_LONG_MIN +inline constexpr auto LONG_MIN = mwrap_libc_capture::value_LONG_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_LONG_MAX +inline constexpr auto LONG_MAX = mwrap_libc_capture::value_LONG_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_ULONG_MAX +inline constexpr auto ULONG_MAX = mwrap_libc_capture::value_ULONG_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_LLONG_MIN +inline constexpr auto LLONG_MIN = mwrap_libc_capture::value_LLONG_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_LLONG_MAX +inline constexpr auto LLONG_MAX = mwrap_libc_capture::value_LLONG_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_ULLONG_MAX +inline constexpr auto ULLONG_MAX = mwrap_libc_capture::value_ULLONG_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_LC_ALL +inline constexpr auto LC_ALL = mwrap_libc_capture::value_LC_ALL; +#endif +#ifdef MWRAP_LIBC_HAS_LC_COLLATE +inline constexpr auto LC_COLLATE = mwrap_libc_capture::value_LC_COLLATE; +#endif +#ifdef MWRAP_LIBC_HAS_LC_CTYPE +inline constexpr auto LC_CTYPE = mwrap_libc_capture::value_LC_CTYPE; +#endif +#ifdef MWRAP_LIBC_HAS_LC_MONETARY +inline constexpr auto LC_MONETARY = mwrap_libc_capture::value_LC_MONETARY; +#endif +#ifdef MWRAP_LIBC_HAS_LC_NUMERIC +inline constexpr auto LC_NUMERIC = mwrap_libc_capture::value_LC_NUMERIC; +#endif +#ifdef MWRAP_LIBC_HAS_LC_TIME +inline constexpr auto LC_TIME = mwrap_libc_capture::value_LC_TIME; +#endif +#ifdef MWRAP_LIBC_HAS_HUGE_VAL +constexpr decltype(auto) HUGE_VAL() { return mwrap_libc_capture::get_HUGE_VAL(); } +#endif +#ifdef MWRAP_LIBC_HAS_HUGE_VALF +constexpr decltype(auto) HUGE_VALF() { return mwrap_libc_capture::get_HUGE_VALF(); } +#endif +#ifdef MWRAP_LIBC_HAS_HUGE_VALL +constexpr decltype(auto) HUGE_VALL() { return mwrap_libc_capture::get_HUGE_VALL(); } +#endif +#ifdef MWRAP_LIBC_HAS_INFINITY +constexpr decltype(auto) INFINITY() { return mwrap_libc_capture::get_INFINITY(); } +#endif +#ifdef MWRAP_LIBC_HAS_NAN +constexpr decltype(auto) NAN() { return mwrap_libc_capture::get_NAN(); } +#endif +#ifdef MWRAP_LIBC_HAS_FP_INFINITE +inline constexpr auto FP_INFINITE = mwrap_libc_capture::value_FP_INFINITE; +#endif +#ifdef MWRAP_LIBC_HAS_FP_NAN +inline constexpr auto FP_NAN = mwrap_libc_capture::value_FP_NAN; +#endif +#ifdef MWRAP_LIBC_HAS_FP_NORMAL +inline constexpr auto FP_NORMAL = mwrap_libc_capture::value_FP_NORMAL; +#endif +#ifdef MWRAP_LIBC_HAS_FP_SUBNORMAL +inline constexpr auto FP_SUBNORMAL = mwrap_libc_capture::value_FP_SUBNORMAL; +#endif +#ifdef MWRAP_LIBC_HAS_FP_ZERO +inline constexpr auto FP_ZERO = mwrap_libc_capture::value_FP_ZERO; +#endif +#ifdef MWRAP_LIBC_HAS_FP_FAST_FMA +constexpr decltype(auto) FP_FAST_FMA() { return mwrap_libc_capture::get_FP_FAST_FMA(); } +#endif +#ifdef MWRAP_LIBC_HAS_FP_FAST_FMAF +constexpr decltype(auto) FP_FAST_FMAF() { return mwrap_libc_capture::get_FP_FAST_FMAF(); } +#endif +#ifdef MWRAP_LIBC_HAS_FP_FAST_FMAL +constexpr decltype(auto) FP_FAST_FMAL() { return mwrap_libc_capture::get_FP_FAST_FMAL(); } +#endif +#ifdef MWRAP_LIBC_HAS_FP_ILOGB0 +inline constexpr auto FP_ILOGB0 = mwrap_libc_capture::value_FP_ILOGB0; +#endif +#ifdef MWRAP_LIBC_HAS_FP_ILOGBNAN +inline constexpr auto FP_ILOGBNAN = mwrap_libc_capture::value_FP_ILOGBNAN; +#endif +#ifdef MWRAP_LIBC_HAS_MATH_ERRNO +inline constexpr auto MATH_ERRNO = mwrap_libc_capture::value_MATH_ERRNO; +#endif +#ifdef MWRAP_LIBC_HAS_MATH_ERREXCEPT +inline constexpr auto MATH_ERREXCEPT = mwrap_libc_capture::value_MATH_ERREXCEPT; +#endif +#ifdef MWRAP_LIBC_HAS_math_errhandling +constexpr decltype(auto) math_errhandling() { return mwrap_libc_capture::get_math_errhandling(); } +#endif +#ifdef MWRAP_LIBC_HAS_SIG_DFL +inline constexpr auto SIG_DFL = mwrap_libc_capture::value_SIG_DFL; +#endif +#ifdef MWRAP_LIBC_HAS_SIG_ERR +constexpr decltype(auto) SIG_ERR() { return mwrap_libc_capture::get_SIG_ERR(); } +#endif +#ifdef MWRAP_LIBC_HAS_SIG_IGN +constexpr decltype(auto) SIG_IGN() { return mwrap_libc_capture::get_SIG_IGN(); } +#endif +#ifdef MWRAP_LIBC_HAS_SIGABRT +inline constexpr auto SIGABRT = mwrap_libc_capture::value_SIGABRT; +#endif +#ifdef MWRAP_LIBC_HAS_SIGFPE +inline constexpr auto SIGFPE = mwrap_libc_capture::value_SIGFPE; +#endif +#ifdef MWRAP_LIBC_HAS_SIGILL +inline constexpr auto SIGILL = mwrap_libc_capture::value_SIGILL; +#endif +#ifdef MWRAP_LIBC_HAS_SIGINT +inline constexpr auto SIGINT = mwrap_libc_capture::value_SIGINT; +#endif +#ifdef MWRAP_LIBC_HAS_SIGSEGV +inline constexpr auto SIGSEGV = mwrap_libc_capture::value_SIGSEGV; +#endif +#ifdef MWRAP_LIBC_HAS_SIGTERM +inline constexpr auto SIGTERM = mwrap_libc_capture::value_SIGTERM; +#endif +#ifdef MWRAP_LIBC_HAS_INT8_MIN +inline constexpr auto INT8_MIN = mwrap_libc_capture::value_INT8_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT8_MAX +inline constexpr auto INT8_MAX = mwrap_libc_capture::value_INT8_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT8_MAX +inline constexpr auto UINT8_MAX = mwrap_libc_capture::value_UINT8_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST8_MIN +inline constexpr auto INT_LEAST8_MIN = mwrap_libc_capture::value_INT_LEAST8_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST8_MAX +inline constexpr auto INT_LEAST8_MAX = mwrap_libc_capture::value_INT_LEAST8_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT_LEAST8_MAX +inline constexpr auto UINT_LEAST8_MAX = mwrap_libc_capture::value_UINT_LEAST8_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST8_MIN +inline constexpr auto INT_FAST8_MIN = mwrap_libc_capture::value_INT_FAST8_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST8_MAX +inline constexpr auto INT_FAST8_MAX = mwrap_libc_capture::value_INT_FAST8_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT_FAST8_MAX +inline constexpr auto UINT_FAST8_MAX = mwrap_libc_capture::value_UINT_FAST8_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT16_MIN +inline constexpr auto INT16_MIN = mwrap_libc_capture::value_INT16_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT16_MAX +inline constexpr auto INT16_MAX = mwrap_libc_capture::value_INT16_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT16_MAX +inline constexpr auto UINT16_MAX = mwrap_libc_capture::value_UINT16_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST16_MIN +inline constexpr auto INT_LEAST16_MIN = mwrap_libc_capture::value_INT_LEAST16_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST16_MAX +inline constexpr auto INT_LEAST16_MAX = mwrap_libc_capture::value_INT_LEAST16_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT_LEAST16_MAX +inline constexpr auto UINT_LEAST16_MAX = mwrap_libc_capture::value_UINT_LEAST16_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST16_MIN +inline constexpr auto INT_FAST16_MIN = mwrap_libc_capture::value_INT_FAST16_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST16_MAX +inline constexpr auto INT_FAST16_MAX = mwrap_libc_capture::value_INT_FAST16_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT_FAST16_MAX +inline constexpr auto UINT_FAST16_MAX = mwrap_libc_capture::value_UINT_FAST16_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT32_MIN +inline constexpr auto INT32_MIN = mwrap_libc_capture::value_INT32_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT32_MAX +inline constexpr auto INT32_MAX = mwrap_libc_capture::value_INT32_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT32_MAX +inline constexpr auto UINT32_MAX = mwrap_libc_capture::value_UINT32_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST32_MIN +inline constexpr auto INT_LEAST32_MIN = mwrap_libc_capture::value_INT_LEAST32_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST32_MAX +inline constexpr auto INT_LEAST32_MAX = mwrap_libc_capture::value_INT_LEAST32_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT_LEAST32_MAX +inline constexpr auto UINT_LEAST32_MAX = mwrap_libc_capture::value_UINT_LEAST32_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST32_MIN +inline constexpr auto INT_FAST32_MIN = mwrap_libc_capture::value_INT_FAST32_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST32_MAX +inline constexpr auto INT_FAST32_MAX = mwrap_libc_capture::value_INT_FAST32_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT_FAST32_MAX +inline constexpr auto UINT_FAST32_MAX = mwrap_libc_capture::value_UINT_FAST32_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT64_MIN +inline constexpr auto INT64_MIN = mwrap_libc_capture::value_INT64_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT64_MAX +inline constexpr auto INT64_MAX = mwrap_libc_capture::value_INT64_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT64_MAX +inline constexpr auto UINT64_MAX = mwrap_libc_capture::value_UINT64_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST64_MIN +inline constexpr auto INT_LEAST64_MIN = mwrap_libc_capture::value_INT_LEAST64_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST64_MAX +inline constexpr auto INT_LEAST64_MAX = mwrap_libc_capture::value_INT_LEAST64_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT_LEAST64_MAX +inline constexpr auto UINT_LEAST64_MAX = mwrap_libc_capture::value_UINT_LEAST64_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST64_MIN +inline constexpr auto INT_FAST64_MIN = mwrap_libc_capture::value_INT_FAST64_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST64_MAX +inline constexpr auto INT_FAST64_MAX = mwrap_libc_capture::value_INT_FAST64_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINT_FAST64_MAX +inline constexpr auto UINT_FAST64_MAX = mwrap_libc_capture::value_UINT_FAST64_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INTPTR_MIN +inline constexpr auto INTPTR_MIN = mwrap_libc_capture::value_INTPTR_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INTPTR_MAX +inline constexpr auto INTPTR_MAX = mwrap_libc_capture::value_INTPTR_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINTPTR_MAX +inline constexpr auto UINTPTR_MAX = mwrap_libc_capture::value_UINTPTR_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_INTMAX_MIN +inline constexpr auto INTMAX_MIN = mwrap_libc_capture::value_INTMAX_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_INTMAX_MAX +inline constexpr auto INTMAX_MAX = mwrap_libc_capture::value_INTMAX_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_UINTMAX_MAX +inline constexpr auto UINTMAX_MAX = mwrap_libc_capture::value_UINTMAX_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_PTRDIFF_MIN +inline constexpr auto PTRDIFF_MIN = mwrap_libc_capture::value_PTRDIFF_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_PTRDIFF_MAX +inline constexpr auto PTRDIFF_MAX = mwrap_libc_capture::value_PTRDIFF_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_SIG_ATOMIC_MIN +inline constexpr auto SIG_ATOMIC_MIN = mwrap_libc_capture::value_SIG_ATOMIC_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_SIG_ATOMIC_MAX +inline constexpr auto SIG_ATOMIC_MAX = mwrap_libc_capture::value_SIG_ATOMIC_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_SIZE_MAX +inline constexpr auto SIZE_MAX = mwrap_libc_capture::value_SIZE_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_WCHAR_MIN +inline constexpr auto WCHAR_MIN = mwrap_libc_capture::value_WCHAR_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_WCHAR_MAX +inline constexpr auto WCHAR_MAX = mwrap_libc_capture::value_WCHAR_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_WINT_MIN +inline constexpr auto WINT_MIN = mwrap_libc_capture::value_WINT_MIN; +#endif +#ifdef MWRAP_LIBC_HAS_WINT_MAX +inline constexpr auto WINT_MAX = mwrap_libc_capture::value_WINT_MAX; +#endif +#ifdef MWRAP_LIBC_HAS__IOFBF +inline constexpr auto _IOFBF = mwrap_libc_capture::value__IOFBF; +#endif +#ifdef MWRAP_LIBC_HAS__IOLBF +inline constexpr auto _IOLBF = mwrap_libc_capture::value__IOLBF; +#endif +#ifdef MWRAP_LIBC_HAS__IONBF +inline constexpr auto _IONBF = mwrap_libc_capture::value__IONBF; +#endif +#ifdef MWRAP_LIBC_HAS_BUFSIZ +inline constexpr auto BUFSIZ = mwrap_libc_capture::value_BUFSIZ; +#endif +#ifdef MWRAP_LIBC_HAS_EOF +inline constexpr auto EOF = mwrap_libc_capture::value_EOF; +#endif +#ifdef MWRAP_LIBC_HAS_FOPEN_MAX +inline constexpr auto FOPEN_MAX = mwrap_libc_capture::value_FOPEN_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_FILENAME_MAX +inline constexpr auto FILENAME_MAX = mwrap_libc_capture::value_FILENAME_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_L_tmpnam +inline constexpr auto L_tmpnam = mwrap_libc_capture::value_L_tmpnam; +#endif +#ifdef MWRAP_LIBC_HAS_SEEK_CUR +inline constexpr auto SEEK_CUR = mwrap_libc_capture::value_SEEK_CUR; +#endif +#ifdef MWRAP_LIBC_HAS_SEEK_END +inline constexpr auto SEEK_END = mwrap_libc_capture::value_SEEK_END; +#endif +#ifdef MWRAP_LIBC_HAS_SEEK_SET +inline constexpr auto SEEK_SET = mwrap_libc_capture::value_SEEK_SET; +#endif +#ifdef MWRAP_LIBC_HAS_TMP_MAX +inline constexpr auto TMP_MAX = mwrap_libc_capture::value_TMP_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_stderr +constexpr decltype(auto) stderr() { return mwrap_libc_capture::get_stderr(); } +#endif +#ifdef MWRAP_LIBC_HAS_stdin +constexpr decltype(auto) stdin() { return mwrap_libc_capture::get_stdin(); } +#endif +#ifdef MWRAP_LIBC_HAS_stdout +constexpr decltype(auto) stdout() { return mwrap_libc_capture::get_stdout(); } +#endif +#ifdef MWRAP_LIBC_HAS_EXIT_FAILURE +inline constexpr auto EXIT_FAILURE = mwrap_libc_capture::value_EXIT_FAILURE; +#endif +#ifdef MWRAP_LIBC_HAS_EXIT_SUCCESS +inline constexpr auto EXIT_SUCCESS = mwrap_libc_capture::value_EXIT_SUCCESS; +#endif +#ifdef MWRAP_LIBC_HAS_RAND_MAX +inline constexpr auto RAND_MAX = mwrap_libc_capture::value_RAND_MAX; +#endif +#ifdef MWRAP_LIBC_HAS_MB_CUR_MAX +constexpr decltype(auto) MB_CUR_MAX() { return mwrap_libc_capture::get_MB_CUR_MAX(); } +#endif +#ifdef MWRAP_LIBC_HAS_CLOCKS_PER_SEC +inline constexpr auto CLOCKS_PER_SEC = mwrap_libc_capture::value_CLOCKS_PER_SEC; +#endif +#ifdef MWRAP_LIBC_HAS_TIME_UTC +inline constexpr auto TIME_UTC = mwrap_libc_capture::value_TIME_UTC; +#endif +#ifdef MWRAP_LIBC_HAS_WEOF +inline constexpr auto WEOF = mwrap_libc_capture::value_WEOF; +#endif +} diff --git a/templates/stdio/mcpp.toml.in b/templates/stdio/mcpp.toml.in new file mode 100644 index 0000000..a637560 --- /dev/null +++ b/templates/stdio/mcpp.toml.in @@ -0,0 +1,10 @@ +[package] +name = "{{project.name}}" +version = "0.1.0" + +[targets.{{project.name}}] +kind = "bin" +main = "src/main.cpp" + +[dependencies] +"{{self.name}}" = "{{self.version}}" diff --git a/templates/stdio/src/main.cpp.in b/templates/stdio/src/main.cpp.in new file mode 100644 index 0000000..7045e5e --- /dev/null +++ b/templates/stdio/src/main.cpp.in @@ -0,0 +1,26 @@ +// {{project.name}}: the C standard library through import mcpplibs.mwrap.libc. +// std.compat gives the functions; the macros of ISO C are in +// mcpplibs::mwrap::libc::macros: stdout() and stderr() are the streams, errno() +// the error number, EOF and the limits constants. +import mcpplibs.mwrap.libc; + +namespace c = mcpplibs::mwrap::libc::macros; + +int main(int argc, char** argv) +{ + const char* path = argc > 1 ? argv[1] : "no-such-file.txt"; + c::errno() = 0; + std::FILE* file = std::fopen(path, "r"); + if (!file) { + // The C library's message for the error it recorded. + std::fprintf(c::stderr(), "%s: %s (errno %d)\n", path, std::strerror(c::errno()), c::errno()); + } else { + long lines = 0; + for (int ch; (ch = std::fgetc(file)) != c::EOF;) lines += ch == '\n'; + std::fclose(file); + std::fprintf(c::stdout(), "%s: %ld lines\n", path, lines); + } + std::fprintf(c::stdout(), "CHAR_BIT %d, INT_MAX %d, BUFSIZ %d, RAND_MAX %d\n", + c::CHAR_BIT, c::INT_MAX, int(c::BUFSIZ), c::RAND_MAX); + return c::EXIT_SUCCESS; +} diff --git a/templates/stdio/template.toml b/templates/stdio/template.toml new file mode 100644 index 0000000..4fb5654 --- /dev/null +++ b/templates/stdio/template.toml @@ -0,0 +1,4 @@ +[template] +description = "The C library with import mcpplibs.mwrap.libc: C stdio on stdout() and stderr(), errno() and strerror, and the limits of ISO C" +default = true +post_message = "Run `mcpp run`, or `mcpp run -- ` to count the lines of a file with C stdio." diff --git a/tests/api_test.cpp b/tests/api_test.cpp new file mode 100644 index 0000000..37c2e70 --- /dev/null +++ b/tests/api_test.cpp @@ -0,0 +1,77 @@ +// The module over the target's C library: the streams written through stdout() +// and stderr(), errno() as the lvalue the library sets, the stdio constants in +// use, and the function-like macros of . +#include +import mcpplibs.mwrap.libc; + +namespace c = mcpplibs::mwrap::libc::macros; + +static int sum(int count, ...) +{ + va_list args; + va_start(args, count); + int total = 0; + for (int i = 0; i < count; ++i) total += va_arg(args, int); + va_end(args); + return total; +} + +struct Pair { + char tag; + double value; +}; + +int main() +{ + int failures = 0; + auto check = [&](bool ok, const char* what) { + std::fprintf(c::stdout(), "%s %s\n", ok ? "ok " : "FAIL", what); + failures += ok ? 0 : 1; + }; + + // The streams are the C library's: what goes through one is in order with the other calls. + check(std::fputs("", c::stdout()) != c::EOF && std::fflush(c::stdout()) == 0, "fputs and fflush on stdout()"); + check(std::fputs("api_test writes to stderr()\n", c::stderr()) != c::EOF, "fputs on stderr()"); + check(c::stdin() != nullptr && c::stdout() != c::stderr(), "three distinct streams"); + + // errno() is the object the library sets. + c::errno() = 0; + const long big = std::strtol("99999999999999999999999", nullptr, 10); + check(big == c::LONG_MAX && c::errno() == c::ERANGE, "strtol sets errno() to ERANGE"); + c::errno() = c::EDOM; + check(c::errno() == c::EDOM, "errno() is assignable"); + + // A temporary file through the stdio constants. + std::FILE* f = std::tmpfile(); + char buffer[c::BUFSIZ]; + check(f != nullptr && std::setvbuf(f, buffer, c::_IOFBF, sizeof buffer) == 0, "setvbuf with _IOFBF and BUFSIZ"); + std::fputs("abc", f); + check(std::fseek(f, 0, c::SEEK_SET) == 0 && std::fgetc(f) == 'a', "fseek to SEEK_SET"); + check(std::fseek(f, 0, c::SEEK_END) == 0 && std::fgetc(f) == c::EOF, "fgetc at the end is EOF"); + std::fclose(f); + + // Limits and the environment. + // undefines the object-like macros its headers bring, so the + // mapped names are usable in this unit on every C library. + check(c::CHAR_BIT == 8 && c::INT_MAX == std::numeric_limits::max() + && c::SIZE_MAX == std::numeric_limits::max(), "CHAR_BIT, INT_MAX, SIZE_MAX"); + check(c::MB_CUR_MAX() >= 1 && c::EXIT_SUCCESS == 0 && c::RAND_MAX >= 32767, "MB_CUR_MAX(), EXIT_SUCCESS, RAND_MAX"); + check(c::INFINITY() == std::numeric_limits::infinity() && c::NAN() != c::NAN(), "INFINITY() and NAN()"); + check(std::setlocale(c::LC_ALL, "C") != nullptr, "setlocale(LC_ALL)"); + + // The function-like macros. + check(sum(3, 1, 2, 3) == 6, "va_start, va_arg, va_end"); + check(offsetof(Pair, tag) == 0 && offsetof(Pair, value) >= sizeof(char), "offsetof"); + check(INT64_C(1) << 40 == 1099511627776, "INT64_C"); + std::jmp_buf env; + volatile int jumped = 0; + if (setjmp(env) == 0) { + jumped = 1; + std::longjmp(env, 7); + } + check(jumped == 1, "setjmp and longjmp"); + assert(failures == 0 || failures > 0); + + std::fprintf(c::stdout(), "%d failures\n", failures); + return failures != 0; +} diff --git a/tests/header_mix_test.cpp b/tests/header_mix_test.cpp new file mode 100644 index 0000000..1aa37c3 --- /dev/null +++ b/tests/header_mix_test.cpp @@ -0,0 +1,21 @@ +// The header and the module in one translation unit: 's stdout is the +// stream the module's stdout() returns, read here under another name before the +// macro is undefined. +#include +#include + +static FILE* header_stdout() { return stdout; } +static int* header_errno() { return &errno; } +#undef stdout +#undef errno + +import mcpplibs.mwrap.libc; + +namespace c = mcpplibs::mwrap::libc::macros; + +int main() +{ + const bool same = c::stdout() == header_stdout() && &c::errno() == header_errno(); + std::puts(same ? "header and module agree" : "FAIL"); + return same ? 0 : 1; +} diff --git a/tests/macros.cpp b/tests/macros.cpp new file mode 100644 index 0000000..d8af9d4 --- /dev/null +++ b/tests/macros.cpp @@ -0,0 +1,3398 @@ +// Each mapping of mcpplibs.mwrap.libc.macros equals its macro, where the target defines +// it. A macro expands even in a qualified name, so the values of the headers are taken +// under other names and the macros undefined before the mapped names are used. Written +// by tools/generate.py. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace header { +#ifdef EDOM +inline constexpr auto value_EDOM = (EDOM); +#endif +#ifdef EILSEQ +inline constexpr auto value_EILSEQ = (EILSEQ); +#endif +#ifdef ERANGE +inline constexpr auto value_ERANGE = (ERANGE); +#endif +#ifdef errno +inline decltype(auto) get_errno() { return (errno); } +#endif +#ifdef FE_DIVBYZERO +inline constexpr auto value_FE_DIVBYZERO = (FE_DIVBYZERO); +#endif +#ifdef FE_INEXACT +inline constexpr auto value_FE_INEXACT = (FE_INEXACT); +#endif +#ifdef FE_INVALID +inline constexpr auto value_FE_INVALID = (FE_INVALID); +#endif +#ifdef FE_OVERFLOW +inline constexpr auto value_FE_OVERFLOW = (FE_OVERFLOW); +#endif +#ifdef FE_UNDERFLOW +inline constexpr auto value_FE_UNDERFLOW = (FE_UNDERFLOW); +#endif +#ifdef FE_ALL_EXCEPT +inline constexpr auto value_FE_ALL_EXCEPT = (FE_ALL_EXCEPT); +#endif +#ifdef FE_DOWNWARD +inline constexpr auto value_FE_DOWNWARD = (FE_DOWNWARD); +#endif +#ifdef FE_TONEAREST +inline constexpr auto value_FE_TONEAREST = (FE_TONEAREST); +#endif +#ifdef FE_TOWARDZERO +inline constexpr auto value_FE_TOWARDZERO = (FE_TOWARDZERO); +#endif +#ifdef FE_UPWARD +inline constexpr auto value_FE_UPWARD = (FE_UPWARD); +#endif +#ifdef FE_DFL_ENV +inline decltype(auto) get_FE_DFL_ENV() { return (FE_DFL_ENV); } +#endif +#ifdef FLT_ROUNDS +inline decltype(auto) get_FLT_ROUNDS() { return (FLT_ROUNDS); } +#endif +#ifdef FLT_EVAL_METHOD +inline decltype(auto) get_FLT_EVAL_METHOD() { return (FLT_EVAL_METHOD); } +#endif +#ifdef FLT_HAS_SUBNORM +inline constexpr auto value_FLT_HAS_SUBNORM = (FLT_HAS_SUBNORM); +#endif +#ifdef DBL_HAS_SUBNORM +inline constexpr auto value_DBL_HAS_SUBNORM = (DBL_HAS_SUBNORM); +#endif +#ifdef LDBL_HAS_SUBNORM +inline constexpr auto value_LDBL_HAS_SUBNORM = (LDBL_HAS_SUBNORM); +#endif +#ifdef FLT_RADIX +inline constexpr auto value_FLT_RADIX = (FLT_RADIX); +#endif +#ifdef DECIMAL_DIG +inline constexpr auto value_DECIMAL_DIG = (DECIMAL_DIG); +#endif +#ifdef FLT_MANT_DIG +inline constexpr auto value_FLT_MANT_DIG = (FLT_MANT_DIG); +#endif +#ifdef DBL_MANT_DIG +inline constexpr auto value_DBL_MANT_DIG = (DBL_MANT_DIG); +#endif +#ifdef LDBL_MANT_DIG +inline constexpr auto value_LDBL_MANT_DIG = (LDBL_MANT_DIG); +#endif +#ifdef FLT_DECIMAL_DIG +inline constexpr auto value_FLT_DECIMAL_DIG = (FLT_DECIMAL_DIG); +#endif +#ifdef DBL_DECIMAL_DIG +inline constexpr auto value_DBL_DECIMAL_DIG = (DBL_DECIMAL_DIG); +#endif +#ifdef LDBL_DECIMAL_DIG +inline constexpr auto value_LDBL_DECIMAL_DIG = (LDBL_DECIMAL_DIG); +#endif +#ifdef FLT_DIG +inline constexpr auto value_FLT_DIG = (FLT_DIG); +#endif +#ifdef DBL_DIG +inline constexpr auto value_DBL_DIG = (DBL_DIG); +#endif +#ifdef LDBL_DIG +inline constexpr auto value_LDBL_DIG = (LDBL_DIG); +#endif +#ifdef FLT_MIN_EXP +inline constexpr auto value_FLT_MIN_EXP = (FLT_MIN_EXP); +#endif +#ifdef DBL_MIN_EXP +inline constexpr auto value_DBL_MIN_EXP = (DBL_MIN_EXP); +#endif +#ifdef LDBL_MIN_EXP +inline constexpr auto value_LDBL_MIN_EXP = (LDBL_MIN_EXP); +#endif +#ifdef FLT_MIN_10_EXP +inline constexpr auto value_FLT_MIN_10_EXP = (FLT_MIN_10_EXP); +#endif +#ifdef DBL_MIN_10_EXP +inline constexpr auto value_DBL_MIN_10_EXP = (DBL_MIN_10_EXP); +#endif +#ifdef LDBL_MIN_10_EXP +inline constexpr auto value_LDBL_MIN_10_EXP = (LDBL_MIN_10_EXP); +#endif +#ifdef FLT_MAX_EXP +inline constexpr auto value_FLT_MAX_EXP = (FLT_MAX_EXP); +#endif +#ifdef DBL_MAX_EXP +inline constexpr auto value_DBL_MAX_EXP = (DBL_MAX_EXP); +#endif +#ifdef LDBL_MAX_EXP +inline constexpr auto value_LDBL_MAX_EXP = (LDBL_MAX_EXP); +#endif +#ifdef FLT_MAX_10_EXP +inline constexpr auto value_FLT_MAX_10_EXP = (FLT_MAX_10_EXP); +#endif +#ifdef DBL_MAX_10_EXP +inline constexpr auto value_DBL_MAX_10_EXP = (DBL_MAX_10_EXP); +#endif +#ifdef LDBL_MAX_10_EXP +inline constexpr auto value_LDBL_MAX_10_EXP = (LDBL_MAX_10_EXP); +#endif +#ifdef FLT_MAX +inline constexpr auto value_FLT_MAX = (FLT_MAX); +#endif +#ifdef DBL_MAX +inline constexpr auto value_DBL_MAX = (DBL_MAX); +#endif +#ifdef LDBL_MAX +inline constexpr auto value_LDBL_MAX = (LDBL_MAX); +#endif +#ifdef FLT_EPSILON +inline constexpr auto value_FLT_EPSILON = (FLT_EPSILON); +#endif +#ifdef DBL_EPSILON +inline constexpr auto value_DBL_EPSILON = (DBL_EPSILON); +#endif +#ifdef LDBL_EPSILON +inline constexpr auto value_LDBL_EPSILON = (LDBL_EPSILON); +#endif +#ifdef FLT_MIN +inline constexpr auto value_FLT_MIN = (FLT_MIN); +#endif +#ifdef DBL_MIN +inline constexpr auto value_DBL_MIN = (DBL_MIN); +#endif +#ifdef LDBL_MIN +inline constexpr auto value_LDBL_MIN = (LDBL_MIN); +#endif +#ifdef FLT_TRUE_MIN +inline constexpr auto value_FLT_TRUE_MIN = (FLT_TRUE_MIN); +#endif +#ifdef DBL_TRUE_MIN +inline constexpr auto value_DBL_TRUE_MIN = (DBL_TRUE_MIN); +#endif +#ifdef LDBL_TRUE_MIN +inline constexpr auto value_LDBL_TRUE_MIN = (LDBL_TRUE_MIN); +#endif +#ifdef PRId8 +inline constexpr auto value_PRId8 = (PRId8); +#endif +#ifdef PRId16 +inline constexpr auto value_PRId16 = (PRId16); +#endif +#ifdef PRId32 +inline constexpr auto value_PRId32 = (PRId32); +#endif +#ifdef PRId64 +inline constexpr auto value_PRId64 = (PRId64); +#endif +#ifdef PRIdLEAST8 +inline constexpr auto value_PRIdLEAST8 = (PRIdLEAST8); +#endif +#ifdef PRIdLEAST16 +inline constexpr auto value_PRIdLEAST16 = (PRIdLEAST16); +#endif +#ifdef PRIdLEAST32 +inline constexpr auto value_PRIdLEAST32 = (PRIdLEAST32); +#endif +#ifdef PRIdLEAST64 +inline constexpr auto value_PRIdLEAST64 = (PRIdLEAST64); +#endif +#ifdef PRIdFAST8 +inline constexpr auto value_PRIdFAST8 = (PRIdFAST8); +#endif +#ifdef PRIdFAST16 +inline constexpr auto value_PRIdFAST16 = (PRIdFAST16); +#endif +#ifdef PRIdFAST32 +inline constexpr auto value_PRIdFAST32 = (PRIdFAST32); +#endif +#ifdef PRIdFAST64 +inline constexpr auto value_PRIdFAST64 = (PRIdFAST64); +#endif +#ifdef PRIdMAX +inline constexpr auto value_PRIdMAX = (PRIdMAX); +#endif +#ifdef PRIdPTR +inline constexpr auto value_PRIdPTR = (PRIdPTR); +#endif +#ifdef PRIi8 +inline constexpr auto value_PRIi8 = (PRIi8); +#endif +#ifdef PRIi16 +inline constexpr auto value_PRIi16 = (PRIi16); +#endif +#ifdef PRIi32 +inline constexpr auto value_PRIi32 = (PRIi32); +#endif +#ifdef PRIi64 +inline constexpr auto value_PRIi64 = (PRIi64); +#endif +#ifdef PRIiLEAST8 +inline constexpr auto value_PRIiLEAST8 = (PRIiLEAST8); +#endif +#ifdef PRIiLEAST16 +inline constexpr auto value_PRIiLEAST16 = (PRIiLEAST16); +#endif +#ifdef PRIiLEAST32 +inline constexpr auto value_PRIiLEAST32 = (PRIiLEAST32); +#endif +#ifdef PRIiLEAST64 +inline constexpr auto value_PRIiLEAST64 = (PRIiLEAST64); +#endif +#ifdef PRIiFAST8 +inline constexpr auto value_PRIiFAST8 = (PRIiFAST8); +#endif +#ifdef PRIiFAST16 +inline constexpr auto value_PRIiFAST16 = (PRIiFAST16); +#endif +#ifdef PRIiFAST32 +inline constexpr auto value_PRIiFAST32 = (PRIiFAST32); +#endif +#ifdef PRIiFAST64 +inline constexpr auto value_PRIiFAST64 = (PRIiFAST64); +#endif +#ifdef PRIiMAX +inline constexpr auto value_PRIiMAX = (PRIiMAX); +#endif +#ifdef PRIiPTR +inline constexpr auto value_PRIiPTR = (PRIiPTR); +#endif +#ifdef PRIo8 +inline constexpr auto value_PRIo8 = (PRIo8); +#endif +#ifdef PRIo16 +inline constexpr auto value_PRIo16 = (PRIo16); +#endif +#ifdef PRIo32 +inline constexpr auto value_PRIo32 = (PRIo32); +#endif +#ifdef PRIo64 +inline constexpr auto value_PRIo64 = (PRIo64); +#endif +#ifdef PRIoLEAST8 +inline constexpr auto value_PRIoLEAST8 = (PRIoLEAST8); +#endif +#ifdef PRIoLEAST16 +inline constexpr auto value_PRIoLEAST16 = (PRIoLEAST16); +#endif +#ifdef PRIoLEAST32 +inline constexpr auto value_PRIoLEAST32 = (PRIoLEAST32); +#endif +#ifdef PRIoLEAST64 +inline constexpr auto value_PRIoLEAST64 = (PRIoLEAST64); +#endif +#ifdef PRIoFAST8 +inline constexpr auto value_PRIoFAST8 = (PRIoFAST8); +#endif +#ifdef PRIoFAST16 +inline constexpr auto value_PRIoFAST16 = (PRIoFAST16); +#endif +#ifdef PRIoFAST32 +inline constexpr auto value_PRIoFAST32 = (PRIoFAST32); +#endif +#ifdef PRIoFAST64 +inline constexpr auto value_PRIoFAST64 = (PRIoFAST64); +#endif +#ifdef PRIoMAX +inline constexpr auto value_PRIoMAX = (PRIoMAX); +#endif +#ifdef PRIoPTR +inline constexpr auto value_PRIoPTR = (PRIoPTR); +#endif +#ifdef PRIu8 +inline constexpr auto value_PRIu8 = (PRIu8); +#endif +#ifdef PRIu16 +inline constexpr auto value_PRIu16 = (PRIu16); +#endif +#ifdef PRIu32 +inline constexpr auto value_PRIu32 = (PRIu32); +#endif +#ifdef PRIu64 +inline constexpr auto value_PRIu64 = (PRIu64); +#endif +#ifdef PRIuLEAST8 +inline constexpr auto value_PRIuLEAST8 = (PRIuLEAST8); +#endif +#ifdef PRIuLEAST16 +inline constexpr auto value_PRIuLEAST16 = (PRIuLEAST16); +#endif +#ifdef PRIuLEAST32 +inline constexpr auto value_PRIuLEAST32 = (PRIuLEAST32); +#endif +#ifdef PRIuLEAST64 +inline constexpr auto value_PRIuLEAST64 = (PRIuLEAST64); +#endif +#ifdef PRIuFAST8 +inline constexpr auto value_PRIuFAST8 = (PRIuFAST8); +#endif +#ifdef PRIuFAST16 +inline constexpr auto value_PRIuFAST16 = (PRIuFAST16); +#endif +#ifdef PRIuFAST32 +inline constexpr auto value_PRIuFAST32 = (PRIuFAST32); +#endif +#ifdef PRIuFAST64 +inline constexpr auto value_PRIuFAST64 = (PRIuFAST64); +#endif +#ifdef PRIuMAX +inline constexpr auto value_PRIuMAX = (PRIuMAX); +#endif +#ifdef PRIuPTR +inline constexpr auto value_PRIuPTR = (PRIuPTR); +#endif +#ifdef PRIx8 +inline constexpr auto value_PRIx8 = (PRIx8); +#endif +#ifdef PRIx16 +inline constexpr auto value_PRIx16 = (PRIx16); +#endif +#ifdef PRIx32 +inline constexpr auto value_PRIx32 = (PRIx32); +#endif +#ifdef PRIx64 +inline constexpr auto value_PRIx64 = (PRIx64); +#endif +#ifdef PRIxLEAST8 +inline constexpr auto value_PRIxLEAST8 = (PRIxLEAST8); +#endif +#ifdef PRIxLEAST16 +inline constexpr auto value_PRIxLEAST16 = (PRIxLEAST16); +#endif +#ifdef PRIxLEAST32 +inline constexpr auto value_PRIxLEAST32 = (PRIxLEAST32); +#endif +#ifdef PRIxLEAST64 +inline constexpr auto value_PRIxLEAST64 = (PRIxLEAST64); +#endif +#ifdef PRIxFAST8 +inline constexpr auto value_PRIxFAST8 = (PRIxFAST8); +#endif +#ifdef PRIxFAST16 +inline constexpr auto value_PRIxFAST16 = (PRIxFAST16); +#endif +#ifdef PRIxFAST32 +inline constexpr auto value_PRIxFAST32 = (PRIxFAST32); +#endif +#ifdef PRIxFAST64 +inline constexpr auto value_PRIxFAST64 = (PRIxFAST64); +#endif +#ifdef PRIxMAX +inline constexpr auto value_PRIxMAX = (PRIxMAX); +#endif +#ifdef PRIxPTR +inline constexpr auto value_PRIxPTR = (PRIxPTR); +#endif +#ifdef PRIX8 +inline constexpr auto value_PRIX8 = (PRIX8); +#endif +#ifdef PRIX16 +inline constexpr auto value_PRIX16 = (PRIX16); +#endif +#ifdef PRIX32 +inline constexpr auto value_PRIX32 = (PRIX32); +#endif +#ifdef PRIX64 +inline constexpr auto value_PRIX64 = (PRIX64); +#endif +#ifdef PRIXLEAST8 +inline constexpr auto value_PRIXLEAST8 = (PRIXLEAST8); +#endif +#ifdef PRIXLEAST16 +inline constexpr auto value_PRIXLEAST16 = (PRIXLEAST16); +#endif +#ifdef PRIXLEAST32 +inline constexpr auto value_PRIXLEAST32 = (PRIXLEAST32); +#endif +#ifdef PRIXLEAST64 +inline constexpr auto value_PRIXLEAST64 = (PRIXLEAST64); +#endif +#ifdef PRIXFAST8 +inline constexpr auto value_PRIXFAST8 = (PRIXFAST8); +#endif +#ifdef PRIXFAST16 +inline constexpr auto value_PRIXFAST16 = (PRIXFAST16); +#endif +#ifdef PRIXFAST32 +inline constexpr auto value_PRIXFAST32 = (PRIXFAST32); +#endif +#ifdef PRIXFAST64 +inline constexpr auto value_PRIXFAST64 = (PRIXFAST64); +#endif +#ifdef PRIXMAX +inline constexpr auto value_PRIXMAX = (PRIXMAX); +#endif +#ifdef PRIXPTR +inline constexpr auto value_PRIXPTR = (PRIXPTR); +#endif +#ifdef SCNd8 +inline constexpr auto value_SCNd8 = (SCNd8); +#endif +#ifdef SCNd16 +inline constexpr auto value_SCNd16 = (SCNd16); +#endif +#ifdef SCNd32 +inline constexpr auto value_SCNd32 = (SCNd32); +#endif +#ifdef SCNd64 +inline constexpr auto value_SCNd64 = (SCNd64); +#endif +#ifdef SCNdLEAST8 +inline constexpr auto value_SCNdLEAST8 = (SCNdLEAST8); +#endif +#ifdef SCNdLEAST16 +inline constexpr auto value_SCNdLEAST16 = (SCNdLEAST16); +#endif +#ifdef SCNdLEAST32 +inline constexpr auto value_SCNdLEAST32 = (SCNdLEAST32); +#endif +#ifdef SCNdLEAST64 +inline constexpr auto value_SCNdLEAST64 = (SCNdLEAST64); +#endif +#ifdef SCNdFAST8 +inline constexpr auto value_SCNdFAST8 = (SCNdFAST8); +#endif +#ifdef SCNdFAST16 +inline constexpr auto value_SCNdFAST16 = (SCNdFAST16); +#endif +#ifdef SCNdFAST32 +inline constexpr auto value_SCNdFAST32 = (SCNdFAST32); +#endif +#ifdef SCNdFAST64 +inline constexpr auto value_SCNdFAST64 = (SCNdFAST64); +#endif +#ifdef SCNdMAX +inline constexpr auto value_SCNdMAX = (SCNdMAX); +#endif +#ifdef SCNdPTR +inline constexpr auto value_SCNdPTR = (SCNdPTR); +#endif +#ifdef SCNi8 +inline constexpr auto value_SCNi8 = (SCNi8); +#endif +#ifdef SCNi16 +inline constexpr auto value_SCNi16 = (SCNi16); +#endif +#ifdef SCNi32 +inline constexpr auto value_SCNi32 = (SCNi32); +#endif +#ifdef SCNi64 +inline constexpr auto value_SCNi64 = (SCNi64); +#endif +#ifdef SCNiLEAST8 +inline constexpr auto value_SCNiLEAST8 = (SCNiLEAST8); +#endif +#ifdef SCNiLEAST16 +inline constexpr auto value_SCNiLEAST16 = (SCNiLEAST16); +#endif +#ifdef SCNiLEAST32 +inline constexpr auto value_SCNiLEAST32 = (SCNiLEAST32); +#endif +#ifdef SCNiLEAST64 +inline constexpr auto value_SCNiLEAST64 = (SCNiLEAST64); +#endif +#ifdef SCNiFAST8 +inline constexpr auto value_SCNiFAST8 = (SCNiFAST8); +#endif +#ifdef SCNiFAST16 +inline constexpr auto value_SCNiFAST16 = (SCNiFAST16); +#endif +#ifdef SCNiFAST32 +inline constexpr auto value_SCNiFAST32 = (SCNiFAST32); +#endif +#ifdef SCNiFAST64 +inline constexpr auto value_SCNiFAST64 = (SCNiFAST64); +#endif +#ifdef SCNiMAX +inline constexpr auto value_SCNiMAX = (SCNiMAX); +#endif +#ifdef SCNiPTR +inline constexpr auto value_SCNiPTR = (SCNiPTR); +#endif +#ifdef SCNo8 +inline constexpr auto value_SCNo8 = (SCNo8); +#endif +#ifdef SCNo16 +inline constexpr auto value_SCNo16 = (SCNo16); +#endif +#ifdef SCNo32 +inline constexpr auto value_SCNo32 = (SCNo32); +#endif +#ifdef SCNo64 +inline constexpr auto value_SCNo64 = (SCNo64); +#endif +#ifdef SCNoLEAST8 +inline constexpr auto value_SCNoLEAST8 = (SCNoLEAST8); +#endif +#ifdef SCNoLEAST16 +inline constexpr auto value_SCNoLEAST16 = (SCNoLEAST16); +#endif +#ifdef SCNoLEAST32 +inline constexpr auto value_SCNoLEAST32 = (SCNoLEAST32); +#endif +#ifdef SCNoLEAST64 +inline constexpr auto value_SCNoLEAST64 = (SCNoLEAST64); +#endif +#ifdef SCNoFAST8 +inline constexpr auto value_SCNoFAST8 = (SCNoFAST8); +#endif +#ifdef SCNoFAST16 +inline constexpr auto value_SCNoFAST16 = (SCNoFAST16); +#endif +#ifdef SCNoFAST32 +inline constexpr auto value_SCNoFAST32 = (SCNoFAST32); +#endif +#ifdef SCNoFAST64 +inline constexpr auto value_SCNoFAST64 = (SCNoFAST64); +#endif +#ifdef SCNoMAX +inline constexpr auto value_SCNoMAX = (SCNoMAX); +#endif +#ifdef SCNoPTR +inline constexpr auto value_SCNoPTR = (SCNoPTR); +#endif +#ifdef SCNu8 +inline constexpr auto value_SCNu8 = (SCNu8); +#endif +#ifdef SCNu16 +inline constexpr auto value_SCNu16 = (SCNu16); +#endif +#ifdef SCNu32 +inline constexpr auto value_SCNu32 = (SCNu32); +#endif +#ifdef SCNu64 +inline constexpr auto value_SCNu64 = (SCNu64); +#endif +#ifdef SCNuLEAST8 +inline constexpr auto value_SCNuLEAST8 = (SCNuLEAST8); +#endif +#ifdef SCNuLEAST16 +inline constexpr auto value_SCNuLEAST16 = (SCNuLEAST16); +#endif +#ifdef SCNuLEAST32 +inline constexpr auto value_SCNuLEAST32 = (SCNuLEAST32); +#endif +#ifdef SCNuLEAST64 +inline constexpr auto value_SCNuLEAST64 = (SCNuLEAST64); +#endif +#ifdef SCNuFAST8 +inline constexpr auto value_SCNuFAST8 = (SCNuFAST8); +#endif +#ifdef SCNuFAST16 +inline constexpr auto value_SCNuFAST16 = (SCNuFAST16); +#endif +#ifdef SCNuFAST32 +inline constexpr auto value_SCNuFAST32 = (SCNuFAST32); +#endif +#ifdef SCNuFAST64 +inline constexpr auto value_SCNuFAST64 = (SCNuFAST64); +#endif +#ifdef SCNuMAX +inline constexpr auto value_SCNuMAX = (SCNuMAX); +#endif +#ifdef SCNuPTR +inline constexpr auto value_SCNuPTR = (SCNuPTR); +#endif +#ifdef SCNx8 +inline constexpr auto value_SCNx8 = (SCNx8); +#endif +#ifdef SCNx16 +inline constexpr auto value_SCNx16 = (SCNx16); +#endif +#ifdef SCNx32 +inline constexpr auto value_SCNx32 = (SCNx32); +#endif +#ifdef SCNx64 +inline constexpr auto value_SCNx64 = (SCNx64); +#endif +#ifdef SCNxLEAST8 +inline constexpr auto value_SCNxLEAST8 = (SCNxLEAST8); +#endif +#ifdef SCNxLEAST16 +inline constexpr auto value_SCNxLEAST16 = (SCNxLEAST16); +#endif +#ifdef SCNxLEAST32 +inline constexpr auto value_SCNxLEAST32 = (SCNxLEAST32); +#endif +#ifdef SCNxLEAST64 +inline constexpr auto value_SCNxLEAST64 = (SCNxLEAST64); +#endif +#ifdef SCNxFAST8 +inline constexpr auto value_SCNxFAST8 = (SCNxFAST8); +#endif +#ifdef SCNxFAST16 +inline constexpr auto value_SCNxFAST16 = (SCNxFAST16); +#endif +#ifdef SCNxFAST32 +inline constexpr auto value_SCNxFAST32 = (SCNxFAST32); +#endif +#ifdef SCNxFAST64 +inline constexpr auto value_SCNxFAST64 = (SCNxFAST64); +#endif +#ifdef SCNxMAX +inline constexpr auto value_SCNxMAX = (SCNxMAX); +#endif +#ifdef SCNxPTR +inline constexpr auto value_SCNxPTR = (SCNxPTR); +#endif +#ifdef CHAR_BIT +inline constexpr auto value_CHAR_BIT = (CHAR_BIT); +#endif +#ifdef SCHAR_MIN +inline constexpr auto value_SCHAR_MIN = (SCHAR_MIN); +#endif +#ifdef SCHAR_MAX +inline constexpr auto value_SCHAR_MAX = (SCHAR_MAX); +#endif +#ifdef UCHAR_MAX +inline constexpr auto value_UCHAR_MAX = (UCHAR_MAX); +#endif +#ifdef CHAR_MIN +inline constexpr auto value_CHAR_MIN = (CHAR_MIN); +#endif +#ifdef CHAR_MAX +inline constexpr auto value_CHAR_MAX = (CHAR_MAX); +#endif +#ifdef MB_LEN_MAX +inline constexpr auto value_MB_LEN_MAX = (MB_LEN_MAX); +#endif +#ifdef SHRT_MIN +inline constexpr auto value_SHRT_MIN = (SHRT_MIN); +#endif +#ifdef SHRT_MAX +inline constexpr auto value_SHRT_MAX = (SHRT_MAX); +#endif +#ifdef USHRT_MAX +inline constexpr auto value_USHRT_MAX = (USHRT_MAX); +#endif +#ifdef INT_MIN +inline constexpr auto value_INT_MIN = (INT_MIN); +#endif +#ifdef INT_MAX +inline constexpr auto value_INT_MAX = (INT_MAX); +#endif +#ifdef UINT_MAX +inline constexpr auto value_UINT_MAX = (UINT_MAX); +#endif +#ifdef LONG_MIN +inline constexpr auto value_LONG_MIN = (LONG_MIN); +#endif +#ifdef LONG_MAX +inline constexpr auto value_LONG_MAX = (LONG_MAX); +#endif +#ifdef ULONG_MAX +inline constexpr auto value_ULONG_MAX = (ULONG_MAX); +#endif +#ifdef LLONG_MIN +inline constexpr auto value_LLONG_MIN = (LLONG_MIN); +#endif +#ifdef LLONG_MAX +inline constexpr auto value_LLONG_MAX = (LLONG_MAX); +#endif +#ifdef ULLONG_MAX +inline constexpr auto value_ULLONG_MAX = (ULLONG_MAX); +#endif +#ifdef LC_ALL +inline constexpr auto value_LC_ALL = (LC_ALL); +#endif +#ifdef LC_COLLATE +inline constexpr auto value_LC_COLLATE = (LC_COLLATE); +#endif +#ifdef LC_CTYPE +inline constexpr auto value_LC_CTYPE = (LC_CTYPE); +#endif +#ifdef LC_MONETARY +inline constexpr auto value_LC_MONETARY = (LC_MONETARY); +#endif +#ifdef LC_NUMERIC +inline constexpr auto value_LC_NUMERIC = (LC_NUMERIC); +#endif +#ifdef LC_TIME +inline constexpr auto value_LC_TIME = (LC_TIME); +#endif +#ifdef HUGE_VAL +inline decltype(auto) get_HUGE_VAL() { return (HUGE_VAL); } +#endif +#ifdef HUGE_VALF +inline decltype(auto) get_HUGE_VALF() { return (HUGE_VALF); } +#endif +#ifdef HUGE_VALL +inline decltype(auto) get_HUGE_VALL() { return (HUGE_VALL); } +#endif +#ifdef INFINITY +inline decltype(auto) get_INFINITY() { return (INFINITY); } +#endif +#ifdef NAN +inline decltype(auto) get_NAN() { return (NAN); } +#endif +#ifdef FP_INFINITE +inline constexpr auto value_FP_INFINITE = (FP_INFINITE); +#endif +#ifdef FP_NAN +inline constexpr auto value_FP_NAN = (FP_NAN); +#endif +#ifdef FP_NORMAL +inline constexpr auto value_FP_NORMAL = (FP_NORMAL); +#endif +#ifdef FP_SUBNORMAL +inline constexpr auto value_FP_SUBNORMAL = (FP_SUBNORMAL); +#endif +#ifdef FP_ZERO +inline constexpr auto value_FP_ZERO = (FP_ZERO); +#endif +#ifdef FP_FAST_FMA +inline decltype(auto) get_FP_FAST_FMA() { return (FP_FAST_FMA); } +#endif +#ifdef FP_FAST_FMAF +inline decltype(auto) get_FP_FAST_FMAF() { return (FP_FAST_FMAF); } +#endif +#ifdef FP_FAST_FMAL +inline decltype(auto) get_FP_FAST_FMAL() { return (FP_FAST_FMAL); } +#endif +#ifdef FP_ILOGB0 +inline constexpr auto value_FP_ILOGB0 = (FP_ILOGB0); +#endif +#ifdef FP_ILOGBNAN +inline constexpr auto value_FP_ILOGBNAN = (FP_ILOGBNAN); +#endif +#ifdef MATH_ERRNO +inline constexpr auto value_MATH_ERRNO = (MATH_ERRNO); +#endif +#ifdef MATH_ERREXCEPT +inline constexpr auto value_MATH_ERREXCEPT = (MATH_ERREXCEPT); +#endif +#ifdef math_errhandling +inline decltype(auto) get_math_errhandling() { return (math_errhandling); } +#endif +#ifdef SIG_DFL +inline constexpr auto value_SIG_DFL = (SIG_DFL); +#endif +#ifdef SIG_ERR +inline decltype(auto) get_SIG_ERR() { return (SIG_ERR); } +#endif +#ifdef SIG_IGN +inline decltype(auto) get_SIG_IGN() { return (SIG_IGN); } +#endif +#ifdef SIGABRT +inline constexpr auto value_SIGABRT = (SIGABRT); +#endif +#ifdef SIGFPE +inline constexpr auto value_SIGFPE = (SIGFPE); +#endif +#ifdef SIGILL +inline constexpr auto value_SIGILL = (SIGILL); +#endif +#ifdef SIGINT +inline constexpr auto value_SIGINT = (SIGINT); +#endif +#ifdef SIGSEGV +inline constexpr auto value_SIGSEGV = (SIGSEGV); +#endif +#ifdef SIGTERM +inline constexpr auto value_SIGTERM = (SIGTERM); +#endif +#ifdef INT8_MIN +inline constexpr auto value_INT8_MIN = (INT8_MIN); +#endif +#ifdef INT8_MAX +inline constexpr auto value_INT8_MAX = (INT8_MAX); +#endif +#ifdef UINT8_MAX +inline constexpr auto value_UINT8_MAX = (UINT8_MAX); +#endif +#ifdef INT_LEAST8_MIN +inline constexpr auto value_INT_LEAST8_MIN = (INT_LEAST8_MIN); +#endif +#ifdef INT_LEAST8_MAX +inline constexpr auto value_INT_LEAST8_MAX = (INT_LEAST8_MAX); +#endif +#ifdef UINT_LEAST8_MAX +inline constexpr auto value_UINT_LEAST8_MAX = (UINT_LEAST8_MAX); +#endif +#ifdef INT_FAST8_MIN +inline constexpr auto value_INT_FAST8_MIN = (INT_FAST8_MIN); +#endif +#ifdef INT_FAST8_MAX +inline constexpr auto value_INT_FAST8_MAX = (INT_FAST8_MAX); +#endif +#ifdef UINT_FAST8_MAX +inline constexpr auto value_UINT_FAST8_MAX = (UINT_FAST8_MAX); +#endif +#ifdef INT16_MIN +inline constexpr auto value_INT16_MIN = (INT16_MIN); +#endif +#ifdef INT16_MAX +inline constexpr auto value_INT16_MAX = (INT16_MAX); +#endif +#ifdef UINT16_MAX +inline constexpr auto value_UINT16_MAX = (UINT16_MAX); +#endif +#ifdef INT_LEAST16_MIN +inline constexpr auto value_INT_LEAST16_MIN = (INT_LEAST16_MIN); +#endif +#ifdef INT_LEAST16_MAX +inline constexpr auto value_INT_LEAST16_MAX = (INT_LEAST16_MAX); +#endif +#ifdef UINT_LEAST16_MAX +inline constexpr auto value_UINT_LEAST16_MAX = (UINT_LEAST16_MAX); +#endif +#ifdef INT_FAST16_MIN +inline constexpr auto value_INT_FAST16_MIN = (INT_FAST16_MIN); +#endif +#ifdef INT_FAST16_MAX +inline constexpr auto value_INT_FAST16_MAX = (INT_FAST16_MAX); +#endif +#ifdef UINT_FAST16_MAX +inline constexpr auto value_UINT_FAST16_MAX = (UINT_FAST16_MAX); +#endif +#ifdef INT32_MIN +inline constexpr auto value_INT32_MIN = (INT32_MIN); +#endif +#ifdef INT32_MAX +inline constexpr auto value_INT32_MAX = (INT32_MAX); +#endif +#ifdef UINT32_MAX +inline constexpr auto value_UINT32_MAX = (UINT32_MAX); +#endif +#ifdef INT_LEAST32_MIN +inline constexpr auto value_INT_LEAST32_MIN = (INT_LEAST32_MIN); +#endif +#ifdef INT_LEAST32_MAX +inline constexpr auto value_INT_LEAST32_MAX = (INT_LEAST32_MAX); +#endif +#ifdef UINT_LEAST32_MAX +inline constexpr auto value_UINT_LEAST32_MAX = (UINT_LEAST32_MAX); +#endif +#ifdef INT_FAST32_MIN +inline constexpr auto value_INT_FAST32_MIN = (INT_FAST32_MIN); +#endif +#ifdef INT_FAST32_MAX +inline constexpr auto value_INT_FAST32_MAX = (INT_FAST32_MAX); +#endif +#ifdef UINT_FAST32_MAX +inline constexpr auto value_UINT_FAST32_MAX = (UINT_FAST32_MAX); +#endif +#ifdef INT64_MIN +inline constexpr auto value_INT64_MIN = (INT64_MIN); +#endif +#ifdef INT64_MAX +inline constexpr auto value_INT64_MAX = (INT64_MAX); +#endif +#ifdef UINT64_MAX +inline constexpr auto value_UINT64_MAX = (UINT64_MAX); +#endif +#ifdef INT_LEAST64_MIN +inline constexpr auto value_INT_LEAST64_MIN = (INT_LEAST64_MIN); +#endif +#ifdef INT_LEAST64_MAX +inline constexpr auto value_INT_LEAST64_MAX = (INT_LEAST64_MAX); +#endif +#ifdef UINT_LEAST64_MAX +inline constexpr auto value_UINT_LEAST64_MAX = (UINT_LEAST64_MAX); +#endif +#ifdef INT_FAST64_MIN +inline constexpr auto value_INT_FAST64_MIN = (INT_FAST64_MIN); +#endif +#ifdef INT_FAST64_MAX +inline constexpr auto value_INT_FAST64_MAX = (INT_FAST64_MAX); +#endif +#ifdef UINT_FAST64_MAX +inline constexpr auto value_UINT_FAST64_MAX = (UINT_FAST64_MAX); +#endif +#ifdef INTPTR_MIN +inline constexpr auto value_INTPTR_MIN = (INTPTR_MIN); +#endif +#ifdef INTPTR_MAX +inline constexpr auto value_INTPTR_MAX = (INTPTR_MAX); +#endif +#ifdef UINTPTR_MAX +inline constexpr auto value_UINTPTR_MAX = (UINTPTR_MAX); +#endif +#ifdef INTMAX_MIN +inline constexpr auto value_INTMAX_MIN = (INTMAX_MIN); +#endif +#ifdef INTMAX_MAX +inline constexpr auto value_INTMAX_MAX = (INTMAX_MAX); +#endif +#ifdef UINTMAX_MAX +inline constexpr auto value_UINTMAX_MAX = (UINTMAX_MAX); +#endif +#ifdef PTRDIFF_MIN +inline constexpr auto value_PTRDIFF_MIN = (PTRDIFF_MIN); +#endif +#ifdef PTRDIFF_MAX +inline constexpr auto value_PTRDIFF_MAX = (PTRDIFF_MAX); +#endif +#ifdef SIG_ATOMIC_MIN +inline constexpr auto value_SIG_ATOMIC_MIN = (SIG_ATOMIC_MIN); +#endif +#ifdef SIG_ATOMIC_MAX +inline constexpr auto value_SIG_ATOMIC_MAX = (SIG_ATOMIC_MAX); +#endif +#ifdef SIZE_MAX +inline constexpr auto value_SIZE_MAX = (SIZE_MAX); +#endif +#ifdef WCHAR_MIN +inline constexpr auto value_WCHAR_MIN = (WCHAR_MIN); +#endif +#ifdef WCHAR_MAX +inline constexpr auto value_WCHAR_MAX = (WCHAR_MAX); +#endif +#ifdef WINT_MIN +inline constexpr auto value_WINT_MIN = (WINT_MIN); +#endif +#ifdef WINT_MAX +inline constexpr auto value_WINT_MAX = (WINT_MAX); +#endif +#ifdef _IOFBF +inline constexpr auto value__IOFBF = (_IOFBF); +#endif +#ifdef _IOLBF +inline constexpr auto value__IOLBF = (_IOLBF); +#endif +#ifdef _IONBF +inline constexpr auto value__IONBF = (_IONBF); +#endif +#ifdef BUFSIZ +inline constexpr auto value_BUFSIZ = (BUFSIZ); +#endif +#ifdef EOF +inline constexpr auto value_EOF = (EOF); +#endif +#ifdef FOPEN_MAX +inline constexpr auto value_FOPEN_MAX = (FOPEN_MAX); +#endif +#ifdef FILENAME_MAX +inline constexpr auto value_FILENAME_MAX = (FILENAME_MAX); +#endif +#ifdef L_tmpnam +inline constexpr auto value_L_tmpnam = (L_tmpnam); +#endif +#ifdef SEEK_CUR +inline constexpr auto value_SEEK_CUR = (SEEK_CUR); +#endif +#ifdef SEEK_END +inline constexpr auto value_SEEK_END = (SEEK_END); +#endif +#ifdef SEEK_SET +inline constexpr auto value_SEEK_SET = (SEEK_SET); +#endif +#ifdef TMP_MAX +inline constexpr auto value_TMP_MAX = (TMP_MAX); +#endif +#ifdef stderr +inline decltype(auto) get_stderr() { return (stderr); } +#endif +#ifdef stdin +inline decltype(auto) get_stdin() { return (stdin); } +#endif +#ifdef stdout +inline decltype(auto) get_stdout() { return (stdout); } +#endif +#ifdef EXIT_FAILURE +inline constexpr auto value_EXIT_FAILURE = (EXIT_FAILURE); +#endif +#ifdef EXIT_SUCCESS +inline constexpr auto value_EXIT_SUCCESS = (EXIT_SUCCESS); +#endif +#ifdef RAND_MAX +inline constexpr auto value_RAND_MAX = (RAND_MAX); +#endif +#ifdef MB_CUR_MAX +inline decltype(auto) get_MB_CUR_MAX() { return (MB_CUR_MAX); } +#endif +#ifdef CLOCKS_PER_SEC +inline constexpr auto value_CLOCKS_PER_SEC = (CLOCKS_PER_SEC); +#endif +#ifdef TIME_UTC +inline constexpr auto value_TIME_UTC = (TIME_UTC); +#endif +#ifdef WEOF +inline constexpr auto value_WEOF = (WEOF); +#endif +} +#ifdef EDOM +#undef EDOM +#define MWRAP_LIBC_HAS_EDOM +#endif +#ifdef EILSEQ +#undef EILSEQ +#define MWRAP_LIBC_HAS_EILSEQ +#endif +#ifdef ERANGE +#undef ERANGE +#define MWRAP_LIBC_HAS_ERANGE +#endif +#ifdef errno +#undef errno +#define MWRAP_LIBC_HAS_errno +#endif +#ifdef FE_DIVBYZERO +#undef FE_DIVBYZERO +#define MWRAP_LIBC_HAS_FE_DIVBYZERO +#endif +#ifdef FE_INEXACT +#undef FE_INEXACT +#define MWRAP_LIBC_HAS_FE_INEXACT +#endif +#ifdef FE_INVALID +#undef FE_INVALID +#define MWRAP_LIBC_HAS_FE_INVALID +#endif +#ifdef FE_OVERFLOW +#undef FE_OVERFLOW +#define MWRAP_LIBC_HAS_FE_OVERFLOW +#endif +#ifdef FE_UNDERFLOW +#undef FE_UNDERFLOW +#define MWRAP_LIBC_HAS_FE_UNDERFLOW +#endif +#ifdef FE_ALL_EXCEPT +#undef FE_ALL_EXCEPT +#define MWRAP_LIBC_HAS_FE_ALL_EXCEPT +#endif +#ifdef FE_DOWNWARD +#undef FE_DOWNWARD +#define MWRAP_LIBC_HAS_FE_DOWNWARD +#endif +#ifdef FE_TONEAREST +#undef FE_TONEAREST +#define MWRAP_LIBC_HAS_FE_TONEAREST +#endif +#ifdef FE_TOWARDZERO +#undef FE_TOWARDZERO +#define MWRAP_LIBC_HAS_FE_TOWARDZERO +#endif +#ifdef FE_UPWARD +#undef FE_UPWARD +#define MWRAP_LIBC_HAS_FE_UPWARD +#endif +#ifdef FE_DFL_ENV +#undef FE_DFL_ENV +#define MWRAP_LIBC_HAS_FE_DFL_ENV +#endif +#ifdef FLT_ROUNDS +#undef FLT_ROUNDS +#define MWRAP_LIBC_HAS_FLT_ROUNDS +#endif +#ifdef FLT_EVAL_METHOD +#undef FLT_EVAL_METHOD +#define MWRAP_LIBC_HAS_FLT_EVAL_METHOD +#endif +#ifdef FLT_HAS_SUBNORM +#undef FLT_HAS_SUBNORM +#define MWRAP_LIBC_HAS_FLT_HAS_SUBNORM +#endif +#ifdef DBL_HAS_SUBNORM +#undef DBL_HAS_SUBNORM +#define MWRAP_LIBC_HAS_DBL_HAS_SUBNORM +#endif +#ifdef LDBL_HAS_SUBNORM +#undef LDBL_HAS_SUBNORM +#define MWRAP_LIBC_HAS_LDBL_HAS_SUBNORM +#endif +#ifdef FLT_RADIX +#undef FLT_RADIX +#define MWRAP_LIBC_HAS_FLT_RADIX +#endif +#ifdef DECIMAL_DIG +#undef DECIMAL_DIG +#define MWRAP_LIBC_HAS_DECIMAL_DIG +#endif +#ifdef FLT_MANT_DIG +#undef FLT_MANT_DIG +#define MWRAP_LIBC_HAS_FLT_MANT_DIG +#endif +#ifdef DBL_MANT_DIG +#undef DBL_MANT_DIG +#define MWRAP_LIBC_HAS_DBL_MANT_DIG +#endif +#ifdef LDBL_MANT_DIG +#undef LDBL_MANT_DIG +#define MWRAP_LIBC_HAS_LDBL_MANT_DIG +#endif +#ifdef FLT_DECIMAL_DIG +#undef FLT_DECIMAL_DIG +#define MWRAP_LIBC_HAS_FLT_DECIMAL_DIG +#endif +#ifdef DBL_DECIMAL_DIG +#undef DBL_DECIMAL_DIG +#define MWRAP_LIBC_HAS_DBL_DECIMAL_DIG +#endif +#ifdef LDBL_DECIMAL_DIG +#undef LDBL_DECIMAL_DIG +#define MWRAP_LIBC_HAS_LDBL_DECIMAL_DIG +#endif +#ifdef FLT_DIG +#undef FLT_DIG +#define MWRAP_LIBC_HAS_FLT_DIG +#endif +#ifdef DBL_DIG +#undef DBL_DIG +#define MWRAP_LIBC_HAS_DBL_DIG +#endif +#ifdef LDBL_DIG +#undef LDBL_DIG +#define MWRAP_LIBC_HAS_LDBL_DIG +#endif +#ifdef FLT_MIN_EXP +#undef FLT_MIN_EXP +#define MWRAP_LIBC_HAS_FLT_MIN_EXP +#endif +#ifdef DBL_MIN_EXP +#undef DBL_MIN_EXP +#define MWRAP_LIBC_HAS_DBL_MIN_EXP +#endif +#ifdef LDBL_MIN_EXP +#undef LDBL_MIN_EXP +#define MWRAP_LIBC_HAS_LDBL_MIN_EXP +#endif +#ifdef FLT_MIN_10_EXP +#undef FLT_MIN_10_EXP +#define MWRAP_LIBC_HAS_FLT_MIN_10_EXP +#endif +#ifdef DBL_MIN_10_EXP +#undef DBL_MIN_10_EXP +#define MWRAP_LIBC_HAS_DBL_MIN_10_EXP +#endif +#ifdef LDBL_MIN_10_EXP +#undef LDBL_MIN_10_EXP +#define MWRAP_LIBC_HAS_LDBL_MIN_10_EXP +#endif +#ifdef FLT_MAX_EXP +#undef FLT_MAX_EXP +#define MWRAP_LIBC_HAS_FLT_MAX_EXP +#endif +#ifdef DBL_MAX_EXP +#undef DBL_MAX_EXP +#define MWRAP_LIBC_HAS_DBL_MAX_EXP +#endif +#ifdef LDBL_MAX_EXP +#undef LDBL_MAX_EXP +#define MWRAP_LIBC_HAS_LDBL_MAX_EXP +#endif +#ifdef FLT_MAX_10_EXP +#undef FLT_MAX_10_EXP +#define MWRAP_LIBC_HAS_FLT_MAX_10_EXP +#endif +#ifdef DBL_MAX_10_EXP +#undef DBL_MAX_10_EXP +#define MWRAP_LIBC_HAS_DBL_MAX_10_EXP +#endif +#ifdef LDBL_MAX_10_EXP +#undef LDBL_MAX_10_EXP +#define MWRAP_LIBC_HAS_LDBL_MAX_10_EXP +#endif +#ifdef FLT_MAX +#undef FLT_MAX +#define MWRAP_LIBC_HAS_FLT_MAX +#endif +#ifdef DBL_MAX +#undef DBL_MAX +#define MWRAP_LIBC_HAS_DBL_MAX +#endif +#ifdef LDBL_MAX +#undef LDBL_MAX +#define MWRAP_LIBC_HAS_LDBL_MAX +#endif +#ifdef FLT_EPSILON +#undef FLT_EPSILON +#define MWRAP_LIBC_HAS_FLT_EPSILON +#endif +#ifdef DBL_EPSILON +#undef DBL_EPSILON +#define MWRAP_LIBC_HAS_DBL_EPSILON +#endif +#ifdef LDBL_EPSILON +#undef LDBL_EPSILON +#define MWRAP_LIBC_HAS_LDBL_EPSILON +#endif +#ifdef FLT_MIN +#undef FLT_MIN +#define MWRAP_LIBC_HAS_FLT_MIN +#endif +#ifdef DBL_MIN +#undef DBL_MIN +#define MWRAP_LIBC_HAS_DBL_MIN +#endif +#ifdef LDBL_MIN +#undef LDBL_MIN +#define MWRAP_LIBC_HAS_LDBL_MIN +#endif +#ifdef FLT_TRUE_MIN +#undef FLT_TRUE_MIN +#define MWRAP_LIBC_HAS_FLT_TRUE_MIN +#endif +#ifdef DBL_TRUE_MIN +#undef DBL_TRUE_MIN +#define MWRAP_LIBC_HAS_DBL_TRUE_MIN +#endif +#ifdef LDBL_TRUE_MIN +#undef LDBL_TRUE_MIN +#define MWRAP_LIBC_HAS_LDBL_TRUE_MIN +#endif +#ifdef PRId8 +#undef PRId8 +#define MWRAP_LIBC_HAS_PRId8 +#endif +#ifdef PRId16 +#undef PRId16 +#define MWRAP_LIBC_HAS_PRId16 +#endif +#ifdef PRId32 +#undef PRId32 +#define MWRAP_LIBC_HAS_PRId32 +#endif +#ifdef PRId64 +#undef PRId64 +#define MWRAP_LIBC_HAS_PRId64 +#endif +#ifdef PRIdLEAST8 +#undef PRIdLEAST8 +#define MWRAP_LIBC_HAS_PRIdLEAST8 +#endif +#ifdef PRIdLEAST16 +#undef PRIdLEAST16 +#define MWRAP_LIBC_HAS_PRIdLEAST16 +#endif +#ifdef PRIdLEAST32 +#undef PRIdLEAST32 +#define MWRAP_LIBC_HAS_PRIdLEAST32 +#endif +#ifdef PRIdLEAST64 +#undef PRIdLEAST64 +#define MWRAP_LIBC_HAS_PRIdLEAST64 +#endif +#ifdef PRIdFAST8 +#undef PRIdFAST8 +#define MWRAP_LIBC_HAS_PRIdFAST8 +#endif +#ifdef PRIdFAST16 +#undef PRIdFAST16 +#define MWRAP_LIBC_HAS_PRIdFAST16 +#endif +#ifdef PRIdFAST32 +#undef PRIdFAST32 +#define MWRAP_LIBC_HAS_PRIdFAST32 +#endif +#ifdef PRIdFAST64 +#undef PRIdFAST64 +#define MWRAP_LIBC_HAS_PRIdFAST64 +#endif +#ifdef PRIdMAX +#undef PRIdMAX +#define MWRAP_LIBC_HAS_PRIdMAX +#endif +#ifdef PRIdPTR +#undef PRIdPTR +#define MWRAP_LIBC_HAS_PRIdPTR +#endif +#ifdef PRIi8 +#undef PRIi8 +#define MWRAP_LIBC_HAS_PRIi8 +#endif +#ifdef PRIi16 +#undef PRIi16 +#define MWRAP_LIBC_HAS_PRIi16 +#endif +#ifdef PRIi32 +#undef PRIi32 +#define MWRAP_LIBC_HAS_PRIi32 +#endif +#ifdef PRIi64 +#undef PRIi64 +#define MWRAP_LIBC_HAS_PRIi64 +#endif +#ifdef PRIiLEAST8 +#undef PRIiLEAST8 +#define MWRAP_LIBC_HAS_PRIiLEAST8 +#endif +#ifdef PRIiLEAST16 +#undef PRIiLEAST16 +#define MWRAP_LIBC_HAS_PRIiLEAST16 +#endif +#ifdef PRIiLEAST32 +#undef PRIiLEAST32 +#define MWRAP_LIBC_HAS_PRIiLEAST32 +#endif +#ifdef PRIiLEAST64 +#undef PRIiLEAST64 +#define MWRAP_LIBC_HAS_PRIiLEAST64 +#endif +#ifdef PRIiFAST8 +#undef PRIiFAST8 +#define MWRAP_LIBC_HAS_PRIiFAST8 +#endif +#ifdef PRIiFAST16 +#undef PRIiFAST16 +#define MWRAP_LIBC_HAS_PRIiFAST16 +#endif +#ifdef PRIiFAST32 +#undef PRIiFAST32 +#define MWRAP_LIBC_HAS_PRIiFAST32 +#endif +#ifdef PRIiFAST64 +#undef PRIiFAST64 +#define MWRAP_LIBC_HAS_PRIiFAST64 +#endif +#ifdef PRIiMAX +#undef PRIiMAX +#define MWRAP_LIBC_HAS_PRIiMAX +#endif +#ifdef PRIiPTR +#undef PRIiPTR +#define MWRAP_LIBC_HAS_PRIiPTR +#endif +#ifdef PRIo8 +#undef PRIo8 +#define MWRAP_LIBC_HAS_PRIo8 +#endif +#ifdef PRIo16 +#undef PRIo16 +#define MWRAP_LIBC_HAS_PRIo16 +#endif +#ifdef PRIo32 +#undef PRIo32 +#define MWRAP_LIBC_HAS_PRIo32 +#endif +#ifdef PRIo64 +#undef PRIo64 +#define MWRAP_LIBC_HAS_PRIo64 +#endif +#ifdef PRIoLEAST8 +#undef PRIoLEAST8 +#define MWRAP_LIBC_HAS_PRIoLEAST8 +#endif +#ifdef PRIoLEAST16 +#undef PRIoLEAST16 +#define MWRAP_LIBC_HAS_PRIoLEAST16 +#endif +#ifdef PRIoLEAST32 +#undef PRIoLEAST32 +#define MWRAP_LIBC_HAS_PRIoLEAST32 +#endif +#ifdef PRIoLEAST64 +#undef PRIoLEAST64 +#define MWRAP_LIBC_HAS_PRIoLEAST64 +#endif +#ifdef PRIoFAST8 +#undef PRIoFAST8 +#define MWRAP_LIBC_HAS_PRIoFAST8 +#endif +#ifdef PRIoFAST16 +#undef PRIoFAST16 +#define MWRAP_LIBC_HAS_PRIoFAST16 +#endif +#ifdef PRIoFAST32 +#undef PRIoFAST32 +#define MWRAP_LIBC_HAS_PRIoFAST32 +#endif +#ifdef PRIoFAST64 +#undef PRIoFAST64 +#define MWRAP_LIBC_HAS_PRIoFAST64 +#endif +#ifdef PRIoMAX +#undef PRIoMAX +#define MWRAP_LIBC_HAS_PRIoMAX +#endif +#ifdef PRIoPTR +#undef PRIoPTR +#define MWRAP_LIBC_HAS_PRIoPTR +#endif +#ifdef PRIu8 +#undef PRIu8 +#define MWRAP_LIBC_HAS_PRIu8 +#endif +#ifdef PRIu16 +#undef PRIu16 +#define MWRAP_LIBC_HAS_PRIu16 +#endif +#ifdef PRIu32 +#undef PRIu32 +#define MWRAP_LIBC_HAS_PRIu32 +#endif +#ifdef PRIu64 +#undef PRIu64 +#define MWRAP_LIBC_HAS_PRIu64 +#endif +#ifdef PRIuLEAST8 +#undef PRIuLEAST8 +#define MWRAP_LIBC_HAS_PRIuLEAST8 +#endif +#ifdef PRIuLEAST16 +#undef PRIuLEAST16 +#define MWRAP_LIBC_HAS_PRIuLEAST16 +#endif +#ifdef PRIuLEAST32 +#undef PRIuLEAST32 +#define MWRAP_LIBC_HAS_PRIuLEAST32 +#endif +#ifdef PRIuLEAST64 +#undef PRIuLEAST64 +#define MWRAP_LIBC_HAS_PRIuLEAST64 +#endif +#ifdef PRIuFAST8 +#undef PRIuFAST8 +#define MWRAP_LIBC_HAS_PRIuFAST8 +#endif +#ifdef PRIuFAST16 +#undef PRIuFAST16 +#define MWRAP_LIBC_HAS_PRIuFAST16 +#endif +#ifdef PRIuFAST32 +#undef PRIuFAST32 +#define MWRAP_LIBC_HAS_PRIuFAST32 +#endif +#ifdef PRIuFAST64 +#undef PRIuFAST64 +#define MWRAP_LIBC_HAS_PRIuFAST64 +#endif +#ifdef PRIuMAX +#undef PRIuMAX +#define MWRAP_LIBC_HAS_PRIuMAX +#endif +#ifdef PRIuPTR +#undef PRIuPTR +#define MWRAP_LIBC_HAS_PRIuPTR +#endif +#ifdef PRIx8 +#undef PRIx8 +#define MWRAP_LIBC_HAS_PRIx8 +#endif +#ifdef PRIx16 +#undef PRIx16 +#define MWRAP_LIBC_HAS_PRIx16 +#endif +#ifdef PRIx32 +#undef PRIx32 +#define MWRAP_LIBC_HAS_PRIx32 +#endif +#ifdef PRIx64 +#undef PRIx64 +#define MWRAP_LIBC_HAS_PRIx64 +#endif +#ifdef PRIxLEAST8 +#undef PRIxLEAST8 +#define MWRAP_LIBC_HAS_PRIxLEAST8 +#endif +#ifdef PRIxLEAST16 +#undef PRIxLEAST16 +#define MWRAP_LIBC_HAS_PRIxLEAST16 +#endif +#ifdef PRIxLEAST32 +#undef PRIxLEAST32 +#define MWRAP_LIBC_HAS_PRIxLEAST32 +#endif +#ifdef PRIxLEAST64 +#undef PRIxLEAST64 +#define MWRAP_LIBC_HAS_PRIxLEAST64 +#endif +#ifdef PRIxFAST8 +#undef PRIxFAST8 +#define MWRAP_LIBC_HAS_PRIxFAST8 +#endif +#ifdef PRIxFAST16 +#undef PRIxFAST16 +#define MWRAP_LIBC_HAS_PRIxFAST16 +#endif +#ifdef PRIxFAST32 +#undef PRIxFAST32 +#define MWRAP_LIBC_HAS_PRIxFAST32 +#endif +#ifdef PRIxFAST64 +#undef PRIxFAST64 +#define MWRAP_LIBC_HAS_PRIxFAST64 +#endif +#ifdef PRIxMAX +#undef PRIxMAX +#define MWRAP_LIBC_HAS_PRIxMAX +#endif +#ifdef PRIxPTR +#undef PRIxPTR +#define MWRAP_LIBC_HAS_PRIxPTR +#endif +#ifdef PRIX8 +#undef PRIX8 +#define MWRAP_LIBC_HAS_PRIX8 +#endif +#ifdef PRIX16 +#undef PRIX16 +#define MWRAP_LIBC_HAS_PRIX16 +#endif +#ifdef PRIX32 +#undef PRIX32 +#define MWRAP_LIBC_HAS_PRIX32 +#endif +#ifdef PRIX64 +#undef PRIX64 +#define MWRAP_LIBC_HAS_PRIX64 +#endif +#ifdef PRIXLEAST8 +#undef PRIXLEAST8 +#define MWRAP_LIBC_HAS_PRIXLEAST8 +#endif +#ifdef PRIXLEAST16 +#undef PRIXLEAST16 +#define MWRAP_LIBC_HAS_PRIXLEAST16 +#endif +#ifdef PRIXLEAST32 +#undef PRIXLEAST32 +#define MWRAP_LIBC_HAS_PRIXLEAST32 +#endif +#ifdef PRIXLEAST64 +#undef PRIXLEAST64 +#define MWRAP_LIBC_HAS_PRIXLEAST64 +#endif +#ifdef PRIXFAST8 +#undef PRIXFAST8 +#define MWRAP_LIBC_HAS_PRIXFAST8 +#endif +#ifdef PRIXFAST16 +#undef PRIXFAST16 +#define MWRAP_LIBC_HAS_PRIXFAST16 +#endif +#ifdef PRIXFAST32 +#undef PRIXFAST32 +#define MWRAP_LIBC_HAS_PRIXFAST32 +#endif +#ifdef PRIXFAST64 +#undef PRIXFAST64 +#define MWRAP_LIBC_HAS_PRIXFAST64 +#endif +#ifdef PRIXMAX +#undef PRIXMAX +#define MWRAP_LIBC_HAS_PRIXMAX +#endif +#ifdef PRIXPTR +#undef PRIXPTR +#define MWRAP_LIBC_HAS_PRIXPTR +#endif +#ifdef SCNd8 +#undef SCNd8 +#define MWRAP_LIBC_HAS_SCNd8 +#endif +#ifdef SCNd16 +#undef SCNd16 +#define MWRAP_LIBC_HAS_SCNd16 +#endif +#ifdef SCNd32 +#undef SCNd32 +#define MWRAP_LIBC_HAS_SCNd32 +#endif +#ifdef SCNd64 +#undef SCNd64 +#define MWRAP_LIBC_HAS_SCNd64 +#endif +#ifdef SCNdLEAST8 +#undef SCNdLEAST8 +#define MWRAP_LIBC_HAS_SCNdLEAST8 +#endif +#ifdef SCNdLEAST16 +#undef SCNdLEAST16 +#define MWRAP_LIBC_HAS_SCNdLEAST16 +#endif +#ifdef SCNdLEAST32 +#undef SCNdLEAST32 +#define MWRAP_LIBC_HAS_SCNdLEAST32 +#endif +#ifdef SCNdLEAST64 +#undef SCNdLEAST64 +#define MWRAP_LIBC_HAS_SCNdLEAST64 +#endif +#ifdef SCNdFAST8 +#undef SCNdFAST8 +#define MWRAP_LIBC_HAS_SCNdFAST8 +#endif +#ifdef SCNdFAST16 +#undef SCNdFAST16 +#define MWRAP_LIBC_HAS_SCNdFAST16 +#endif +#ifdef SCNdFAST32 +#undef SCNdFAST32 +#define MWRAP_LIBC_HAS_SCNdFAST32 +#endif +#ifdef SCNdFAST64 +#undef SCNdFAST64 +#define MWRAP_LIBC_HAS_SCNdFAST64 +#endif +#ifdef SCNdMAX +#undef SCNdMAX +#define MWRAP_LIBC_HAS_SCNdMAX +#endif +#ifdef SCNdPTR +#undef SCNdPTR +#define MWRAP_LIBC_HAS_SCNdPTR +#endif +#ifdef SCNi8 +#undef SCNi8 +#define MWRAP_LIBC_HAS_SCNi8 +#endif +#ifdef SCNi16 +#undef SCNi16 +#define MWRAP_LIBC_HAS_SCNi16 +#endif +#ifdef SCNi32 +#undef SCNi32 +#define MWRAP_LIBC_HAS_SCNi32 +#endif +#ifdef SCNi64 +#undef SCNi64 +#define MWRAP_LIBC_HAS_SCNi64 +#endif +#ifdef SCNiLEAST8 +#undef SCNiLEAST8 +#define MWRAP_LIBC_HAS_SCNiLEAST8 +#endif +#ifdef SCNiLEAST16 +#undef SCNiLEAST16 +#define MWRAP_LIBC_HAS_SCNiLEAST16 +#endif +#ifdef SCNiLEAST32 +#undef SCNiLEAST32 +#define MWRAP_LIBC_HAS_SCNiLEAST32 +#endif +#ifdef SCNiLEAST64 +#undef SCNiLEAST64 +#define MWRAP_LIBC_HAS_SCNiLEAST64 +#endif +#ifdef SCNiFAST8 +#undef SCNiFAST8 +#define MWRAP_LIBC_HAS_SCNiFAST8 +#endif +#ifdef SCNiFAST16 +#undef SCNiFAST16 +#define MWRAP_LIBC_HAS_SCNiFAST16 +#endif +#ifdef SCNiFAST32 +#undef SCNiFAST32 +#define MWRAP_LIBC_HAS_SCNiFAST32 +#endif +#ifdef SCNiFAST64 +#undef SCNiFAST64 +#define MWRAP_LIBC_HAS_SCNiFAST64 +#endif +#ifdef SCNiMAX +#undef SCNiMAX +#define MWRAP_LIBC_HAS_SCNiMAX +#endif +#ifdef SCNiPTR +#undef SCNiPTR +#define MWRAP_LIBC_HAS_SCNiPTR +#endif +#ifdef SCNo8 +#undef SCNo8 +#define MWRAP_LIBC_HAS_SCNo8 +#endif +#ifdef SCNo16 +#undef SCNo16 +#define MWRAP_LIBC_HAS_SCNo16 +#endif +#ifdef SCNo32 +#undef SCNo32 +#define MWRAP_LIBC_HAS_SCNo32 +#endif +#ifdef SCNo64 +#undef SCNo64 +#define MWRAP_LIBC_HAS_SCNo64 +#endif +#ifdef SCNoLEAST8 +#undef SCNoLEAST8 +#define MWRAP_LIBC_HAS_SCNoLEAST8 +#endif +#ifdef SCNoLEAST16 +#undef SCNoLEAST16 +#define MWRAP_LIBC_HAS_SCNoLEAST16 +#endif +#ifdef SCNoLEAST32 +#undef SCNoLEAST32 +#define MWRAP_LIBC_HAS_SCNoLEAST32 +#endif +#ifdef SCNoLEAST64 +#undef SCNoLEAST64 +#define MWRAP_LIBC_HAS_SCNoLEAST64 +#endif +#ifdef SCNoFAST8 +#undef SCNoFAST8 +#define MWRAP_LIBC_HAS_SCNoFAST8 +#endif +#ifdef SCNoFAST16 +#undef SCNoFAST16 +#define MWRAP_LIBC_HAS_SCNoFAST16 +#endif +#ifdef SCNoFAST32 +#undef SCNoFAST32 +#define MWRAP_LIBC_HAS_SCNoFAST32 +#endif +#ifdef SCNoFAST64 +#undef SCNoFAST64 +#define MWRAP_LIBC_HAS_SCNoFAST64 +#endif +#ifdef SCNoMAX +#undef SCNoMAX +#define MWRAP_LIBC_HAS_SCNoMAX +#endif +#ifdef SCNoPTR +#undef SCNoPTR +#define MWRAP_LIBC_HAS_SCNoPTR +#endif +#ifdef SCNu8 +#undef SCNu8 +#define MWRAP_LIBC_HAS_SCNu8 +#endif +#ifdef SCNu16 +#undef SCNu16 +#define MWRAP_LIBC_HAS_SCNu16 +#endif +#ifdef SCNu32 +#undef SCNu32 +#define MWRAP_LIBC_HAS_SCNu32 +#endif +#ifdef SCNu64 +#undef SCNu64 +#define MWRAP_LIBC_HAS_SCNu64 +#endif +#ifdef SCNuLEAST8 +#undef SCNuLEAST8 +#define MWRAP_LIBC_HAS_SCNuLEAST8 +#endif +#ifdef SCNuLEAST16 +#undef SCNuLEAST16 +#define MWRAP_LIBC_HAS_SCNuLEAST16 +#endif +#ifdef SCNuLEAST32 +#undef SCNuLEAST32 +#define MWRAP_LIBC_HAS_SCNuLEAST32 +#endif +#ifdef SCNuLEAST64 +#undef SCNuLEAST64 +#define MWRAP_LIBC_HAS_SCNuLEAST64 +#endif +#ifdef SCNuFAST8 +#undef SCNuFAST8 +#define MWRAP_LIBC_HAS_SCNuFAST8 +#endif +#ifdef SCNuFAST16 +#undef SCNuFAST16 +#define MWRAP_LIBC_HAS_SCNuFAST16 +#endif +#ifdef SCNuFAST32 +#undef SCNuFAST32 +#define MWRAP_LIBC_HAS_SCNuFAST32 +#endif +#ifdef SCNuFAST64 +#undef SCNuFAST64 +#define MWRAP_LIBC_HAS_SCNuFAST64 +#endif +#ifdef SCNuMAX +#undef SCNuMAX +#define MWRAP_LIBC_HAS_SCNuMAX +#endif +#ifdef SCNuPTR +#undef SCNuPTR +#define MWRAP_LIBC_HAS_SCNuPTR +#endif +#ifdef SCNx8 +#undef SCNx8 +#define MWRAP_LIBC_HAS_SCNx8 +#endif +#ifdef SCNx16 +#undef SCNx16 +#define MWRAP_LIBC_HAS_SCNx16 +#endif +#ifdef SCNx32 +#undef SCNx32 +#define MWRAP_LIBC_HAS_SCNx32 +#endif +#ifdef SCNx64 +#undef SCNx64 +#define MWRAP_LIBC_HAS_SCNx64 +#endif +#ifdef SCNxLEAST8 +#undef SCNxLEAST8 +#define MWRAP_LIBC_HAS_SCNxLEAST8 +#endif +#ifdef SCNxLEAST16 +#undef SCNxLEAST16 +#define MWRAP_LIBC_HAS_SCNxLEAST16 +#endif +#ifdef SCNxLEAST32 +#undef SCNxLEAST32 +#define MWRAP_LIBC_HAS_SCNxLEAST32 +#endif +#ifdef SCNxLEAST64 +#undef SCNxLEAST64 +#define MWRAP_LIBC_HAS_SCNxLEAST64 +#endif +#ifdef SCNxFAST8 +#undef SCNxFAST8 +#define MWRAP_LIBC_HAS_SCNxFAST8 +#endif +#ifdef SCNxFAST16 +#undef SCNxFAST16 +#define MWRAP_LIBC_HAS_SCNxFAST16 +#endif +#ifdef SCNxFAST32 +#undef SCNxFAST32 +#define MWRAP_LIBC_HAS_SCNxFAST32 +#endif +#ifdef SCNxFAST64 +#undef SCNxFAST64 +#define MWRAP_LIBC_HAS_SCNxFAST64 +#endif +#ifdef SCNxMAX +#undef SCNxMAX +#define MWRAP_LIBC_HAS_SCNxMAX +#endif +#ifdef SCNxPTR +#undef SCNxPTR +#define MWRAP_LIBC_HAS_SCNxPTR +#endif +#ifdef CHAR_BIT +#undef CHAR_BIT +#define MWRAP_LIBC_HAS_CHAR_BIT +#endif +#ifdef SCHAR_MIN +#undef SCHAR_MIN +#define MWRAP_LIBC_HAS_SCHAR_MIN +#endif +#ifdef SCHAR_MAX +#undef SCHAR_MAX +#define MWRAP_LIBC_HAS_SCHAR_MAX +#endif +#ifdef UCHAR_MAX +#undef UCHAR_MAX +#define MWRAP_LIBC_HAS_UCHAR_MAX +#endif +#ifdef CHAR_MIN +#undef CHAR_MIN +#define MWRAP_LIBC_HAS_CHAR_MIN +#endif +#ifdef CHAR_MAX +#undef CHAR_MAX +#define MWRAP_LIBC_HAS_CHAR_MAX +#endif +#ifdef MB_LEN_MAX +#undef MB_LEN_MAX +#define MWRAP_LIBC_HAS_MB_LEN_MAX +#endif +#ifdef SHRT_MIN +#undef SHRT_MIN +#define MWRAP_LIBC_HAS_SHRT_MIN +#endif +#ifdef SHRT_MAX +#undef SHRT_MAX +#define MWRAP_LIBC_HAS_SHRT_MAX +#endif +#ifdef USHRT_MAX +#undef USHRT_MAX +#define MWRAP_LIBC_HAS_USHRT_MAX +#endif +#ifdef INT_MIN +#undef INT_MIN +#define MWRAP_LIBC_HAS_INT_MIN +#endif +#ifdef INT_MAX +#undef INT_MAX +#define MWRAP_LIBC_HAS_INT_MAX +#endif +#ifdef UINT_MAX +#undef UINT_MAX +#define MWRAP_LIBC_HAS_UINT_MAX +#endif +#ifdef LONG_MIN +#undef LONG_MIN +#define MWRAP_LIBC_HAS_LONG_MIN +#endif +#ifdef LONG_MAX +#undef LONG_MAX +#define MWRAP_LIBC_HAS_LONG_MAX +#endif +#ifdef ULONG_MAX +#undef ULONG_MAX +#define MWRAP_LIBC_HAS_ULONG_MAX +#endif +#ifdef LLONG_MIN +#undef LLONG_MIN +#define MWRAP_LIBC_HAS_LLONG_MIN +#endif +#ifdef LLONG_MAX +#undef LLONG_MAX +#define MWRAP_LIBC_HAS_LLONG_MAX +#endif +#ifdef ULLONG_MAX +#undef ULLONG_MAX +#define MWRAP_LIBC_HAS_ULLONG_MAX +#endif +#ifdef LC_ALL +#undef LC_ALL +#define MWRAP_LIBC_HAS_LC_ALL +#endif +#ifdef LC_COLLATE +#undef LC_COLLATE +#define MWRAP_LIBC_HAS_LC_COLLATE +#endif +#ifdef LC_CTYPE +#undef LC_CTYPE +#define MWRAP_LIBC_HAS_LC_CTYPE +#endif +#ifdef LC_MONETARY +#undef LC_MONETARY +#define MWRAP_LIBC_HAS_LC_MONETARY +#endif +#ifdef LC_NUMERIC +#undef LC_NUMERIC +#define MWRAP_LIBC_HAS_LC_NUMERIC +#endif +#ifdef LC_TIME +#undef LC_TIME +#define MWRAP_LIBC_HAS_LC_TIME +#endif +#ifdef HUGE_VAL +#undef HUGE_VAL +#define MWRAP_LIBC_HAS_HUGE_VAL +#endif +#ifdef HUGE_VALF +#undef HUGE_VALF +#define MWRAP_LIBC_HAS_HUGE_VALF +#endif +#ifdef HUGE_VALL +#undef HUGE_VALL +#define MWRAP_LIBC_HAS_HUGE_VALL +#endif +#ifdef INFINITY +#undef INFINITY +#define MWRAP_LIBC_HAS_INFINITY +#endif +#ifdef NAN +#undef NAN +#define MWRAP_LIBC_HAS_NAN +#endif +#ifdef FP_INFINITE +#undef FP_INFINITE +#define MWRAP_LIBC_HAS_FP_INFINITE +#endif +#ifdef FP_NAN +#undef FP_NAN +#define MWRAP_LIBC_HAS_FP_NAN +#endif +#ifdef FP_NORMAL +#undef FP_NORMAL +#define MWRAP_LIBC_HAS_FP_NORMAL +#endif +#ifdef FP_SUBNORMAL +#undef FP_SUBNORMAL +#define MWRAP_LIBC_HAS_FP_SUBNORMAL +#endif +#ifdef FP_ZERO +#undef FP_ZERO +#define MWRAP_LIBC_HAS_FP_ZERO +#endif +#ifdef FP_FAST_FMA +#undef FP_FAST_FMA +#define MWRAP_LIBC_HAS_FP_FAST_FMA +#endif +#ifdef FP_FAST_FMAF +#undef FP_FAST_FMAF +#define MWRAP_LIBC_HAS_FP_FAST_FMAF +#endif +#ifdef FP_FAST_FMAL +#undef FP_FAST_FMAL +#define MWRAP_LIBC_HAS_FP_FAST_FMAL +#endif +#ifdef FP_ILOGB0 +#undef FP_ILOGB0 +#define MWRAP_LIBC_HAS_FP_ILOGB0 +#endif +#ifdef FP_ILOGBNAN +#undef FP_ILOGBNAN +#define MWRAP_LIBC_HAS_FP_ILOGBNAN +#endif +#ifdef MATH_ERRNO +#undef MATH_ERRNO +#define MWRAP_LIBC_HAS_MATH_ERRNO +#endif +#ifdef MATH_ERREXCEPT +#undef MATH_ERREXCEPT +#define MWRAP_LIBC_HAS_MATH_ERREXCEPT +#endif +#ifdef math_errhandling +#undef math_errhandling +#define MWRAP_LIBC_HAS_math_errhandling +#endif +#ifdef SIG_DFL +#undef SIG_DFL +#define MWRAP_LIBC_HAS_SIG_DFL +#endif +#ifdef SIG_ERR +#undef SIG_ERR +#define MWRAP_LIBC_HAS_SIG_ERR +#endif +#ifdef SIG_IGN +#undef SIG_IGN +#define MWRAP_LIBC_HAS_SIG_IGN +#endif +#ifdef SIGABRT +#undef SIGABRT +#define MWRAP_LIBC_HAS_SIGABRT +#endif +#ifdef SIGFPE +#undef SIGFPE +#define MWRAP_LIBC_HAS_SIGFPE +#endif +#ifdef SIGILL +#undef SIGILL +#define MWRAP_LIBC_HAS_SIGILL +#endif +#ifdef SIGINT +#undef SIGINT +#define MWRAP_LIBC_HAS_SIGINT +#endif +#ifdef SIGSEGV +#undef SIGSEGV +#define MWRAP_LIBC_HAS_SIGSEGV +#endif +#ifdef SIGTERM +#undef SIGTERM +#define MWRAP_LIBC_HAS_SIGTERM +#endif +#ifdef INT8_MIN +#undef INT8_MIN +#define MWRAP_LIBC_HAS_INT8_MIN +#endif +#ifdef INT8_MAX +#undef INT8_MAX +#define MWRAP_LIBC_HAS_INT8_MAX +#endif +#ifdef UINT8_MAX +#undef UINT8_MAX +#define MWRAP_LIBC_HAS_UINT8_MAX +#endif +#ifdef INT_LEAST8_MIN +#undef INT_LEAST8_MIN +#define MWRAP_LIBC_HAS_INT_LEAST8_MIN +#endif +#ifdef INT_LEAST8_MAX +#undef INT_LEAST8_MAX +#define MWRAP_LIBC_HAS_INT_LEAST8_MAX +#endif +#ifdef UINT_LEAST8_MAX +#undef UINT_LEAST8_MAX +#define MWRAP_LIBC_HAS_UINT_LEAST8_MAX +#endif +#ifdef INT_FAST8_MIN +#undef INT_FAST8_MIN +#define MWRAP_LIBC_HAS_INT_FAST8_MIN +#endif +#ifdef INT_FAST8_MAX +#undef INT_FAST8_MAX +#define MWRAP_LIBC_HAS_INT_FAST8_MAX +#endif +#ifdef UINT_FAST8_MAX +#undef UINT_FAST8_MAX +#define MWRAP_LIBC_HAS_UINT_FAST8_MAX +#endif +#ifdef INT16_MIN +#undef INT16_MIN +#define MWRAP_LIBC_HAS_INT16_MIN +#endif +#ifdef INT16_MAX +#undef INT16_MAX +#define MWRAP_LIBC_HAS_INT16_MAX +#endif +#ifdef UINT16_MAX +#undef UINT16_MAX +#define MWRAP_LIBC_HAS_UINT16_MAX +#endif +#ifdef INT_LEAST16_MIN +#undef INT_LEAST16_MIN +#define MWRAP_LIBC_HAS_INT_LEAST16_MIN +#endif +#ifdef INT_LEAST16_MAX +#undef INT_LEAST16_MAX +#define MWRAP_LIBC_HAS_INT_LEAST16_MAX +#endif +#ifdef UINT_LEAST16_MAX +#undef UINT_LEAST16_MAX +#define MWRAP_LIBC_HAS_UINT_LEAST16_MAX +#endif +#ifdef INT_FAST16_MIN +#undef INT_FAST16_MIN +#define MWRAP_LIBC_HAS_INT_FAST16_MIN +#endif +#ifdef INT_FAST16_MAX +#undef INT_FAST16_MAX +#define MWRAP_LIBC_HAS_INT_FAST16_MAX +#endif +#ifdef UINT_FAST16_MAX +#undef UINT_FAST16_MAX +#define MWRAP_LIBC_HAS_UINT_FAST16_MAX +#endif +#ifdef INT32_MIN +#undef INT32_MIN +#define MWRAP_LIBC_HAS_INT32_MIN +#endif +#ifdef INT32_MAX +#undef INT32_MAX +#define MWRAP_LIBC_HAS_INT32_MAX +#endif +#ifdef UINT32_MAX +#undef UINT32_MAX +#define MWRAP_LIBC_HAS_UINT32_MAX +#endif +#ifdef INT_LEAST32_MIN +#undef INT_LEAST32_MIN +#define MWRAP_LIBC_HAS_INT_LEAST32_MIN +#endif +#ifdef INT_LEAST32_MAX +#undef INT_LEAST32_MAX +#define MWRAP_LIBC_HAS_INT_LEAST32_MAX +#endif +#ifdef UINT_LEAST32_MAX +#undef UINT_LEAST32_MAX +#define MWRAP_LIBC_HAS_UINT_LEAST32_MAX +#endif +#ifdef INT_FAST32_MIN +#undef INT_FAST32_MIN +#define MWRAP_LIBC_HAS_INT_FAST32_MIN +#endif +#ifdef INT_FAST32_MAX +#undef INT_FAST32_MAX +#define MWRAP_LIBC_HAS_INT_FAST32_MAX +#endif +#ifdef UINT_FAST32_MAX +#undef UINT_FAST32_MAX +#define MWRAP_LIBC_HAS_UINT_FAST32_MAX +#endif +#ifdef INT64_MIN +#undef INT64_MIN +#define MWRAP_LIBC_HAS_INT64_MIN +#endif +#ifdef INT64_MAX +#undef INT64_MAX +#define MWRAP_LIBC_HAS_INT64_MAX +#endif +#ifdef UINT64_MAX +#undef UINT64_MAX +#define MWRAP_LIBC_HAS_UINT64_MAX +#endif +#ifdef INT_LEAST64_MIN +#undef INT_LEAST64_MIN +#define MWRAP_LIBC_HAS_INT_LEAST64_MIN +#endif +#ifdef INT_LEAST64_MAX +#undef INT_LEAST64_MAX +#define MWRAP_LIBC_HAS_INT_LEAST64_MAX +#endif +#ifdef UINT_LEAST64_MAX +#undef UINT_LEAST64_MAX +#define MWRAP_LIBC_HAS_UINT_LEAST64_MAX +#endif +#ifdef INT_FAST64_MIN +#undef INT_FAST64_MIN +#define MWRAP_LIBC_HAS_INT_FAST64_MIN +#endif +#ifdef INT_FAST64_MAX +#undef INT_FAST64_MAX +#define MWRAP_LIBC_HAS_INT_FAST64_MAX +#endif +#ifdef UINT_FAST64_MAX +#undef UINT_FAST64_MAX +#define MWRAP_LIBC_HAS_UINT_FAST64_MAX +#endif +#ifdef INTPTR_MIN +#undef INTPTR_MIN +#define MWRAP_LIBC_HAS_INTPTR_MIN +#endif +#ifdef INTPTR_MAX +#undef INTPTR_MAX +#define MWRAP_LIBC_HAS_INTPTR_MAX +#endif +#ifdef UINTPTR_MAX +#undef UINTPTR_MAX +#define MWRAP_LIBC_HAS_UINTPTR_MAX +#endif +#ifdef INTMAX_MIN +#undef INTMAX_MIN +#define MWRAP_LIBC_HAS_INTMAX_MIN +#endif +#ifdef INTMAX_MAX +#undef INTMAX_MAX +#define MWRAP_LIBC_HAS_INTMAX_MAX +#endif +#ifdef UINTMAX_MAX +#undef UINTMAX_MAX +#define MWRAP_LIBC_HAS_UINTMAX_MAX +#endif +#ifdef PTRDIFF_MIN +#undef PTRDIFF_MIN +#define MWRAP_LIBC_HAS_PTRDIFF_MIN +#endif +#ifdef PTRDIFF_MAX +#undef PTRDIFF_MAX +#define MWRAP_LIBC_HAS_PTRDIFF_MAX +#endif +#ifdef SIG_ATOMIC_MIN +#undef SIG_ATOMIC_MIN +#define MWRAP_LIBC_HAS_SIG_ATOMIC_MIN +#endif +#ifdef SIG_ATOMIC_MAX +#undef SIG_ATOMIC_MAX +#define MWRAP_LIBC_HAS_SIG_ATOMIC_MAX +#endif +#ifdef SIZE_MAX +#undef SIZE_MAX +#define MWRAP_LIBC_HAS_SIZE_MAX +#endif +#ifdef WCHAR_MIN +#undef WCHAR_MIN +#define MWRAP_LIBC_HAS_WCHAR_MIN +#endif +#ifdef WCHAR_MAX +#undef WCHAR_MAX +#define MWRAP_LIBC_HAS_WCHAR_MAX +#endif +#ifdef WINT_MIN +#undef WINT_MIN +#define MWRAP_LIBC_HAS_WINT_MIN +#endif +#ifdef WINT_MAX +#undef WINT_MAX +#define MWRAP_LIBC_HAS_WINT_MAX +#endif +#ifdef _IOFBF +#undef _IOFBF +#define MWRAP_LIBC_HAS__IOFBF +#endif +#ifdef _IOLBF +#undef _IOLBF +#define MWRAP_LIBC_HAS__IOLBF +#endif +#ifdef _IONBF +#undef _IONBF +#define MWRAP_LIBC_HAS__IONBF +#endif +#ifdef BUFSIZ +#undef BUFSIZ +#define MWRAP_LIBC_HAS_BUFSIZ +#endif +#ifdef EOF +#undef EOF +#define MWRAP_LIBC_HAS_EOF +#endif +#ifdef FOPEN_MAX +#undef FOPEN_MAX +#define MWRAP_LIBC_HAS_FOPEN_MAX +#endif +#ifdef FILENAME_MAX +#undef FILENAME_MAX +#define MWRAP_LIBC_HAS_FILENAME_MAX +#endif +#ifdef L_tmpnam +#undef L_tmpnam +#define MWRAP_LIBC_HAS_L_tmpnam +#endif +#ifdef SEEK_CUR +#undef SEEK_CUR +#define MWRAP_LIBC_HAS_SEEK_CUR +#endif +#ifdef SEEK_END +#undef SEEK_END +#define MWRAP_LIBC_HAS_SEEK_END +#endif +#ifdef SEEK_SET +#undef SEEK_SET +#define MWRAP_LIBC_HAS_SEEK_SET +#endif +#ifdef TMP_MAX +#undef TMP_MAX +#define MWRAP_LIBC_HAS_TMP_MAX +#endif +#ifdef stderr +#undef stderr +#define MWRAP_LIBC_HAS_stderr +#endif +#ifdef stdin +#undef stdin +#define MWRAP_LIBC_HAS_stdin +#endif +#ifdef stdout +#undef stdout +#define MWRAP_LIBC_HAS_stdout +#endif +#ifdef EXIT_FAILURE +#undef EXIT_FAILURE +#define MWRAP_LIBC_HAS_EXIT_FAILURE +#endif +#ifdef EXIT_SUCCESS +#undef EXIT_SUCCESS +#define MWRAP_LIBC_HAS_EXIT_SUCCESS +#endif +#ifdef RAND_MAX +#undef RAND_MAX +#define MWRAP_LIBC_HAS_RAND_MAX +#endif +#ifdef MB_CUR_MAX +#undef MB_CUR_MAX +#define MWRAP_LIBC_HAS_MB_CUR_MAX +#endif +#ifdef CLOCKS_PER_SEC +#undef CLOCKS_PER_SEC +#define MWRAP_LIBC_HAS_CLOCKS_PER_SEC +#endif +#ifdef TIME_UTC +#undef TIME_UTC +#define MWRAP_LIBC_HAS_TIME_UTC +#endif +#ifdef WEOF +#undef WEOF +#define MWRAP_LIBC_HAS_WEOF +#endif + +import std; +import mcpplibs.mwrap.libc.macros; + +namespace m = mcpplibs::mwrap::libc::macros; + +template +bool same(A&& a, B&& b) +{ + using T = std::remove_cvref_t; + if constexpr (std::is_convertible_v) + return std::string_view(a) == std::string_view(b); + else if constexpr (std::is_floating_point_v) + return (a != a && b != b) || a == b; // NAN equals NAN here + else + return a == b; +} + +// A function form: an lvalue (errno, stdout) is the same object, a value is equal. +template +bool same_result(F mapped, G header) +{ + if constexpr (std::is_lvalue_reference_v) + return &mapped() == &header(); + else + return same(mapped(), header()); +} + +int main() +{ + int mapped = 0, differ = 0; + auto check = [&](bool ok, std::string_view name) { + ++mapped; + if (!ok) { std::println("FAIL {}", name); ++differ; } + }; +#ifdef MWRAP_LIBC_HAS_EDOM + check(same(m::EDOM, header::value_EDOM), "EDOM"); +#endif +#ifdef MWRAP_LIBC_HAS_EILSEQ + check(same(m::EILSEQ, header::value_EILSEQ), "EILSEQ"); +#endif +#ifdef MWRAP_LIBC_HAS_ERANGE + check(same(m::ERANGE, header::value_ERANGE), "ERANGE"); +#endif +#ifdef MWRAP_LIBC_HAS_errno + check(same_result([]() -> decltype(auto) { return m::errno(); }, header::get_errno), "errno"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_DIVBYZERO + check(same(m::FE_DIVBYZERO, header::value_FE_DIVBYZERO), "FE_DIVBYZERO"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_INEXACT + check(same(m::FE_INEXACT, header::value_FE_INEXACT), "FE_INEXACT"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_INVALID + check(same(m::FE_INVALID, header::value_FE_INVALID), "FE_INVALID"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_OVERFLOW + check(same(m::FE_OVERFLOW, header::value_FE_OVERFLOW), "FE_OVERFLOW"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_UNDERFLOW + check(same(m::FE_UNDERFLOW, header::value_FE_UNDERFLOW), "FE_UNDERFLOW"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_ALL_EXCEPT + check(same(m::FE_ALL_EXCEPT, header::value_FE_ALL_EXCEPT), "FE_ALL_EXCEPT"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_DOWNWARD + check(same(m::FE_DOWNWARD, header::value_FE_DOWNWARD), "FE_DOWNWARD"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_TONEAREST + check(same(m::FE_TONEAREST, header::value_FE_TONEAREST), "FE_TONEAREST"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_TOWARDZERO + check(same(m::FE_TOWARDZERO, header::value_FE_TOWARDZERO), "FE_TOWARDZERO"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_UPWARD + check(same(m::FE_UPWARD, header::value_FE_UPWARD), "FE_UPWARD"); +#endif +#ifdef MWRAP_LIBC_HAS_FE_DFL_ENV + check(same_result([]() -> decltype(auto) { return m::FE_DFL_ENV(); }, header::get_FE_DFL_ENV), "FE_DFL_ENV"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_ROUNDS + check(same_result([]() -> decltype(auto) { return m::FLT_ROUNDS(); }, header::get_FLT_ROUNDS), "FLT_ROUNDS"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_EVAL_METHOD + check(same_result([]() -> decltype(auto) { return m::FLT_EVAL_METHOD(); }, header::get_FLT_EVAL_METHOD), "FLT_EVAL_METHOD"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_HAS_SUBNORM + check(same(m::FLT_HAS_SUBNORM, header::value_FLT_HAS_SUBNORM), "FLT_HAS_SUBNORM"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_HAS_SUBNORM + check(same(m::DBL_HAS_SUBNORM, header::value_DBL_HAS_SUBNORM), "DBL_HAS_SUBNORM"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_HAS_SUBNORM + check(same(m::LDBL_HAS_SUBNORM, header::value_LDBL_HAS_SUBNORM), "LDBL_HAS_SUBNORM"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_RADIX + check(same(m::FLT_RADIX, header::value_FLT_RADIX), "FLT_RADIX"); +#endif +#ifdef MWRAP_LIBC_HAS_DECIMAL_DIG + check(same(m::DECIMAL_DIG, header::value_DECIMAL_DIG), "DECIMAL_DIG"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MANT_DIG + check(same(m::FLT_MANT_DIG, header::value_FLT_MANT_DIG), "FLT_MANT_DIG"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MANT_DIG + check(same(m::DBL_MANT_DIG, header::value_DBL_MANT_DIG), "DBL_MANT_DIG"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MANT_DIG + check(same(m::LDBL_MANT_DIG, header::value_LDBL_MANT_DIG), "LDBL_MANT_DIG"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_DECIMAL_DIG + check(same(m::FLT_DECIMAL_DIG, header::value_FLT_DECIMAL_DIG), "FLT_DECIMAL_DIG"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_DECIMAL_DIG + check(same(m::DBL_DECIMAL_DIG, header::value_DBL_DECIMAL_DIG), "DBL_DECIMAL_DIG"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_DECIMAL_DIG + check(same(m::LDBL_DECIMAL_DIG, header::value_LDBL_DECIMAL_DIG), "LDBL_DECIMAL_DIG"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_DIG + check(same(m::FLT_DIG, header::value_FLT_DIG), "FLT_DIG"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_DIG + check(same(m::DBL_DIG, header::value_DBL_DIG), "DBL_DIG"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_DIG + check(same(m::LDBL_DIG, header::value_LDBL_DIG), "LDBL_DIG"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MIN_EXP + check(same(m::FLT_MIN_EXP, header::value_FLT_MIN_EXP), "FLT_MIN_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MIN_EXP + check(same(m::DBL_MIN_EXP, header::value_DBL_MIN_EXP), "DBL_MIN_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MIN_EXP + check(same(m::LDBL_MIN_EXP, header::value_LDBL_MIN_EXP), "LDBL_MIN_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MIN_10_EXP + check(same(m::FLT_MIN_10_EXP, header::value_FLT_MIN_10_EXP), "FLT_MIN_10_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MIN_10_EXP + check(same(m::DBL_MIN_10_EXP, header::value_DBL_MIN_10_EXP), "DBL_MIN_10_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MIN_10_EXP + check(same(m::LDBL_MIN_10_EXP, header::value_LDBL_MIN_10_EXP), "LDBL_MIN_10_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MAX_EXP + check(same(m::FLT_MAX_EXP, header::value_FLT_MAX_EXP), "FLT_MAX_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MAX_EXP + check(same(m::DBL_MAX_EXP, header::value_DBL_MAX_EXP), "DBL_MAX_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MAX_EXP + check(same(m::LDBL_MAX_EXP, header::value_LDBL_MAX_EXP), "LDBL_MAX_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MAX_10_EXP + check(same(m::FLT_MAX_10_EXP, header::value_FLT_MAX_10_EXP), "FLT_MAX_10_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MAX_10_EXP + check(same(m::DBL_MAX_10_EXP, header::value_DBL_MAX_10_EXP), "DBL_MAX_10_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MAX_10_EXP + check(same(m::LDBL_MAX_10_EXP, header::value_LDBL_MAX_10_EXP), "LDBL_MAX_10_EXP"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MAX + check(same(m::FLT_MAX, header::value_FLT_MAX), "FLT_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MAX + check(same(m::DBL_MAX, header::value_DBL_MAX), "DBL_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MAX + check(same(m::LDBL_MAX, header::value_LDBL_MAX), "LDBL_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_EPSILON + check(same(m::FLT_EPSILON, header::value_FLT_EPSILON), "FLT_EPSILON"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_EPSILON + check(same(m::DBL_EPSILON, header::value_DBL_EPSILON), "DBL_EPSILON"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_EPSILON + check(same(m::LDBL_EPSILON, header::value_LDBL_EPSILON), "LDBL_EPSILON"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_MIN + check(same(m::FLT_MIN, header::value_FLT_MIN), "FLT_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_MIN + check(same(m::DBL_MIN, header::value_DBL_MIN), "DBL_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_MIN + check(same(m::LDBL_MIN, header::value_LDBL_MIN), "LDBL_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_FLT_TRUE_MIN + check(same(m::FLT_TRUE_MIN, header::value_FLT_TRUE_MIN), "FLT_TRUE_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_DBL_TRUE_MIN + check(same(m::DBL_TRUE_MIN, header::value_DBL_TRUE_MIN), "DBL_TRUE_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_LDBL_TRUE_MIN + check(same(m::LDBL_TRUE_MIN, header::value_LDBL_TRUE_MIN), "LDBL_TRUE_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_PRId8 + check(same(m::PRId8, header::value_PRId8), "PRId8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRId16 + check(same(m::PRId16, header::value_PRId16), "PRId16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRId32 + check(same(m::PRId32, header::value_PRId32), "PRId32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRId64 + check(same(m::PRId64, header::value_PRId64), "PRId64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIdLEAST8 + check(same(m::PRIdLEAST8, header::value_PRIdLEAST8), "PRIdLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIdLEAST16 + check(same(m::PRIdLEAST16, header::value_PRIdLEAST16), "PRIdLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIdLEAST32 + check(same(m::PRIdLEAST32, header::value_PRIdLEAST32), "PRIdLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIdLEAST64 + check(same(m::PRIdLEAST64, header::value_PRIdLEAST64), "PRIdLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIdFAST8 + check(same(m::PRIdFAST8, header::value_PRIdFAST8), "PRIdFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIdFAST16 + check(same(m::PRIdFAST16, header::value_PRIdFAST16), "PRIdFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIdFAST32 + check(same(m::PRIdFAST32, header::value_PRIdFAST32), "PRIdFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIdFAST64 + check(same(m::PRIdFAST64, header::value_PRIdFAST64), "PRIdFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIdMAX + check(same(m::PRIdMAX, header::value_PRIdMAX), "PRIdMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIdPTR + check(same(m::PRIdPTR, header::value_PRIdPTR), "PRIdPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIi8 + check(same(m::PRIi8, header::value_PRIi8), "PRIi8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIi16 + check(same(m::PRIi16, header::value_PRIi16), "PRIi16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIi32 + check(same(m::PRIi32, header::value_PRIi32), "PRIi32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIi64 + check(same(m::PRIi64, header::value_PRIi64), "PRIi64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIiLEAST8 + check(same(m::PRIiLEAST8, header::value_PRIiLEAST8), "PRIiLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIiLEAST16 + check(same(m::PRIiLEAST16, header::value_PRIiLEAST16), "PRIiLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIiLEAST32 + check(same(m::PRIiLEAST32, header::value_PRIiLEAST32), "PRIiLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIiLEAST64 + check(same(m::PRIiLEAST64, header::value_PRIiLEAST64), "PRIiLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIiFAST8 + check(same(m::PRIiFAST8, header::value_PRIiFAST8), "PRIiFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIiFAST16 + check(same(m::PRIiFAST16, header::value_PRIiFAST16), "PRIiFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIiFAST32 + check(same(m::PRIiFAST32, header::value_PRIiFAST32), "PRIiFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIiFAST64 + check(same(m::PRIiFAST64, header::value_PRIiFAST64), "PRIiFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIiMAX + check(same(m::PRIiMAX, header::value_PRIiMAX), "PRIiMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIiPTR + check(same(m::PRIiPTR, header::value_PRIiPTR), "PRIiPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIo8 + check(same(m::PRIo8, header::value_PRIo8), "PRIo8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIo16 + check(same(m::PRIo16, header::value_PRIo16), "PRIo16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIo32 + check(same(m::PRIo32, header::value_PRIo32), "PRIo32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIo64 + check(same(m::PRIo64, header::value_PRIo64), "PRIo64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIoLEAST8 + check(same(m::PRIoLEAST8, header::value_PRIoLEAST8), "PRIoLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIoLEAST16 + check(same(m::PRIoLEAST16, header::value_PRIoLEAST16), "PRIoLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIoLEAST32 + check(same(m::PRIoLEAST32, header::value_PRIoLEAST32), "PRIoLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIoLEAST64 + check(same(m::PRIoLEAST64, header::value_PRIoLEAST64), "PRIoLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIoFAST8 + check(same(m::PRIoFAST8, header::value_PRIoFAST8), "PRIoFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIoFAST16 + check(same(m::PRIoFAST16, header::value_PRIoFAST16), "PRIoFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIoFAST32 + check(same(m::PRIoFAST32, header::value_PRIoFAST32), "PRIoFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIoFAST64 + check(same(m::PRIoFAST64, header::value_PRIoFAST64), "PRIoFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIoMAX + check(same(m::PRIoMAX, header::value_PRIoMAX), "PRIoMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIoPTR + check(same(m::PRIoPTR, header::value_PRIoPTR), "PRIoPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIu8 + check(same(m::PRIu8, header::value_PRIu8), "PRIu8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIu16 + check(same(m::PRIu16, header::value_PRIu16), "PRIu16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIu32 + check(same(m::PRIu32, header::value_PRIu32), "PRIu32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIu64 + check(same(m::PRIu64, header::value_PRIu64), "PRIu64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIuLEAST8 + check(same(m::PRIuLEAST8, header::value_PRIuLEAST8), "PRIuLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIuLEAST16 + check(same(m::PRIuLEAST16, header::value_PRIuLEAST16), "PRIuLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIuLEAST32 + check(same(m::PRIuLEAST32, header::value_PRIuLEAST32), "PRIuLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIuLEAST64 + check(same(m::PRIuLEAST64, header::value_PRIuLEAST64), "PRIuLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIuFAST8 + check(same(m::PRIuFAST8, header::value_PRIuFAST8), "PRIuFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIuFAST16 + check(same(m::PRIuFAST16, header::value_PRIuFAST16), "PRIuFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIuFAST32 + check(same(m::PRIuFAST32, header::value_PRIuFAST32), "PRIuFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIuFAST64 + check(same(m::PRIuFAST64, header::value_PRIuFAST64), "PRIuFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIuMAX + check(same(m::PRIuMAX, header::value_PRIuMAX), "PRIuMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIuPTR + check(same(m::PRIuPTR, header::value_PRIuPTR), "PRIuPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIx8 + check(same(m::PRIx8, header::value_PRIx8), "PRIx8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIx16 + check(same(m::PRIx16, header::value_PRIx16), "PRIx16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIx32 + check(same(m::PRIx32, header::value_PRIx32), "PRIx32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIx64 + check(same(m::PRIx64, header::value_PRIx64), "PRIx64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIxLEAST8 + check(same(m::PRIxLEAST8, header::value_PRIxLEAST8), "PRIxLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIxLEAST16 + check(same(m::PRIxLEAST16, header::value_PRIxLEAST16), "PRIxLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIxLEAST32 + check(same(m::PRIxLEAST32, header::value_PRIxLEAST32), "PRIxLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIxLEAST64 + check(same(m::PRIxLEAST64, header::value_PRIxLEAST64), "PRIxLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIxFAST8 + check(same(m::PRIxFAST8, header::value_PRIxFAST8), "PRIxFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIxFAST16 + check(same(m::PRIxFAST16, header::value_PRIxFAST16), "PRIxFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIxFAST32 + check(same(m::PRIxFAST32, header::value_PRIxFAST32), "PRIxFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIxFAST64 + check(same(m::PRIxFAST64, header::value_PRIxFAST64), "PRIxFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIxMAX + check(same(m::PRIxMAX, header::value_PRIxMAX), "PRIxMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIxPTR + check(same(m::PRIxPTR, header::value_PRIxPTR), "PRIxPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIX8 + check(same(m::PRIX8, header::value_PRIX8), "PRIX8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIX16 + check(same(m::PRIX16, header::value_PRIX16), "PRIX16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIX32 + check(same(m::PRIX32, header::value_PRIX32), "PRIX32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIX64 + check(same(m::PRIX64, header::value_PRIX64), "PRIX64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIXLEAST8 + check(same(m::PRIXLEAST8, header::value_PRIXLEAST8), "PRIXLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIXLEAST16 + check(same(m::PRIXLEAST16, header::value_PRIXLEAST16), "PRIXLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIXLEAST32 + check(same(m::PRIXLEAST32, header::value_PRIXLEAST32), "PRIXLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIXLEAST64 + check(same(m::PRIXLEAST64, header::value_PRIXLEAST64), "PRIXLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIXFAST8 + check(same(m::PRIXFAST8, header::value_PRIXFAST8), "PRIXFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIXFAST16 + check(same(m::PRIXFAST16, header::value_PRIXFAST16), "PRIXFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIXFAST32 + check(same(m::PRIXFAST32, header::value_PRIXFAST32), "PRIXFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIXFAST64 + check(same(m::PRIXFAST64, header::value_PRIXFAST64), "PRIXFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIXMAX + check(same(m::PRIXMAX, header::value_PRIXMAX), "PRIXMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_PRIXPTR + check(same(m::PRIXPTR, header::value_PRIXPTR), "PRIXPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNd8 + check(same(m::SCNd8, header::value_SCNd8), "SCNd8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNd16 + check(same(m::SCNd16, header::value_SCNd16), "SCNd16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNd32 + check(same(m::SCNd32, header::value_SCNd32), "SCNd32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNd64 + check(same(m::SCNd64, header::value_SCNd64), "SCNd64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNdLEAST8 + check(same(m::SCNdLEAST8, header::value_SCNdLEAST8), "SCNdLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNdLEAST16 + check(same(m::SCNdLEAST16, header::value_SCNdLEAST16), "SCNdLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNdLEAST32 + check(same(m::SCNdLEAST32, header::value_SCNdLEAST32), "SCNdLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNdLEAST64 + check(same(m::SCNdLEAST64, header::value_SCNdLEAST64), "SCNdLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNdFAST8 + check(same(m::SCNdFAST8, header::value_SCNdFAST8), "SCNdFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNdFAST16 + check(same(m::SCNdFAST16, header::value_SCNdFAST16), "SCNdFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNdFAST32 + check(same(m::SCNdFAST32, header::value_SCNdFAST32), "SCNdFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNdFAST64 + check(same(m::SCNdFAST64, header::value_SCNdFAST64), "SCNdFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNdMAX + check(same(m::SCNdMAX, header::value_SCNdMAX), "SCNdMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNdPTR + check(same(m::SCNdPTR, header::value_SCNdPTR), "SCNdPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNi8 + check(same(m::SCNi8, header::value_SCNi8), "SCNi8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNi16 + check(same(m::SCNi16, header::value_SCNi16), "SCNi16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNi32 + check(same(m::SCNi32, header::value_SCNi32), "SCNi32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNi64 + check(same(m::SCNi64, header::value_SCNi64), "SCNi64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNiLEAST8 + check(same(m::SCNiLEAST8, header::value_SCNiLEAST8), "SCNiLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNiLEAST16 + check(same(m::SCNiLEAST16, header::value_SCNiLEAST16), "SCNiLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNiLEAST32 + check(same(m::SCNiLEAST32, header::value_SCNiLEAST32), "SCNiLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNiLEAST64 + check(same(m::SCNiLEAST64, header::value_SCNiLEAST64), "SCNiLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNiFAST8 + check(same(m::SCNiFAST8, header::value_SCNiFAST8), "SCNiFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNiFAST16 + check(same(m::SCNiFAST16, header::value_SCNiFAST16), "SCNiFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNiFAST32 + check(same(m::SCNiFAST32, header::value_SCNiFAST32), "SCNiFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNiFAST64 + check(same(m::SCNiFAST64, header::value_SCNiFAST64), "SCNiFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNiMAX + check(same(m::SCNiMAX, header::value_SCNiMAX), "SCNiMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNiPTR + check(same(m::SCNiPTR, header::value_SCNiPTR), "SCNiPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNo8 + check(same(m::SCNo8, header::value_SCNo8), "SCNo8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNo16 + check(same(m::SCNo16, header::value_SCNo16), "SCNo16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNo32 + check(same(m::SCNo32, header::value_SCNo32), "SCNo32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNo64 + check(same(m::SCNo64, header::value_SCNo64), "SCNo64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNoLEAST8 + check(same(m::SCNoLEAST8, header::value_SCNoLEAST8), "SCNoLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNoLEAST16 + check(same(m::SCNoLEAST16, header::value_SCNoLEAST16), "SCNoLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNoLEAST32 + check(same(m::SCNoLEAST32, header::value_SCNoLEAST32), "SCNoLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNoLEAST64 + check(same(m::SCNoLEAST64, header::value_SCNoLEAST64), "SCNoLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNoFAST8 + check(same(m::SCNoFAST8, header::value_SCNoFAST8), "SCNoFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNoFAST16 + check(same(m::SCNoFAST16, header::value_SCNoFAST16), "SCNoFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNoFAST32 + check(same(m::SCNoFAST32, header::value_SCNoFAST32), "SCNoFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNoFAST64 + check(same(m::SCNoFAST64, header::value_SCNoFAST64), "SCNoFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNoMAX + check(same(m::SCNoMAX, header::value_SCNoMAX), "SCNoMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNoPTR + check(same(m::SCNoPTR, header::value_SCNoPTR), "SCNoPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNu8 + check(same(m::SCNu8, header::value_SCNu8), "SCNu8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNu16 + check(same(m::SCNu16, header::value_SCNu16), "SCNu16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNu32 + check(same(m::SCNu32, header::value_SCNu32), "SCNu32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNu64 + check(same(m::SCNu64, header::value_SCNu64), "SCNu64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNuLEAST8 + check(same(m::SCNuLEAST8, header::value_SCNuLEAST8), "SCNuLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNuLEAST16 + check(same(m::SCNuLEAST16, header::value_SCNuLEAST16), "SCNuLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNuLEAST32 + check(same(m::SCNuLEAST32, header::value_SCNuLEAST32), "SCNuLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNuLEAST64 + check(same(m::SCNuLEAST64, header::value_SCNuLEAST64), "SCNuLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNuFAST8 + check(same(m::SCNuFAST8, header::value_SCNuFAST8), "SCNuFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNuFAST16 + check(same(m::SCNuFAST16, header::value_SCNuFAST16), "SCNuFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNuFAST32 + check(same(m::SCNuFAST32, header::value_SCNuFAST32), "SCNuFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNuFAST64 + check(same(m::SCNuFAST64, header::value_SCNuFAST64), "SCNuFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNuMAX + check(same(m::SCNuMAX, header::value_SCNuMAX), "SCNuMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNuPTR + check(same(m::SCNuPTR, header::value_SCNuPTR), "SCNuPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNx8 + check(same(m::SCNx8, header::value_SCNx8), "SCNx8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNx16 + check(same(m::SCNx16, header::value_SCNx16), "SCNx16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNx32 + check(same(m::SCNx32, header::value_SCNx32), "SCNx32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNx64 + check(same(m::SCNx64, header::value_SCNx64), "SCNx64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNxLEAST8 + check(same(m::SCNxLEAST8, header::value_SCNxLEAST8), "SCNxLEAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNxLEAST16 + check(same(m::SCNxLEAST16, header::value_SCNxLEAST16), "SCNxLEAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNxLEAST32 + check(same(m::SCNxLEAST32, header::value_SCNxLEAST32), "SCNxLEAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNxLEAST64 + check(same(m::SCNxLEAST64, header::value_SCNxLEAST64), "SCNxLEAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNxFAST8 + check(same(m::SCNxFAST8, header::value_SCNxFAST8), "SCNxFAST8"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNxFAST16 + check(same(m::SCNxFAST16, header::value_SCNxFAST16), "SCNxFAST16"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNxFAST32 + check(same(m::SCNxFAST32, header::value_SCNxFAST32), "SCNxFAST32"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNxFAST64 + check(same(m::SCNxFAST64, header::value_SCNxFAST64), "SCNxFAST64"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNxMAX + check(same(m::SCNxMAX, header::value_SCNxMAX), "SCNxMAX"); +#endif +#ifdef MWRAP_LIBC_HAS_SCNxPTR + check(same(m::SCNxPTR, header::value_SCNxPTR), "SCNxPTR"); +#endif +#ifdef MWRAP_LIBC_HAS_CHAR_BIT + check(same(m::CHAR_BIT, header::value_CHAR_BIT), "CHAR_BIT"); +#endif +#ifdef MWRAP_LIBC_HAS_SCHAR_MIN + check(same(m::SCHAR_MIN, header::value_SCHAR_MIN), "SCHAR_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_SCHAR_MAX + check(same(m::SCHAR_MAX, header::value_SCHAR_MAX), "SCHAR_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UCHAR_MAX + check(same(m::UCHAR_MAX, header::value_UCHAR_MAX), "UCHAR_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_CHAR_MIN + check(same(m::CHAR_MIN, header::value_CHAR_MIN), "CHAR_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_CHAR_MAX + check(same(m::CHAR_MAX, header::value_CHAR_MAX), "CHAR_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_MB_LEN_MAX + check(same(m::MB_LEN_MAX, header::value_MB_LEN_MAX), "MB_LEN_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_SHRT_MIN + check(same(m::SHRT_MIN, header::value_SHRT_MIN), "SHRT_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_SHRT_MAX + check(same(m::SHRT_MAX, header::value_SHRT_MAX), "SHRT_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_USHRT_MAX + check(same(m::USHRT_MAX, header::value_USHRT_MAX), "USHRT_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_MIN + check(same(m::INT_MIN, header::value_INT_MIN), "INT_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_MAX + check(same(m::INT_MAX, header::value_INT_MAX), "INT_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT_MAX + check(same(m::UINT_MAX, header::value_UINT_MAX), "UINT_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_LONG_MIN + check(same(m::LONG_MIN, header::value_LONG_MIN), "LONG_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_LONG_MAX + check(same(m::LONG_MAX, header::value_LONG_MAX), "LONG_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_ULONG_MAX + check(same(m::ULONG_MAX, header::value_ULONG_MAX), "ULONG_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_LLONG_MIN + check(same(m::LLONG_MIN, header::value_LLONG_MIN), "LLONG_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_LLONG_MAX + check(same(m::LLONG_MAX, header::value_LLONG_MAX), "LLONG_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_ULLONG_MAX + check(same(m::ULLONG_MAX, header::value_ULLONG_MAX), "ULLONG_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_LC_ALL + check(same(m::LC_ALL, header::value_LC_ALL), "LC_ALL"); +#endif +#ifdef MWRAP_LIBC_HAS_LC_COLLATE + check(same(m::LC_COLLATE, header::value_LC_COLLATE), "LC_COLLATE"); +#endif +#ifdef MWRAP_LIBC_HAS_LC_CTYPE + check(same(m::LC_CTYPE, header::value_LC_CTYPE), "LC_CTYPE"); +#endif +#ifdef MWRAP_LIBC_HAS_LC_MONETARY + check(same(m::LC_MONETARY, header::value_LC_MONETARY), "LC_MONETARY"); +#endif +#ifdef MWRAP_LIBC_HAS_LC_NUMERIC + check(same(m::LC_NUMERIC, header::value_LC_NUMERIC), "LC_NUMERIC"); +#endif +#ifdef MWRAP_LIBC_HAS_LC_TIME + check(same(m::LC_TIME, header::value_LC_TIME), "LC_TIME"); +#endif +#ifdef MWRAP_LIBC_HAS_HUGE_VAL + check(same_result([]() -> decltype(auto) { return m::HUGE_VAL(); }, header::get_HUGE_VAL), "HUGE_VAL"); +#endif +#ifdef MWRAP_LIBC_HAS_HUGE_VALF + check(same_result([]() -> decltype(auto) { return m::HUGE_VALF(); }, header::get_HUGE_VALF), "HUGE_VALF"); +#endif +#ifdef MWRAP_LIBC_HAS_HUGE_VALL + check(same_result([]() -> decltype(auto) { return m::HUGE_VALL(); }, header::get_HUGE_VALL), "HUGE_VALL"); +#endif +#ifdef MWRAP_LIBC_HAS_INFINITY + check(same_result([]() -> decltype(auto) { return m::INFINITY(); }, header::get_INFINITY), "INFINITY"); +#endif +#ifdef MWRAP_LIBC_HAS_NAN + check(same_result([]() -> decltype(auto) { return m::NAN(); }, header::get_NAN), "NAN"); +#endif +#ifdef MWRAP_LIBC_HAS_FP_INFINITE + check(same(m::FP_INFINITE, header::value_FP_INFINITE), "FP_INFINITE"); +#endif +#ifdef MWRAP_LIBC_HAS_FP_NAN + check(same(m::FP_NAN, header::value_FP_NAN), "FP_NAN"); +#endif +#ifdef MWRAP_LIBC_HAS_FP_NORMAL + check(same(m::FP_NORMAL, header::value_FP_NORMAL), "FP_NORMAL"); +#endif +#ifdef MWRAP_LIBC_HAS_FP_SUBNORMAL + check(same(m::FP_SUBNORMAL, header::value_FP_SUBNORMAL), "FP_SUBNORMAL"); +#endif +#ifdef MWRAP_LIBC_HAS_FP_ZERO + check(same(m::FP_ZERO, header::value_FP_ZERO), "FP_ZERO"); +#endif +#ifdef MWRAP_LIBC_HAS_FP_FAST_FMA + check(same_result([]() -> decltype(auto) { return m::FP_FAST_FMA(); }, header::get_FP_FAST_FMA), "FP_FAST_FMA"); +#endif +#ifdef MWRAP_LIBC_HAS_FP_FAST_FMAF + check(same_result([]() -> decltype(auto) { return m::FP_FAST_FMAF(); }, header::get_FP_FAST_FMAF), "FP_FAST_FMAF"); +#endif +#ifdef MWRAP_LIBC_HAS_FP_FAST_FMAL + check(same_result([]() -> decltype(auto) { return m::FP_FAST_FMAL(); }, header::get_FP_FAST_FMAL), "FP_FAST_FMAL"); +#endif +#ifdef MWRAP_LIBC_HAS_FP_ILOGB0 + check(same(m::FP_ILOGB0, header::value_FP_ILOGB0), "FP_ILOGB0"); +#endif +#ifdef MWRAP_LIBC_HAS_FP_ILOGBNAN + check(same(m::FP_ILOGBNAN, header::value_FP_ILOGBNAN), "FP_ILOGBNAN"); +#endif +#ifdef MWRAP_LIBC_HAS_MATH_ERRNO + check(same(m::MATH_ERRNO, header::value_MATH_ERRNO), "MATH_ERRNO"); +#endif +#ifdef MWRAP_LIBC_HAS_MATH_ERREXCEPT + check(same(m::MATH_ERREXCEPT, header::value_MATH_ERREXCEPT), "MATH_ERREXCEPT"); +#endif +#ifdef MWRAP_LIBC_HAS_math_errhandling + check(same_result([]() -> decltype(auto) { return m::math_errhandling(); }, header::get_math_errhandling), "math_errhandling"); +#endif +#ifdef MWRAP_LIBC_HAS_SIG_DFL + check(same(m::SIG_DFL, header::value_SIG_DFL), "SIG_DFL"); +#endif +#ifdef MWRAP_LIBC_HAS_SIG_ERR + check(same_result([]() -> decltype(auto) { return m::SIG_ERR(); }, header::get_SIG_ERR), "SIG_ERR"); +#endif +#ifdef MWRAP_LIBC_HAS_SIG_IGN + check(same_result([]() -> decltype(auto) { return m::SIG_IGN(); }, header::get_SIG_IGN), "SIG_IGN"); +#endif +#ifdef MWRAP_LIBC_HAS_SIGABRT + check(same(m::SIGABRT, header::value_SIGABRT), "SIGABRT"); +#endif +#ifdef MWRAP_LIBC_HAS_SIGFPE + check(same(m::SIGFPE, header::value_SIGFPE), "SIGFPE"); +#endif +#ifdef MWRAP_LIBC_HAS_SIGILL + check(same(m::SIGILL, header::value_SIGILL), "SIGILL"); +#endif +#ifdef MWRAP_LIBC_HAS_SIGINT + check(same(m::SIGINT, header::value_SIGINT), "SIGINT"); +#endif +#ifdef MWRAP_LIBC_HAS_SIGSEGV + check(same(m::SIGSEGV, header::value_SIGSEGV), "SIGSEGV"); +#endif +#ifdef MWRAP_LIBC_HAS_SIGTERM + check(same(m::SIGTERM, header::value_SIGTERM), "SIGTERM"); +#endif +#ifdef MWRAP_LIBC_HAS_INT8_MIN + check(same(m::INT8_MIN, header::value_INT8_MIN), "INT8_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT8_MAX + check(same(m::INT8_MAX, header::value_INT8_MAX), "INT8_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT8_MAX + check(same(m::UINT8_MAX, header::value_UINT8_MAX), "UINT8_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST8_MIN + check(same(m::INT_LEAST8_MIN, header::value_INT_LEAST8_MIN), "INT_LEAST8_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST8_MAX + check(same(m::INT_LEAST8_MAX, header::value_INT_LEAST8_MAX), "INT_LEAST8_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT_LEAST8_MAX + check(same(m::UINT_LEAST8_MAX, header::value_UINT_LEAST8_MAX), "UINT_LEAST8_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST8_MIN + check(same(m::INT_FAST8_MIN, header::value_INT_FAST8_MIN), "INT_FAST8_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST8_MAX + check(same(m::INT_FAST8_MAX, header::value_INT_FAST8_MAX), "INT_FAST8_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT_FAST8_MAX + check(same(m::UINT_FAST8_MAX, header::value_UINT_FAST8_MAX), "UINT_FAST8_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT16_MIN + check(same(m::INT16_MIN, header::value_INT16_MIN), "INT16_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT16_MAX + check(same(m::INT16_MAX, header::value_INT16_MAX), "INT16_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT16_MAX + check(same(m::UINT16_MAX, header::value_UINT16_MAX), "UINT16_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST16_MIN + check(same(m::INT_LEAST16_MIN, header::value_INT_LEAST16_MIN), "INT_LEAST16_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST16_MAX + check(same(m::INT_LEAST16_MAX, header::value_INT_LEAST16_MAX), "INT_LEAST16_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT_LEAST16_MAX + check(same(m::UINT_LEAST16_MAX, header::value_UINT_LEAST16_MAX), "UINT_LEAST16_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST16_MIN + check(same(m::INT_FAST16_MIN, header::value_INT_FAST16_MIN), "INT_FAST16_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST16_MAX + check(same(m::INT_FAST16_MAX, header::value_INT_FAST16_MAX), "INT_FAST16_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT_FAST16_MAX + check(same(m::UINT_FAST16_MAX, header::value_UINT_FAST16_MAX), "UINT_FAST16_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT32_MIN + check(same(m::INT32_MIN, header::value_INT32_MIN), "INT32_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT32_MAX + check(same(m::INT32_MAX, header::value_INT32_MAX), "INT32_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT32_MAX + check(same(m::UINT32_MAX, header::value_UINT32_MAX), "UINT32_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST32_MIN + check(same(m::INT_LEAST32_MIN, header::value_INT_LEAST32_MIN), "INT_LEAST32_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST32_MAX + check(same(m::INT_LEAST32_MAX, header::value_INT_LEAST32_MAX), "INT_LEAST32_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT_LEAST32_MAX + check(same(m::UINT_LEAST32_MAX, header::value_UINT_LEAST32_MAX), "UINT_LEAST32_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST32_MIN + check(same(m::INT_FAST32_MIN, header::value_INT_FAST32_MIN), "INT_FAST32_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST32_MAX + check(same(m::INT_FAST32_MAX, header::value_INT_FAST32_MAX), "INT_FAST32_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT_FAST32_MAX + check(same(m::UINT_FAST32_MAX, header::value_UINT_FAST32_MAX), "UINT_FAST32_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT64_MIN + check(same(m::INT64_MIN, header::value_INT64_MIN), "INT64_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT64_MAX + check(same(m::INT64_MAX, header::value_INT64_MAX), "INT64_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT64_MAX + check(same(m::UINT64_MAX, header::value_UINT64_MAX), "UINT64_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST64_MIN + check(same(m::INT_LEAST64_MIN, header::value_INT_LEAST64_MIN), "INT_LEAST64_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_LEAST64_MAX + check(same(m::INT_LEAST64_MAX, header::value_INT_LEAST64_MAX), "INT_LEAST64_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT_LEAST64_MAX + check(same(m::UINT_LEAST64_MAX, header::value_UINT_LEAST64_MAX), "UINT_LEAST64_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST64_MIN + check(same(m::INT_FAST64_MIN, header::value_INT_FAST64_MIN), "INT_FAST64_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INT_FAST64_MAX + check(same(m::INT_FAST64_MAX, header::value_INT_FAST64_MAX), "INT_FAST64_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINT_FAST64_MAX + check(same(m::UINT_FAST64_MAX, header::value_UINT_FAST64_MAX), "UINT_FAST64_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INTPTR_MIN + check(same(m::INTPTR_MIN, header::value_INTPTR_MIN), "INTPTR_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INTPTR_MAX + check(same(m::INTPTR_MAX, header::value_INTPTR_MAX), "INTPTR_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINTPTR_MAX + check(same(m::UINTPTR_MAX, header::value_UINTPTR_MAX), "UINTPTR_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_INTMAX_MIN + check(same(m::INTMAX_MIN, header::value_INTMAX_MIN), "INTMAX_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_INTMAX_MAX + check(same(m::INTMAX_MAX, header::value_INTMAX_MAX), "INTMAX_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_UINTMAX_MAX + check(same(m::UINTMAX_MAX, header::value_UINTMAX_MAX), "UINTMAX_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_PTRDIFF_MIN + check(same(m::PTRDIFF_MIN, header::value_PTRDIFF_MIN), "PTRDIFF_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_PTRDIFF_MAX + check(same(m::PTRDIFF_MAX, header::value_PTRDIFF_MAX), "PTRDIFF_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_SIG_ATOMIC_MIN + check(same(m::SIG_ATOMIC_MIN, header::value_SIG_ATOMIC_MIN), "SIG_ATOMIC_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_SIG_ATOMIC_MAX + check(same(m::SIG_ATOMIC_MAX, header::value_SIG_ATOMIC_MAX), "SIG_ATOMIC_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_SIZE_MAX + check(same(m::SIZE_MAX, header::value_SIZE_MAX), "SIZE_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_WCHAR_MIN + check(same(m::WCHAR_MIN, header::value_WCHAR_MIN), "WCHAR_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_WCHAR_MAX + check(same(m::WCHAR_MAX, header::value_WCHAR_MAX), "WCHAR_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_WINT_MIN + check(same(m::WINT_MIN, header::value_WINT_MIN), "WINT_MIN"); +#endif +#ifdef MWRAP_LIBC_HAS_WINT_MAX + check(same(m::WINT_MAX, header::value_WINT_MAX), "WINT_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS__IOFBF + check(same(m::_IOFBF, header::value__IOFBF), "_IOFBF"); +#endif +#ifdef MWRAP_LIBC_HAS__IOLBF + check(same(m::_IOLBF, header::value__IOLBF), "_IOLBF"); +#endif +#ifdef MWRAP_LIBC_HAS__IONBF + check(same(m::_IONBF, header::value__IONBF), "_IONBF"); +#endif +#ifdef MWRAP_LIBC_HAS_BUFSIZ + check(same(m::BUFSIZ, header::value_BUFSIZ), "BUFSIZ"); +#endif +#ifdef MWRAP_LIBC_HAS_EOF + check(same(m::EOF, header::value_EOF), "EOF"); +#endif +#ifdef MWRAP_LIBC_HAS_FOPEN_MAX + check(same(m::FOPEN_MAX, header::value_FOPEN_MAX), "FOPEN_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_FILENAME_MAX + check(same(m::FILENAME_MAX, header::value_FILENAME_MAX), "FILENAME_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_L_tmpnam + check(same(m::L_tmpnam, header::value_L_tmpnam), "L_tmpnam"); +#endif +#ifdef MWRAP_LIBC_HAS_SEEK_CUR + check(same(m::SEEK_CUR, header::value_SEEK_CUR), "SEEK_CUR"); +#endif +#ifdef MWRAP_LIBC_HAS_SEEK_END + check(same(m::SEEK_END, header::value_SEEK_END), "SEEK_END"); +#endif +#ifdef MWRAP_LIBC_HAS_SEEK_SET + check(same(m::SEEK_SET, header::value_SEEK_SET), "SEEK_SET"); +#endif +#ifdef MWRAP_LIBC_HAS_TMP_MAX + check(same(m::TMP_MAX, header::value_TMP_MAX), "TMP_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_stderr + check(same_result([]() -> decltype(auto) { return m::stderr(); }, header::get_stderr), "stderr"); +#endif +#ifdef MWRAP_LIBC_HAS_stdin + check(same_result([]() -> decltype(auto) { return m::stdin(); }, header::get_stdin), "stdin"); +#endif +#ifdef MWRAP_LIBC_HAS_stdout + check(same_result([]() -> decltype(auto) { return m::stdout(); }, header::get_stdout), "stdout"); +#endif +#ifdef MWRAP_LIBC_HAS_EXIT_FAILURE + check(same(m::EXIT_FAILURE, header::value_EXIT_FAILURE), "EXIT_FAILURE"); +#endif +#ifdef MWRAP_LIBC_HAS_EXIT_SUCCESS + check(same(m::EXIT_SUCCESS, header::value_EXIT_SUCCESS), "EXIT_SUCCESS"); +#endif +#ifdef MWRAP_LIBC_HAS_RAND_MAX + check(same(m::RAND_MAX, header::value_RAND_MAX), "RAND_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_MB_CUR_MAX + check(same_result([]() -> decltype(auto) { return m::MB_CUR_MAX(); }, header::get_MB_CUR_MAX), "MB_CUR_MAX"); +#endif +#ifdef MWRAP_LIBC_HAS_CLOCKS_PER_SEC + check(same(m::CLOCKS_PER_SEC, header::value_CLOCKS_PER_SEC), "CLOCKS_PER_SEC"); +#endif +#ifdef MWRAP_LIBC_HAS_TIME_UTC + check(same(m::TIME_UTC, header::value_TIME_UTC), "TIME_UTC"); +#endif +#ifdef MWRAP_LIBC_HAS_WEOF + check(same(m::WEOF, header::value_WEOF), "WEOF"); +#endif + std::println("{} macros mapped here, {} differ", mapped, differ); + return differ != 0; +} diff --git a/tools/api.py b/tools/api.py new file mode 100644 index 0000000..a9f88a8 --- /dev/null +++ b/tools/api.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python3 +"""The public API of a set of C headers, as the compiler reads them. + +`extract` returns the functions, variables, types and enumerators that the +owned headers declare, and the macros that they define, as the compiler's AST and +preprocessor see them in a C++23 translation unit including the headers. +`constant_macros` and `type_macros` select the object-like macros whose +expansion is a constant expression or a type. tools/generate.py writes the +module from these sets and audits it against them. +""" +import json +from pathlib import Path +import re +import subprocess + + +def _run(cmd, stdin): + return subprocess.run(cmd, input=stdin, capture_output=True, text=True, check=True).stdout + + +def _owned(path, owned): + path = path.replace('\\', '/') + return any(path == name or path.endswith('/' + name) for name in owned) + + +def extract(compiler, flags, headers, owned=None): + """`flags`: the compiler's include, define and target flags for the module; + `owned`: the header files whose declarations are the API (default: `headers`).""" + owned = list(owned or headers) + source = ''.join(f'#include <{h}>\n' for h in headers) + flags = ['-x', 'c++', '-std=c++23', *flags] + ast = json.loads(_run([compiler, *flags, '-fsyntax-only', '-Xclang', '-ast-dump=json', '-'], source)) + api = {'functions': set(), 'internal': set(), 'variables': set(), 'types': set(), 'enumerators': set()} + current = [''] + + def mine(node): + # The AST names a file only where it changes from the previous node. + loc = node.get('loc', {}) + for where in (loc, loc.get('spellingLoc', {}), loc.get('expansionLoc', {})): + if 'file' in where: + current[0] = where['file'] + return _owned(current[0], owned) + + def walk(nodes): + for node in nodes: + kind = node.get('kind') + if kind == 'LinkageSpecDecl': + mine(node) + walk(node.get('inner', [])) + continue + if not mine(node) or node.get('isImplicit'): + continue + name = node.get('name') + if kind == 'EnumDecl': + api['enumerators'] |= {e['name'] for e in node.get('inner', []) if e.get('kind') == 'EnumConstantDecl'} + if not name: + continue + if kind == 'FunctionDecl': + api['internal' if node.get('storageClass') == 'static' else 'functions'].add(name) + elif kind == 'VarDecl' and node.get('storageClass') == 'extern': + api['variables'].add(name) + elif kind in ('TypedefDecl', 'TypeAliasDecl', 'RecordDecl', 'CXXRecordDecl', 'EnumDecl'): + api['types'].add(name) + walk(ast.get('inner', [])) + api['functions'] -= api['internal'] + + macros = {} + current = '' + for line in _run([compiler, *flags, '-E', '-dD', '-'], source).splitlines(): + marker = re.match(r'#\s*(?:line\s+)?\d+\s+"([^"]*)"', line) + if marker: + current = marker.group(1) + continue + define = re.match(r'#define\s+([A-Za-z_][A-Za-z_0-9]*)(\([^)]*\))?\s*(.*)$', line) + if define and _owned(current, owned): + macros[define.group(1)] = {'params': define.group(2), 'body': define.group(3).strip(), 'file': current} + undefine = re.match(r'#undef\s+([A-Za-z_][A-Za-z_0-9]*)', line) + if undefine: + macros.pop(undefine.group(1), None) + return api, macros + + +def guards(macros): + """The include guards among `macros`. An empty macro that the first + conditional directive of its file tests (`#ifndef G` or `#if !defined(G)`), + or a macro named like a guard (`..._H`, `..._H_`, `..._INCLUDED`) + that its file defines right after `#ifndef G`.""" + found = set() + for name, macro in macros.items(): + if macro['params'] is not None: + continue + try: + text = Path(macro['file']).read_text(encoding='utf-8', errors='replace') + except OSError: + continue + text = re.sub(r'/\*.*?\*/', ' ', text, flags=re.S) + first = re.search(r'^\s*#\s*if.*$', text, flags=re.M) + tested_first = first and re.fullmatch( + r'\s*#\s*(?:ifndef\s+' + name + r'|if\s+!\s*defined\s*\(?\s*' + name + r'\s*\)?)\s*', first.group(0)) + named = re.search(r'_H(?:_\w+)?$|_INCLUDED$', name) and re.search( + r'^\s*#\s*ifndef\s+' + name + r'\s*\n\s*#\s*define\s+' + name + r'\b', text, flags=re.M) + if (tested_first and not macro['body']) or named: + found.add(name) + return found + + +def accepted(compiler, flags, headers, names, form): + """The names for which `form` (with {i} and {n}; one or more lines) compiles + after the headers: one translation unit, dropping the forms with an error + until none remain.""" + head = ''.join(f'#include <{h}>\n' for h in headers) + pending = sorted(names) + while pending: + probe = head + '#line 1 "mwrap-probe"\n' + ''.join(form.format(i=i, n=n) + '\n' for i, n in enumerate(pending)) + result = subprocess.run([compiler, '-x', 'c++', '-std=c++23', *flags, '-fsyntax-only', '-ferror-limit=0', '-'], + input=probe, capture_output=True, text=True) + if result.returncode == 0: + return set(pending) + lines = form.count('\n') + 1 + bad = {(int(m.group(1)) - 1) // lines for m in re.finditer(r'mwrap-probe:(\d+):\d+: error', result.stderr)} + if not bad: + raise RuntimeError(result.stderr[-2000:]) + pending = [n for i, n in enumerate(pending) if i not in bad] + return set() + + +def constant_macros(compiler, flags, headers, macros): + """The object-like macros among `macros` whose expansion is a constant expression.""" + names = [n for n, m in macros.items() if m['params'] is None and m['body']] + return accepted(compiler, flags, headers, names, 'inline constexpr auto mwrap_probe_{i} = ({n});') + + +def type_macros(compiler, flags, headers, macros): + """The object-like macros among `macros` whose expansion is a type.""" + names = [n for n, m in macros.items() if m['params'] is None and m['body']] + return accepted(compiler, flags, headers, names, 'using mwrap_probe_{i} = {n};') diff --git a/tools/check_mwrap_release.py b/tools/check_mwrap_release.py new file mode 100644 index 0000000..2f75ef6 --- /dev/null +++ b/tools/check_mwrap_release.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +"""Check the immutable mwrap release coordinate and bilingual entry pages.""" +import argparse +import hashlib +import json +from pathlib import Path +import re +import tomllib + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--tag', help='release tag; omitted during PR checks') + args = parser.parse_args() + root = Path(__file__).resolve().parents[1] + package = tomllib.loads((root / 'mcpp.toml').read_text(encoding="utf-8"))['package'] + assert package['namespace'] == 'mcpplibs.mwrap', package + assert re.fullmatch(r'[A-Za-z_][A-Za-z_0-9]*', package['name']), package['name'] + upstream = package['metadata']['mwrap']['upstream-version'] + version = package['version'] + assert version == upstream or re.fullmatch(re.escape(upstream) + r'\.[1-9][0-9]*', version), (version, upstream) + if args.tag: + assert args.tag == 'mwrap-' + version, (args.tag, version) + assert package['license'] == 'Apache-2.0', package['license'] + assert package['authors'] == ['mcpp-community'], package.get('authors') + license_text = (root / 'LICENSE').read_text(encoding='utf-8') + assert 'Apache License' in license_text and 'Version 2.0' in license_text + assert 'mcpp-community' in (root / 'NOTICE').read_text(encoding='utf-8') + documents = json.loads((root / 'upstream/documents.json').read_text(encoding='utf-8'))['documents'] + # A standard as the upstream (libc-m: ISO C) has no redistributable README or license. + if 'standard' not in package['metadata']['mwrap']: + assert any(Path(d['path']).name.startswith('README') for d in documents) + assert any(Path(d['path']).name.startswith(('LICENSE', 'COPYING')) for d in documents) + deployed = {entry['from'] for entry in tomllib.loads((root / 'mcpp.toml').read_text(encoding='utf-8')).get('runtime', {}).get('deploy', [])} + assert {'LICENSE', 'NOTICE'} <= deployed + for document in documents: + path = Path(document['path']) + assert not path.is_absolute() and '..' not in path.parts and path.parts[0] == 'upstream' + assert hashlib.sha256((root / path).read_bytes()).hexdigest() == document['sha256'], path + assert document['source'] and path.as_posix() in deployed, path + identity = package['namespace'] + '.' + package['name'] + for name, other in [('README.md', 'README.zh.md'), ('README.zh.md', 'README.md')]: + text = (root / name).read_text(encoding="utf-8") + assert len(text.splitlines()) <= 150, name + assert '](' + other + ')' in '\n'.join(text.splitlines()[:12]), name + assert identity in text and version in text, name + assert text.count('```') % 2 == 0, name + print(identity + '@' + version) + + +if __name__ == '__main__': + main() diff --git a/tools/generate.py b/tools/generate.py new file mode 100644 index 0000000..9ecf19c --- /dev/null +++ b/tools/generate.py @@ -0,0 +1,185 @@ +#!/usr/bin/env python3 +"""Write, or with --check audit, the macro mapping of the C standard library. + +tools/iso_c.toml lists the object-like macros of ISO C17 by header. Each is +mapped into mcpplibs::mwrap::libc::macros under its own name, wherever the +target's C library defines it (`#ifdef`, so that an optional macro such as +FE_UPWARD or FP_FAST_FMA is mapped where it exists): + + a constant expression `inline constexpr`, equal to the macro + anything else a constexpr function returning the macro's + expression, `decltype(auto)`: errno() is the + int lvalue, stdout() the stream + +Whether a macro is a constant is read on `generated-on` by compiling it with +the flags of the last LLVM `mcpp build` (target/**/compile_commands.json); +tools/surface.toml names the macros that are constants there and not on +another target, which take the function form everywhere. The rendered files +are the same on every host: + + src/macros.cppm the mapping + tests/macros.cpp each mapping against its macro, where the target defines it + include/mwrap/libc/macros.hpp the headers of the function-like macros, with every + object-like macro of the list undefined after them + +--check renders them in memory: on `generated-on` they must be byte-identical; +on every host, each macro classified a constant must be one there. +""" +import argparse +from pathlib import Path +import sys +import textwrap +import tomllib + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from api import accepted # noqa: E402 + +ROOT = Path(__file__).resolve().parents[1] + + +def build_flags(): + import json + databases = sorted((ROOT / 'target').glob('**/compile_commands.json'), key=lambda p: p.stat().st_mtime) + for database in reversed(databases): + for entry in json.loads(database.read_text(encoding='utf-8')): + words = entry.get('arguments') or entry['command'].split() + if Path(entry['file']).as_posix().endswith('src/macros.cppm') and 'clang' in Path(words[0]).name: + flags, rest = [], iter(words[1:]) + for word in rest: + if word in ('-I', '-isystem', '-D', '-U', '-isysroot', '-target', '-include', '-imsvc'): + flags += [word, next(rest)] + elif word in ('-nostdinc++', '-nostdlibinc', '-nostdinc', '--no-default-config') or word.startswith( + ('-I', '-isystem', '-D', '-U', '--sysroot=', '--target=', '-fms-')): + flags.append(word) + return words[0], flags + sys.exit('no LLVM build of src/macros.cppm; run `mcpp build --toolchain llvm@23.1.3` first') + + +def classify(iso, surface, compiler, flags): + headers = list(iso['object']) + names = [n for ms in iso['object'].values() for n in ms] + defined = accepted(compiler, flags, headers, names, '#ifndef {n}\n#error {n} is not defined\n#endif') + constant = accepted(compiler, flags, headers, sorted(defined), 'inline constexpr auto mwrap_probe_{i} = ({n});') + return names, defined, constant - set(surface.get('function', [])) + + +def render(iso, names, constants): + headers = list(iso['object']) + includes = '\n'.join(f'#include <{h}>' for h in headers) + cap = 'mwrap_libc_capture' + m = ['// mcpplibs.mwrap.libc.macros --- the object-like macros of ISO C17 (ISO/IEC 9899:2018,', + '// Annex B) under their own names in mcpplibs::mwrap::libc::macros, wherever the target\'s', + '// C library defines them: a constant expression as an `inline constexpr` equal to the', + '// macro; anything else (errno, stdout, MB_CUR_MAX …) as a function returning the', + "// macro's expression. Written by tools/generate.py from tools/iso_c.toml.", + 'module;', includes, '', '// The values, taken under other names while the macros are defined.', + f'namespace {cap} {{'] + for n in names: + body = (f'inline constexpr auto value_{n} = ({n});' if n in constants + else f'constexpr decltype(auto) get_{n}() {{ return ({n}); }}') + m += [f'#ifdef {n}', body, '#endif'] + m.append('}') + for n in names: + m += [f'#ifdef {n}', f'#undef {n}', f'#define MWRAP_LIBC_HAS_{n}', '#endif'] + m += ['', 'export module mcpplibs.mwrap.libc.macros;', '', 'export namespace mcpplibs::mwrap::libc::macros {'] + for n in names: + body = (f'inline constexpr auto {n} = {cap}::value_{n};' if n in constants + else f'constexpr decltype(auto) {n}() {{ return {cap}::get_{n}(); }}') + m += [f'#ifdef MWRAP_LIBC_HAS_{n}', body, '#endif'] + m.append('}') + + t = ['// Each mapping of mcpplibs.mwrap.libc.macros equals its macro, where the target defines', + '// it. A macro expands even in a qualified name, so the values of the headers are taken', + '// under other names and the macros undefined before the mapped names are used. Written', + '// by tools/generate.py.', includes, '', 'namespace header {'] + for n in names: + body = (f'inline constexpr auto value_{n} = ({n});' if n in constants + else f'inline decltype(auto) get_{n}() {{ return ({n}); }}') + t += [f'#ifdef {n}', body, '#endif'] + t.append('}') + for n in names: + t += [f'#ifdef {n}', f'#undef {n}', f'#define MWRAP_LIBC_HAS_{n}', '#endif'] + t += ['', 'import std;', 'import mcpplibs.mwrap.libc.macros;', '', 'namespace m = mcpplibs::mwrap::libc::macros;', '', + 'template ', 'bool same(A&& a, B&& b)', '{', + ' using T = std::remove_cvref_t;', + ' if constexpr (std::is_convertible_v)', + ' return std::string_view(a) == std::string_view(b);', + ' else if constexpr (std::is_floating_point_v)', + ' return (a != a && b != b) || a == b; // NAN equals NAN here', + ' else', + ' return a == b;', + '}', '', + '// A function form: an lvalue (errno, stdout) is the same object, a value is equal.', + 'template ', + 'bool same_result(F mapped, G header)', + '{', + ' if constexpr (std::is_lvalue_reference_v)', + ' return &mapped() == &header();', + ' else', + ' return same(mapped(), header());', + '}', '', 'int main()', '{', ' int mapped = 0, differ = 0;', + ' auto check = [&](bool ok, std::string_view name) {', + ' ++mapped;', + ' if (!ok) { std::println("FAIL {}", name); ++differ; }', + ' };'] + for n in names: + if n in constants: + t += [f'#ifdef MWRAP_LIBC_HAS_{n}', f' check(same(m::{n}, header::value_{n}), "{n}");', '#endif'] + else: + t += [f'#ifdef MWRAP_LIBC_HAS_{n}', + f' check(same_result([]() -> decltype(auto) {{ return m::{n}(); }}, header::get_{n}), "{n}");', + '#endif'] + t += [' std::println("{} macros mapped here, {} differ", mapped, differ);', ' return differ != 0;', '}'] + fl = iso['function-like'] + listed = 'in for: ' + ', '.join(f"{', '.join(v)} (<{k}>)" for k, v in fl.items()) + '.' + h = ['// --- the function-like macros of ISO C17 that no function can stand'] + h += ['// ' + line for line in textwrap.wrap(listed, 86)] + h += ['// They take a type or a member name, act at the call site, or must be macros by the', + "// standard, so they stay macros, as the target's C library defines them: this header", + '// includes the headers that define them. Include it before `import mcpplibs.mwrap.libc;`.', + '//', + '// Those headers also define object-like macros, and which ones differs between C libraries', + "// (the Windows CRT's defines errno; macOS's headers bring MB_CUR_MAX and NAN).", + "// Each object-like macro of ISO C is undefined after them, so that the unit names it as", + '// mcpplibs::mwrap::libc::macros does on every target. Written by tools/generate.py.', + '#ifndef MWRAP_LIBC_MACROS_HPP', '#define MWRAP_LIBC_MACROS_HPP', ''] + h += [f'#include <{k}>' for k in fl] + h += [''] + h += [f'#undef {n}' for n in names] + h += ['', '#endif // MWRAP_LIBC_MACROS_HPP'] + join = lambda lines: '\n'.join(lines) + '\n' + return {'src/macros.cppm': join(m), 'tests/macros.cpp': join(t), 'include/mwrap/libc/macros.hpp': join(h)} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('--check', action='store_true', help='audit instead of writing') + args = parser.parse_args() + iso = tomllib.loads((ROOT / 'tools/iso_c.toml').read_text(encoding='utf-8')) + surface = tomllib.loads((ROOT / 'tools/surface.toml').read_text(encoding='utf-8')) + compiler, flags = build_flags() + names, defined, constants = classify(iso, surface, compiler, flags) + host = {'linux': 'linux', 'darwin': 'macos', 'win32': 'windows'}.get(sys.platform, sys.platform) + problems = [] + if host == surface['generated-on']: + files = render(iso, names, constants) + for path, text in files.items(): + target = ROOT / path + if args.check: + if not target.exists() or target.read_text(encoding='utf-8') != text: + problems.append(f'differs from tools/iso_c.toml: {path}') + elif not target.exists() or target.read_text(encoding='utf-8') != text: + target.write_text(text, encoding='utf-8', newline='\n') + else: + written = (ROOT / 'src/macros.cppm').read_text(encoding='utf-8') + classified = {n for n in names if f'inline constexpr auto value_{n} = ' in written} + problems += [f'a constant on {surface["generated-on"]}, not here: {n}' for n in sorted(classified & defined - constants)] + for problem in problems: + print(problem) + print(f'{host}: {len(names)} ISO C object-like macros, {len(defined)} defined here, ' + f'{len(constants & defined)} constants; {len(problems)} problems') + return 1 if problems else 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tools/iso_c.toml b/tools/iso_c.toml new file mode 100644 index 0000000..bbecdb3 --- /dev/null +++ b/tools/iso_c.toml @@ -0,0 +1,114 @@ +# The object-like macros of ISO C17 (ISO/IEC 9899:2018, Annex B), by header. +# tools/generate.py maps each that the target defines: a constant expression to +# an `inline constexpr`, anything else to a function returning it. +# WCHAR_MIN, WCHAR_MAX (also ) and WEOF (also ) are listed once. + +[object] +"errno.h" = [ + "EDOM", "EILSEQ", "ERANGE", "errno", +] +"fenv.h" = [ + "FE_DIVBYZERO", "FE_INEXACT", "FE_INVALID", "FE_OVERFLOW", "FE_UNDERFLOW", "FE_ALL_EXCEPT", + "FE_DOWNWARD", "FE_TONEAREST", "FE_TOWARDZERO", "FE_UPWARD", "FE_DFL_ENV", +] +"float.h" = [ + "FLT_ROUNDS", "FLT_EVAL_METHOD", "FLT_HAS_SUBNORM", "DBL_HAS_SUBNORM", "LDBL_HAS_SUBNORM", "FLT_RADIX", + "DECIMAL_DIG", "FLT_MANT_DIG", "DBL_MANT_DIG", "LDBL_MANT_DIG", "FLT_DECIMAL_DIG", "DBL_DECIMAL_DIG", + "LDBL_DECIMAL_DIG", "FLT_DIG", "DBL_DIG", "LDBL_DIG", "FLT_MIN_EXP", "DBL_MIN_EXP", + "LDBL_MIN_EXP", "FLT_MIN_10_EXP", "DBL_MIN_10_EXP", "LDBL_MIN_10_EXP", "FLT_MAX_EXP", "DBL_MAX_EXP", + "LDBL_MAX_EXP", "FLT_MAX_10_EXP", "DBL_MAX_10_EXP", "LDBL_MAX_10_EXP", "FLT_MAX", "DBL_MAX", + "LDBL_MAX", "FLT_EPSILON", "DBL_EPSILON", "LDBL_EPSILON", "FLT_MIN", "DBL_MIN", + "LDBL_MIN", "FLT_TRUE_MIN", "DBL_TRUE_MIN", "LDBL_TRUE_MIN", +] +"inttypes.h" = [ + "PRId8", "PRId16", "PRId32", "PRId64", "PRIdLEAST8", "PRIdLEAST16", + "PRIdLEAST32", "PRIdLEAST64", "PRIdFAST8", "PRIdFAST16", "PRIdFAST32", "PRIdFAST64", + "PRIdMAX", "PRIdPTR", "PRIi8", "PRIi16", "PRIi32", "PRIi64", + "PRIiLEAST8", "PRIiLEAST16", "PRIiLEAST32", "PRIiLEAST64", "PRIiFAST8", "PRIiFAST16", + "PRIiFAST32", "PRIiFAST64", "PRIiMAX", "PRIiPTR", "PRIo8", "PRIo16", + "PRIo32", "PRIo64", "PRIoLEAST8", "PRIoLEAST16", "PRIoLEAST32", "PRIoLEAST64", + "PRIoFAST8", "PRIoFAST16", "PRIoFAST32", "PRIoFAST64", "PRIoMAX", "PRIoPTR", + "PRIu8", "PRIu16", "PRIu32", "PRIu64", "PRIuLEAST8", "PRIuLEAST16", + "PRIuLEAST32", "PRIuLEAST64", "PRIuFAST8", "PRIuFAST16", "PRIuFAST32", "PRIuFAST64", + "PRIuMAX", "PRIuPTR", "PRIx8", "PRIx16", "PRIx32", "PRIx64", + "PRIxLEAST8", "PRIxLEAST16", "PRIxLEAST32", "PRIxLEAST64", "PRIxFAST8", "PRIxFAST16", + "PRIxFAST32", "PRIxFAST64", "PRIxMAX", "PRIxPTR", "PRIX8", "PRIX16", + "PRIX32", "PRIX64", "PRIXLEAST8", "PRIXLEAST16", "PRIXLEAST32", "PRIXLEAST64", + "PRIXFAST8", "PRIXFAST16", "PRIXFAST32", "PRIXFAST64", "PRIXMAX", "PRIXPTR", + "SCNd8", "SCNd16", "SCNd32", "SCNd64", "SCNdLEAST8", "SCNdLEAST16", + "SCNdLEAST32", "SCNdLEAST64", "SCNdFAST8", "SCNdFAST16", "SCNdFAST32", "SCNdFAST64", + "SCNdMAX", "SCNdPTR", "SCNi8", "SCNi16", "SCNi32", "SCNi64", + "SCNiLEAST8", "SCNiLEAST16", "SCNiLEAST32", "SCNiLEAST64", "SCNiFAST8", "SCNiFAST16", + "SCNiFAST32", "SCNiFAST64", "SCNiMAX", "SCNiPTR", "SCNo8", "SCNo16", + "SCNo32", "SCNo64", "SCNoLEAST8", "SCNoLEAST16", "SCNoLEAST32", "SCNoLEAST64", + "SCNoFAST8", "SCNoFAST16", "SCNoFAST32", "SCNoFAST64", "SCNoMAX", "SCNoPTR", + "SCNu8", "SCNu16", "SCNu32", "SCNu64", "SCNuLEAST8", "SCNuLEAST16", + "SCNuLEAST32", "SCNuLEAST64", "SCNuFAST8", "SCNuFAST16", "SCNuFAST32", "SCNuFAST64", + "SCNuMAX", "SCNuPTR", "SCNx8", "SCNx16", "SCNx32", "SCNx64", + "SCNxLEAST8", "SCNxLEAST16", "SCNxLEAST32", "SCNxLEAST64", "SCNxFAST8", "SCNxFAST16", + "SCNxFAST32", "SCNxFAST64", "SCNxMAX", "SCNxPTR", +] +"limits.h" = [ + "CHAR_BIT", "SCHAR_MIN", "SCHAR_MAX", "UCHAR_MAX", "CHAR_MIN", "CHAR_MAX", + "MB_LEN_MAX", "SHRT_MIN", "SHRT_MAX", "USHRT_MAX", "INT_MIN", "INT_MAX", + "UINT_MAX", "LONG_MIN", "LONG_MAX", "ULONG_MAX", "LLONG_MIN", "LLONG_MAX", + "ULLONG_MAX", +] +"locale.h" = [ + "LC_ALL", "LC_COLLATE", "LC_CTYPE", "LC_MONETARY", "LC_NUMERIC", "LC_TIME", +] +"math.h" = [ + "HUGE_VAL", "HUGE_VALF", "HUGE_VALL", "INFINITY", "NAN", "FP_INFINITE", + "FP_NAN", "FP_NORMAL", "FP_SUBNORMAL", "FP_ZERO", "FP_FAST_FMA", "FP_FAST_FMAF", + "FP_FAST_FMAL", "FP_ILOGB0", "FP_ILOGBNAN", "MATH_ERRNO", "MATH_ERREXCEPT", "math_errhandling", +] +"signal.h" = [ + "SIG_DFL", "SIG_ERR", "SIG_IGN", "SIGABRT", "SIGFPE", "SIGILL", + "SIGINT", "SIGSEGV", "SIGTERM", +] +"stdint.h" = [ + "INT8_MIN", "INT8_MAX", "UINT8_MAX", "INT_LEAST8_MIN", "INT_LEAST8_MAX", "UINT_LEAST8_MAX", + "INT_FAST8_MIN", "INT_FAST8_MAX", "UINT_FAST8_MAX", "INT16_MIN", "INT16_MAX", "UINT16_MAX", + "INT_LEAST16_MIN", "INT_LEAST16_MAX", "UINT_LEAST16_MAX", "INT_FAST16_MIN", "INT_FAST16_MAX", "UINT_FAST16_MAX", + "INT32_MIN", "INT32_MAX", "UINT32_MAX", "INT_LEAST32_MIN", "INT_LEAST32_MAX", "UINT_LEAST32_MAX", + "INT_FAST32_MIN", "INT_FAST32_MAX", "UINT_FAST32_MAX", "INT64_MIN", "INT64_MAX", "UINT64_MAX", + "INT_LEAST64_MIN", "INT_LEAST64_MAX", "UINT_LEAST64_MAX", "INT_FAST64_MIN", "INT_FAST64_MAX", "UINT_FAST64_MAX", + "INTPTR_MIN", "INTPTR_MAX", "UINTPTR_MAX", "INTMAX_MIN", "INTMAX_MAX", "UINTMAX_MAX", + "PTRDIFF_MIN", "PTRDIFF_MAX", "SIG_ATOMIC_MIN", "SIG_ATOMIC_MAX", "SIZE_MAX", "WCHAR_MIN", + "WCHAR_MAX", "WINT_MIN", "WINT_MAX", +] +"stdio.h" = [ + "_IOFBF", "_IOLBF", "_IONBF", "BUFSIZ", "EOF", "FOPEN_MAX", + "FILENAME_MAX", "L_tmpnam", "SEEK_CUR", "SEEK_END", "SEEK_SET", "TMP_MAX", + "stderr", "stdin", "stdout", +] +"stdlib.h" = [ + "EXIT_FAILURE", "EXIT_SUCCESS", "RAND_MAX", "MB_CUR_MAX", +] +"time.h" = [ + "CLOCKS_PER_SEC", "TIME_UTC", +] +"wchar.h" = [ + "WEOF", +] + +# The function-like macros of ISO C17 that a function cannot stand in for: they +# take a type or a member name, declare, or act at the call site. They stay +# macros: include/mwrap/libc/macros.hpp includes the headers that define them. +[function-like] +"assert.h" = ["assert"] +"setjmp.h" = ["setjmp"] +"stdarg.h" = ["va_arg", "va_copy", "va_end", "va_start"] +"stddef.h" = ["offsetof"] +"stdint.h" = ["INT8_C", "INT16_C", "INT32_C", "INT64_C", "UINT8_C", "UINT16_C", "UINT32_C", "UINT64_C", + "INTMAX_C", "UINTMAX_C"] + +# ISO C macros that this package does not offer, and why. +[not-offered] +NULL = "C++ has nullptr" +"complex.h, tgmath.h" = "the C++ headers of these names are not C's: std::complex and the overloads of " +"iso646.h, stdalign.h, stdbool.h, stdnoreturn.h" = "their macros spell C++ keywords and attributes" +"stdatomic.h, threads.h" = "C++ has std::atomic and std::thread; C++23's is a C++ header" +"math.h classification and comparison" = "fpclassify, isfinite, isinf, isnan, isnormal, signbit, isgreater … are functions of in C++" +"__STDC_*" = "predefined by the compiler, not by a header" +"Annex K" = "the bounds-checking interfaces are optional, and the C libraries this package targets do not provide them" diff --git a/tools/surface.toml b/tools/surface.toml new file mode 100644 index 0000000..6048b29 --- /dev/null +++ b/tools/surface.toml @@ -0,0 +1,9 @@ +# What tools/generate.py cannot read on `generated-on`; the rest it can. +generated-on = "linux" + +# Constants with glibc, not with every C library this package targets: the +# Windows CRT spells INFINITY and NAN as overflowing arithmetic and HUGE_VAL as +# a variable; macOS computes math_errhandling at run time; FLT_EVAL_METHOD and +# FLT_ROUNDS follow the floating-point environment. They take the function +# form everywhere: a constexpr function, constant where the target allows. +function = ["HUGE_VAL", "HUGE_VALF", "HUGE_VALL", "INFINITY", "NAN", "math_errhandling", "FLT_EVAL_METHOD", "FLT_ROUNDS"] diff --git a/tools/test_template.py b/tools/test_template.py new file mode 100644 index 0000000..81ea805 --- /dev/null +++ b/tools/test_template.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +"""Render an installed candidate's default mcpp template, then build and run it.""" +import argparse +import json +import os +from pathlib import Path +import shutil +import subprocess +import tempfile +import tomllib + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--mcpp", default="mcpp") + parser.add_argument("--namespace", help="index namespace for legacy manifests without package.namespace") + parser.add_argument("--toolchain", default="llvm@23.1.3") + parser.add_argument("--template", help="named template; omit for the package default") + parser.add_argument("--run-arg", action="append", default=[]) + parser.add_argument("--index", type=Path, help="candidate SDK/wrapper index for unpublished feature dependencies") + args = parser.parse_args() + root = Path(__file__).resolve().parents[1] + metadata = tomllib.loads((root / "mcpp.toml").read_text())["package"] + namespace = metadata.get("namespace", args.namespace) + assert namespace, "Supply the published index namespace for this legacy manifest" + name, version = metadata["name"], metadata["version"] + identity = namespace + "." + name + with tempfile.TemporaryDirectory(prefix=name + "-template-") as directory: + temporary = Path(directory) + home = temporary / "home" + package = home / "registry/data/xpkgs" / (namespace + "-x-" + name) / version / (name + "-" + version) + shutil.copytree(root, package, ignore=shutil.ignore_patterns( + ".git", "target", ".mcpp", ".xlings", ".candidate-index", "__pycache__", "mcpp.lock", "compile_commands.json", "mcpp-2026.*")) + index = home / "indices/mcpplibs/pkgs/mwrap" + index.mkdir(parents=True) + entry = '{url="https://example.invalid/candidate.tar.gz",sha256="fixture"}' + descriptor = ('package={spec="1",namespace=' + json.dumps(namespace) + ',name=' + json.dumps(name) + + ',description="Installed template fixture",type="package",mcpp="mcpp.toml",xpm={') + descriptor += ",".join(platform + "={[" + json.dumps(version) + "]=" + entry + "}" + for platform in ("linux", "macosx", "windows")) + "}}\n" + (index / (identity + ".lua")).write_text(descriptor) + env = dict(os.environ, MCPP_HOME=str(home)) + selector = identity + "@" + version + for command in ([args.mcpp, "new", "--list-templates", selector], + [args.mcpp, "new", "quickstart", "--template", selector + (":" + args.template if args.template else "")]): + print("+", " ".join(command), flush=True) + subprocess.run(command, cwd=temporary, env=env, check=True) + project = temporary / "quickstart" + manifest = project / "mcpp.toml" + text = manifest.read_text() + dependency = tomllib.loads(text)["dependencies"][identity] + options = {"version": dependency} if isinstance(dependency, str) else dependency + assert options["version"] == version, options + replacement = '{ path = ' + json.dumps(package.as_posix()) + if options.get("features"): + replacement += ', features = ' + json.dumps(options["features"]) + replacement += ' }' + lines = text.splitlines() + matches = [i for i, line in enumerate(lines) if line.startswith(json.dumps(identity) + " =")] + assert len(matches) == 1, "Expected exactly one qualified dependency from self.name" + lines[matches[0]] = json.dumps(identity) + " = " + replacement + manifest.write_text("\n".join(lines) + "\n") + if args.index: + candidate_index = args.index.resolve() + subprocess.run([os.sys.executable, str(candidate_index / "tests/prepare_mwrap_indices.py")], + cwd=candidate_index, check=True) + with manifest.open("a") as out: + out.write("\n[indices]\n") + for namespace in ("compat", "mcpplibs.mwrap"): + view = candidate_index / "tests/mwrap/.indices" / namespace + out.write(json.dumps(namespace) + ' = { path = ' + json.dumps(view.as_posix()) + ' }\n') + command = [args.mcpp, "build", "--toolchain", args.toolchain, "--strict"] + print("+", " ".join(command), flush=True) + subprocess.run(command, cwd=project, check=True) + command = [args.mcpp, "run", "--toolchain", args.toolchain] + if args.run_arg: + command += ["--", *args.run_arg] + print("+", " ".join(command), flush=True) + subprocess.run(command, cwd=project, check=True) + + +if __name__ == "__main__": + main() diff --git a/upstream/documents.json b/upstream/documents.json new file mode 100644 index 0000000..0b88f2f --- /dev/null +++ b/upstream/documents.json @@ -0,0 +1,6 @@ +{ + "upstream": "ISO/IEC 9899:2018, Programming languages — C (C17), Annex B: the library summary", + "upstream_sha256": "", + "pruning": "Nothing is vendored and no upstream document is retained: the standard is not redistributable, and the implementation is the target's C library (glibc, musl, the Windows CRT, macOS libSystem, openkal-musl, mingw), selected by mcpp's target. tools/iso_c.toml lists the macro names of Annex B.", + "documents": [] +}