// -*- C++ -*-
//===--------------------------- climits ----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCUDACXX_CLIMITS
#define _LIBCUDACXX_CLIMITS

/*
    climits synopsis

Macros:

    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   // C99
    LLONG_MAX   // C99
    ULLONG_MAX  // C99

*/

#ifndef __cuda_std__
#include <__config>
#else
#include "__cuda/climits_prelude.h"
#endif //__cuda_std__

#ifndef __cuda_std__
#include <limits.h>
#include <__pragma_push>
#endif //__cuda_std__

#if defined(_LIBCUDACXX_USE_PRAGMA_GCC_SYSTEM_HEADER)
#pragma GCC system_header
#endif

#if defined(_LIBCUDACXX_COMPILER_MSVC)
#include "support/win32/limits_msvc_win32.h"
#endif // _LIBCUDACXX_MSVCRT

#if defined(_LIBCUDACXX_COMPILER_IBM)
#include "support/ibm/limits.h"
#endif // _LIBCUDACXX_COMPILER_IBM

// ICC defines __CHAR_BIT__ by default
// accept that, but assert it is what we expect
#ifdef __CHAR_BIT__
    static_assert(__CHAR_BIT__ == 8, "");
#else
    #define __CHAR_BIT__ 8
#endif

#ifndef __cuda_std__
#include <__pragma_pop>
#endif //__cuda_std__

#endif  // _LIBCUDACXX_CLIMITS
