Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
capabilities.h
Go to the documentation of this file.
1/*
2 * The MIT License (MIT)
3 *
4 * Copyright © 2017 Franklin "Snaipe" Mathieu <http://snai.pe/>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24#ifndef CRITERION_INTERNAL_DETECT_H_
25#define CRITERION_INTERNAL_DETECT_H_
26
27/* Standard version checks */
28#if !defined (CR_NO_COMPILER_CHECK)
29# if defined (__cplusplus)
30/* Is the compiler a >C++11 compiler ?*/
31# if defined (_MSC_VER)
32# if _MSC_VER < 1800
33# error \
34 Your version of MSVC is too old, please compile your tests using \
35 a c++11 compiler, like MinGW or MSVC 14.0+ (Included in visual studio \
36 2015)
37# endif
38# elif __cplusplus < 201103L
39# error The Criterion C++ API needs a C++11 compiler or later.
40# endif
41# elif defined (__STDC__) || defined (_MSC_VER)
42/* Is the compiler a supported c99 compiler? */
43# if defined (_MSC_VER)
44# if _MSC_VER < 1900
45# error \
46 Your version of MSVC is too old, please compile your tests using \
47 a c99 compiler, like MinGW or MSVC 14.0+ (Included in visual studio \
48 2015)
49# endif
50# elif __STDC_VERSION__ < 199901L
51# error The Criterion C API needs a C99 compiler or later.
52# endif
53# else
54# error The Criterion C/C++ API needs a C or C++ compiler.
55# endif
56#endif /* !CR_NO_COMPILER_CHECK */
57
58/* Does the compiler support section attributes? */
59#if !defined (__clang__) && !defined (__GNUC__) && !defined (_MSC_VER)
60# error Criterion needs a compiler that supports section attributes.
61#endif
62
63/* Does the compiler support complex numbers? */
64#if defined (__cplusplus) || (__STDC_VERSION__ >= 199901L && !defined (__STDC_NO_COMPLEX__))
65# define CRI_CAPS_COMPLEX
66#endif
67
68/* Does the compiler support auto types? */
69#if defined (__cplusplus)
70# define CRI_AUTOTYPE auto
71# define CRI_CAPS_AUTOTYPE
72#elif defined (__GNUC__)
73# define CRI_AUTOTYPE __extension__ __auto_type
74# define CRI_CAPS_AUTOTYPE
75#else
76# define CRI_AUTOTYPE
77#endif
78
79/* Does the compiler represent long doubles as regular doubles? */
80#if defined (_MSC_VER) || (defined (__MINGW32__) && !defined (__USE_MINGW_ANSI_STDIO))
81# define CRI_CAPS_LDBL_IS_DBL
82#endif
83
84#endif /* !CRITERION_INTERNAL_DETECT_H_ */