From 6b52d3e3a4e625d64278a58f193c6353c67f7c95 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 1 Aug 2020 21:28:47 +0200 Subject: libfshelp: Fix extern inline usage C99 extern inline semantic is different from GNU semantic, so we cannot blindly write "extern inline". * libfshelp/rlock.h (FSHELP_EXTERN_INLINE): Define to __extern_inline if not already. (rlock_list_init): Mark FSHELP_EXTERN_INLINE instead of extern inline. * libfshelp/fshelp.h (FSHELP_EXTERN_INLINE): Define to __extern_inline instead of extern inline. * libfshelp/extern-inline.c: Include "rlock.h" --- libfshelp/extern-inline.c | 1 + libfshelp/fshelp.h | 2 +- libfshelp/rlock.h | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'libfshelp') diff --git a/libfshelp/extern-inline.c b/libfshelp/extern-inline.c index 44424937..2572ab2e 100644 --- a/libfshelp/extern-inline.c +++ b/libfshelp/extern-inline.c @@ -21,4 +21,5 @@ #define FSHELP_EXTERN_INLINE #include "fshelp.h" +#include "rlock.h" diff --git a/libfshelp/fshelp.h b/libfshelp/fshelp.h index 62be94ab..40d65b39 100644 --- a/libfshelp/fshelp.h +++ b/libfshelp/fshelp.h @@ -19,7 +19,7 @@ #define _HURD_FSHELP_ #ifndef FSHELP_EXTERN_INLINE -#define FSHELP_EXTERN_INLINE extern inline +#define FSHELP_EXTERN_INLINE __extern_inline #endif /* This library implements various things that are generic to diff --git a/libfshelp/rlock.h b/libfshelp/rlock.h index 5c620279..e1b7b257 100644 --- a/libfshelp/rlock.h +++ b/libfshelp/rlock.h @@ -21,6 +21,10 @@ #ifndef FSHELP_RLOCK_H #define FSHELP_RLOCK_H +#ifndef FSHELP_EXTERN_INLINE +#define FSHELP_EXTERN_INLINE __extern_inline +#endif + #include #include @@ -45,7 +49,7 @@ struct rlock_list void *po_id; }; -extern inline error_t +FSHELP_EXTERN_INLINE error_t rlock_list_init (struct rlock_peropen *po, struct rlock_list *l) { memset (l, 0, sizeof (struct rlock_list)); -- cgit v1.2.3