Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
deprecation.h
Go to the documentation of this file.
1/*
2 * The MIT License (MIT)
3 *
4 * Copyright © 2015-2016 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_DEPRECATION_H_
25#define CRITERION_INTERNAL_DEPRECATION_H_
26
27#include "preprocess.h"
28
29#ifdef _MSC_VER
30# define CR_PRAGMA(Msg) __pragma(Msg)
31#else
32# define CR_PRAGMA(Msg) _Pragma(#Msg)
33#endif
34
35#define CR_COMPILE_ERROR(Msg) CR_COMPILE_ERROR_(Msg)
36
37#if defined (_MSC_VER)
38# define CR_COMPILE_ERROR_(Msg) CR_PRAGMA(message(CR_STR(error: Msg)))
39#elif defined (__GNUC__)
40# define CR_COMPILE_ERROR_(Msg) CR_PRAGMA(GCC error #Msg)
41#elif __STDC_VERSION__ >= 201112L
42# define CR_COMPILE_ERROR_(Msg) _Static_assert(0, #Msg);
43#elif __cplusplus >= 201103L
44# define CR_COMPILE_ERROR_(Msg) static_assert(0, #Msg);
45#else
46# define CR_COMPILE_ERROR_(Msg) ((void) sizeof (char[-1]))
47#endif
48
49#define CRI_COMPILE_ERROR(...) ,
50#define CR_CHECKERROR__(M, N) M ## N
51#define CR_CHECKERROR_(M, N) CR_CHECKERROR__(M, N)
52#define CR_CHECKERROR(M) CR_CHECKERROR_(CR_CHECKERROR_, CR_VA_TAIL_SELECT(CR_CHECKERROR_(CRI_, M)))(M)
53#define CR_CHECKERROR_1(M) M
54#define CR_CHECKERROR_2(M) CR_CHECKERROR_(CR_, M)
55
56#define CR_DEPRECATED(Msg) CR_PRAGMA(message(Msg))
57
58#ifdef __GNUC__
59# define CR_DEPRECATED_MEMBER(Member) Member __attribute__((deprecated))
60#else
61# define CR_DEPRECATED_MEMBER(Member) Member
62#endif
63
64#endif /* !CRITERION_INTERNAL_DEPRECATION_H_ */