From 775c24e79fd81740a9633a5b7cee854c89faf36c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 4 Jun 2014 19:22:51 +0200 Subject: split out and doc lib update warnings from test.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/test/test.c | 20 ++-------------- src/test/update-warnings.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 18 deletions(-) create mode 100644 src/test/update-warnings.h (limited to 'src/test') diff --git a/src/test/test.c b/src/test/test.c index e21bf51..ceff71b 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -17,6 +17,8 @@ */ #include +#include "update-warnings.h" + #include #include #include @@ -24,24 +26,6 @@ #include -#ifdef __GNUC__ -# 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 -#endif - static const char* method_name(int method) { diff --git a/src/test/update-warnings.h b/src/test/update-warnings.h new file mode 100644 index 0000000..05cf242 --- /dev/null +++ b/src/test/update-warnings.h @@ -0,0 +1,60 @@ +/** + * libgamma — Display server abstraction layer for gamma ramp adjustments + * Copyright © 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 . + */ +#include + + +/* + * 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 < + * 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 __GNUC__ +# 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 +#endif + -- cgit v1.2.3-70-g09d2