summaryrefslogtreecommitdiff
path: root/numpy/core/src/common/npstd.hpp
blob: 92e3d5cc50f32ecaa41f5de7bff8eb3ad8ddc7a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef NUMPY_CORE_SRC_COMMON_NPSTD_HPP
#define NUMPY_CORE_SRC_COMMON_NPSTD_HPP

#include <cstddef>
#include <cstring>
#include <cctype>
#include <cstdint>

#include <string>
#include <algorithm>
#include <utility>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <type_traits>

#include <numpy/npy_common.h>

#include "npy_config.h"

namespace np {
/// @addtogroup cpp_core_types
/// @{
using std::uint8_t;
using std::int8_t;
using std::uint16_t;
using std::int16_t;
using std::uint32_t;
using std::int32_t;
using std::uint64_t;
using std::int64_t;
using std::uintptr_t;
using std::intptr_t;
using std::complex;
using std::uint_fast16_t;
using std::uint_fast32_t;

/** Guard for long double.
 *
 * The C implementation defines long double as double
 * on MinGW to provide compatibility with MSVC to unify
 * one behavior under Windows OS, which makes npy_longdouble
 * not fit to be used with template specialization or overloading.
 *
 * This type will be set to `void` when `npy_longdouble` is not defined
 * as `long double`.
 */
using LongDouble = typename std::conditional<
    !std::is_same<npy_longdouble, long double>::value,
     void, npy_longdouble
>::type;
/// @} cpp_core_types

} // namespace np

#endif // NUMPY_CORE_SRC_COMMON_NPSTD_HPP