0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

Fix problem with C99 inlines and -Werror=missing-prototypes

Some older versions of gcc (gcc 4.2.1 at least) produce a warning,
promoted to error, on C99 inlines.  Do some work to figure out if we
need to fall back to GNU inline syntax.

Fix some issues with GNU inline syntax.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin
2018-02-20 12:34:17 -08:00
parent 53371ddd17
commit 99d45c850e
4 changed files with 49 additions and 10 deletions

View File

@@ -214,15 +214,20 @@ size_t strnlen(const char *s, size_t maxlen);
/*
* Hack to support external-linkage inline functions
*/
#ifdef __GNUC__
# ifdef __GNUC_STDC_INLINE__
# define HAVE_STDC_INLINE
# else
# define HAVE_GNU_INLINE
# endif
#elif defined(__STDC_VERSION__)
# if __STDC_VERSION__ >= 199901L
# define HAVE_STDC_INLINE
#ifndef HAVE_STDC_INLINE
# ifdef __GNUC__
# ifdef __GNUC_STDC_INLINE__
# define HAVE_STDC_INLINE
# else
# define HAVE_GNU_INLINE
# endif
# elif defined(__GNUC_GNU_INLINE__)
/* Some other compiler implementing only GNU inline semantics? */
# define HAVE_GNU_INLINE
# elif defined(__STDC_VERSION__)
# if __STDC_VERSION__ >= 199901L
# define HAVE_STDC_INLINE
# endif
# endif
#endif
@@ -230,6 +235,7 @@ size_t strnlen(const char *s, size_t maxlen);
# define extern_inline inline
#elif defined(HAVE_GNU_INLINE)
# define extern_inline extern inline
# define inline_prototypes
#else
# define inline_prototypes
#endif