blob: 8775a548ccc3ef0a8656ceed6144c5ef54867dbe (
plain) (
blame)
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
|
// Copyright 2011-2022, Molecular Matters GmbH <[email protected]>
// See LICENSE.txt for licensing details (2-clause BSD License: https://opensource.org/licenses/BSD-2-Clause)
#pragma once
// determine the compiler/toolchain used
#if defined(__clang__)
# define PDB_COMPILER_MSVC 0
# define PDB_COMPILER_CLANG 1
# define PDB_COMPILER_GCC 0
#elif defined(_MSC_VER)
# define PDB_COMPILER_MSVC 1
# define PDB_COMPILER_CLANG 0
# define PDB_COMPILER_GCC 0
#elif defined(__GNUC__)
# define PDB_COMPILER_MSVC 0
# define PDB_COMPILER_CLANG 0
# define PDB_COMPILER_GCC 1
#else
# error("Unknown compiler.");
#endif
// check whether C++17 is available
#if __cplusplus >= 201703L
# define PDB_CPP_17 1
#else
# define PDB_CPP_17 0
#endif
// define used standard types
typedef decltype(sizeof(0)) size_t;
static_assert(sizeof(sizeof(0)) == sizeof(size_t), "Wrong size.");
typedef int int32_t;
static_assert(sizeof(int32_t) == 4u, "Wrong size.");
typedef unsigned char uint8_t;
static_assert(sizeof(uint8_t) == 1u, "Wrong size.");
typedef unsigned short uint16_t;
static_assert(sizeof(uint16_t) == 2u, "Wrong size.");
typedef unsigned int uint32_t;
static_assert(sizeof(uint32_t) == 4u, "Wrong size.");
|