LIBINT 2.7.2
intrinsic_types.h
1/*
2 * Copyright (C) 2004-2021 Edward F. Valeev
3 *
4 * This file is part of Libint.
5 *
6 * Libint is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Libint is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with Libint. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef _libint2_include_libint2intrinsictypes_h_
22#define _libint2_include_libint2intrinsictypes_h_
23
24#include <libint2/config.h>
25
26#include <limits.h>
27
28/* determine default LIBINT2 64-bit integer */
29#ifdef HAVE_STDINT_H
30
31#include <stdint.h>
32/* because mpz_class does not mesh with long long types, only use those when absolutely necessary */
33#if UINT_LEAST64_MAX != ULONG_MAX
34 typedef uint_least64_t LIBINT2_UINT_LEAST64;
35#else
36 typedef unsigned long int LIBINT2_UINT_LEAST64;
37#endif
38#if INT_LEAST64_MAX != LONG_MAX
39 typedef int_least64_t LIBINT2_INT_LEAST64;
40#else
41 typedef long int LIBINT2_INT_LEAST64;
42#endif
43
44#else
45
46#if defined(ULONGLONG_MAX) && !defined(ULLONG_MAX)
47# define ULLONG_MAX ULONGLONG_MAX
48#endif
49
50# ifdef ULLONG_MAX
51# if ULONGLONG_MAX == (0xffffffffffffffffuLL) /* uLL reqd for xlC */
52 typedef long long LIBINT2_INT_LEAST64;
53 typedef unsigned long long LIBINT2_UINT_LEAST64;
54# else
55# error defaults not correct; you must hand modify libint2_intrinsic_types.h
56# endif
57# elif ULONG_MAX != 0xffffffff
58
59# if ULONG_MAX == 18446744073709551615 /* 2**64 - 1 */
60 typedef long LIBINT2_INT_LEAST64;
61 typedef unsigned long LIBINT2_UINT_LEAST64;
62# else
63# error defaults not correct; you must hand modify scint.h
64# endif
65# else /* assume no 64-bit integers */
66# error 64 bit integer types are required
67# endif
68
69#endif /* HAVE_STDINT_H */
70
71#endif