diff options
author | Werner Koch <[email protected]> | 2015-08-26 06:41:47 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2015-08-26 06:41:47 +0000 |
commit | 9cd3f002addf2acae4a7b0f52f8941e517e83d73 (patch) | |
tree | ddecda7e1d6c807779a1022aae45cc62588297c9 | |
parent | Update Ukrainian translation (diff) | |
download | libgpg-error-9cd3f002addf2acae4a7b0f52f8941e517e83d73.tar.gz libgpg-error-9cd3f002addf2acae4a7b0f52f8941e517e83d73.zip |
Add macro GPGRT_INLINE and avoid -Wundef warnings
* src/gpg-error.h.in (GPG_ERR_INLINE): Use #if defined for possible
undefined macros to avoid warnign with GCC's -Wundef option.
(GPGRT_INLINE): New.
--
I still consider using -Wundef for regular building a bad behaviour
because undefined macros have a well defined value in a cpp
conditional. That warning is useful for debugging build problems but
should not be used as standard warning option. Anyway, here is a fix.
-rw-r--r-- | src/gpg-error.h.in | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in index e85fbe5..0bdb567 100644 --- a/src/gpg-error.h.in +++ b/src/gpg-error.h.in @@ -1,25 +1,24 @@ /* gpg-error.h - Public interface to libgpg-error. -*- c -*- - Copyright (C) 2003, 2004, 2010, 2013, 2014, 2015 g10 Code GmbH - - This file is part of libgpg-error. - - libgpg-error is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License - as published by the Free Software Foundation; either version 2.1 of - the License, or (at your option) any later version. - - libgpg-error 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program; if not, see <http://www.gnu.org/licenses/>. - - @configure_input@ + * Copyright (C) 2003, 2004, 2010, 2013, 2014, 2015 g10 Code GmbH + * + * This file is part of libgpg-error. + * + * libgpg-error is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * libgpg-error 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see <http://www.gnu.org/licenses/>. + * + * @configure_input@ */ - #ifndef GPG_ERROR_H #define GPG_ERROR_H 1 @@ -28,15 +27,15 @@ #include <stdarg.h> #ifdef __GNUC__ -#define GPG_ERR_INLINE __inline__ -#elif _MSC_VER >= 1300 -#define GPG_ERR_INLINE __inline -#elif __STDC_VERSION__ >= 199901L -#define GPG_ERR_INLINE inline +# define GPG_ERR_INLINE __inline__ +#elif defined(_MSC_VER) && _MSC_VER >= 1300 +# define GPG_ERR_INLINE __inline +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define GPG_ERR_INLINE inline #else -#ifndef GPG_ERR_INLINE -#define GPG_ERR_INLINE -#endif +# ifndef GPG_ERR_INLINE +# define GPG_ERR_INLINE +# endif #endif #ifdef __cplusplus @@ -239,6 +238,8 @@ typedef unsigned int gpg_error_t; #endif +/* The new name for the inline macro. */ +#define GPGRT_INLINE GPG_ERR_INLINE /* Initialization function. */ |