aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/update-warnings.h
blob: 36d8940681a76d64d46a6b88de30c7898fb80f83 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
 * libgamma -- Display server abstraction layer for gamma ramp adjustments
 * Copyright (C) 2014  Mattias Andrée (maandree@member.fsf.org)
 * 
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef LIBGAMMA_TEST_UPDATE_WARNINGS_H
#define LIBGAMMA_TEST_UPDATE_WARNINGS_H

#include <libgamma.h>


/*
 * This file testes whether the program is out of date
 * when it is compiled. This is done by checking for newer
 * values of constants that tells us how much there is of
 * different things for which we may want to create
 * descriptions or otherwise handle especially.
 * 
 * To get the current value of for example `LIBGAMMA_ERROR_MIN`
 * simply run the command
 * 
 *     cpp <<EOF | tail -n 1
 *     #include <libgamma.h>
 *     LIBGAMMA_ERROR_MIN
 *     EOF
 *
 * However, we only do this for if GCC is used to
 * compile the program because the #warning CPP
 * directive is a GCC extension. If you are not
 * using GNU you may want to find another way to
 * accomplish this.
 */

#ifdef __GCC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcpp"
# if LIBGAMMA_ERROR_MIN < -46
#  warning New error codes have been added to libgamma.
# endif
# if LIBGAMMA_METHOD_COUNT > 6
#  warning New adjust methods has been added to libgamma
# endif
# if LIBGAMMA_CONNECTOR_TYPE_COUNT > 20
#  warning New connector types have been added to libgamma.
# endif
# if LIBGAMMA_SUBPIXEL_ORDER_COUNT > 6
#  warning New subpixel orders have been added to libgamma.
# endif
# if LIBGAMMA_CRTC_INFO_COUNT > 13
#  warning New CRTC information fields have been added to libgamma.
# endif
# pragma GCC diagnostic pop
#endif


#endif