/* SPDX-License-Identifier: 0BSD */

/* Copyright (C) 2026 Mintsuki and contributors.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */


#ifndef __FREESTANDING_CXX_HDRS_CSTDINT
#define __FREESTANDING_CXX_HDRS_CSTDINT 1

#pragma GCC system_header

#include <__fcxx/config.h>

#if _FCXX_STD < 2011
#  error "<cstdint> requires C++11 or later"
#endif

#if _FCXX_STD >= 2011

/* The types and the macros of the C header, which defines those of each
 * revision of C++, and the types also in std. The exact-width and
 * pointer-holding types are there where their macros are. */
#include <stdint.h>

namespace std {

#ifdef INT8_MAX
using ::int8_t;
#endif
#ifdef INT16_MAX
using ::int16_t;
#endif
#ifdef INT32_MAX
using ::int32_t;
#endif
#ifdef INT64_MAX
using ::int64_t;
#endif
#ifdef UINT8_MAX
using ::uint8_t;
#endif
#ifdef UINT16_MAX
using ::uint16_t;
#endif
#ifdef UINT32_MAX
using ::uint32_t;
#endif
#ifdef UINT64_MAX
using ::uint64_t;
#endif

using ::int_least8_t;
using ::int_least16_t;
using ::int_least32_t;
using ::int_least64_t;
using ::uint_least8_t;
using ::uint_least16_t;
using ::uint_least32_t;
using ::uint_least64_t;

using ::int_fast8_t;
using ::int_fast16_t;
using ::int_fast32_t;
using ::int_fast64_t;
using ::uint_fast8_t;
using ::uint_fast16_t;
using ::uint_fast32_t;
using ::uint_fast64_t;

using ::intmax_t;
using ::uintmax_t;

#ifdef INTPTR_MAX
using ::intptr_t;
#endif
#ifdef UINTPTR_MAX
using ::uintptr_t;
#endif

} /* namespace std */

#endif

#endif
