Debian Codegraph @

src/pragma.h

raw symbols SCIP
1 /*
2 * avarice - The "avarice" program.
3 * Copyright (C) 2011 Joerg Wunsch
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License Version 2
7 * as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
17 *
18 * Pragma abstractions for various compilers/compiler versions.
19 *
20 * $Id: pragma.h 348 2015-05-18 20:10:18Z joerg_wunsch $
21 */
22
23 #ifndef PRAGMA_H
24 #define PRAGMA_H
25
26 /*
27 * Evaluate which diagnostic pragmas can be used.
28 */
29 #if defined(__GNUC__)
30 # if __GNUC__ > 4
31 # define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
32 # define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
33 # define PRAGMA_(x) _Pragma(#x)
34 # define PRAGMA_DIAG_IGNORED(x) PRAGMA_(GCC diagnostic ignored x)
35 # elif __GNUC__ == 4
36 # if __GNUC_MINOR__ >= 6
37 # define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
38 # define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
39 # define PRAGMA_(x) _Pragma(#x)
40 # define PRAGMA_DIAG_IGNORED(x) PRAGMA_(GCC diagnostic ignored x)
41 # else
42 # define PRAGMA_DIAG_PUSH
43 # define PRAGMA_DIAG_POP
44 # define PRAGMA_(x) _Pragma(#x)
45 # define PRAGMA_DIAG_IGNORED(x) PRAGMA_(GCC diagnostic ignored x)
46 # endif /* GCC 4.x */
47 # else /* too old */
48 # define PRAGMA_DIAG_PUSH
49 # define PRAGMA_DIAG_POP
50 # define PRAGMA_DIAG_IGNORED(x)
51 # endif
52 #else /* not GCC */
53 # define PRAGMA_DIAG_PUSH
54 # define PRAGMA_DIAG_POP
55 # define PRAGMA_DIAG_IGNORED(x)
56 #endif
57
58 #endif