From 0348eb56e1244abd1685eff3102211ffed8d2ac9 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 5 Sep 2023 14:05:41 +0000 Subject: [PATCH] unifdef HAS_INLINES inline is part of gnu89 and c99 ok kn@ espie@ --- usr.bin/make/defines.h | 10 +--------- usr.bin/make/lst.h | 15 +++------------ usr.bin/make/lst.lib/lst.h | 15 +++------------ 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/usr.bin/make/defines.h b/usr.bin/make/defines.h index 05b29dcf039..4fd99c52eed 100644 --- a/usr.bin/make/defines.h +++ b/usr.bin/make/defines.h @@ -1,7 +1,7 @@ #ifndef DEFINES_H #define DEFINES_H -/* $OpenBSD: defines.h,v 1.15 2015/10/14 13:50:22 espie Exp $ */ +/* $OpenBSD: defines.h,v 1.16 2023/09/05 14:05:41 jsg Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -61,18 +61,10 @@ typedef struct Suff_ Suff; #ifdef __GNUC__ # define UNUSED __attribute__((__unused__)) -# define HAS_INLINES -# define INLINE __inline__ #else # define UNUSED #endif -#ifdef HAS_INLINES -# ifndef INLINE -# define INLINE inline -# endif -#endif - /* * debug control: * There is one bit per module. It is up to the module what debug diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h index c3a745069e1..4d8ad571367 100644 --- a/usr.bin/make/lst.h +++ b/usr.bin/make/lst.h @@ -1,7 +1,7 @@ #ifndef _LST_H_ #define _LST_H_ -/* $OpenBSD: lst.h,v 1.33 2021/03/04 09:45:31 espie Exp $ */ +/* $OpenBSD: lst.h,v 1.34 2023/09/05 14:05:41 jsg Exp $ */ /* $NetBSD: lst.h,v 1.7 1996/11/06 17:59:12 christos Exp $ */ /* @@ -159,25 +159,16 @@ extern void * Lst_DeQueue(Lst); #define Lst_Adv(ln) ((ln)->nextPtr) #define Lst_Rev(ln) ((ln)->prevPtr) - -/* Inlines are preferable to macros here because of the type checking. */ -#ifdef HAS_INLINES -static INLINE LstNode +static inline LstNode Lst_FindConst(Lst l, FindProcConst cProc, const void *d) { return Lst_FindFrom(Lst_First(l), (FindProc)cProc, (void *)d); } -static INLINE LstNode +static inline LstNode Lst_FindFromConst(LstNode ln, FindProcConst cProc, const void *d) { return Lst_FindFrom(ln, (FindProc)cProc, (void *)d); } -#else -#define Lst_FindConst(l, cProc, d) \ - Lst_FindFrom(Lst_First(l), (FindProc)cProc, (void *)d) -#define Lst_FindFromConst(ln, cProc, d) \ - Lst_FindFrom(ln, (FindProc)cProc, (void *)d) -#endif #endif /* _LST_H_ */ diff --git a/usr.bin/make/lst.lib/lst.h b/usr.bin/make/lst.lib/lst.h index a05dc78781d..cce991888dd 100644 --- a/usr.bin/make/lst.lib/lst.h +++ b/usr.bin/make/lst.lib/lst.h @@ -1,7 +1,7 @@ #ifndef _LST_H_ #define _LST_H_ -/* $OpenBSD: lst.h,v 1.2 2015/10/14 13:52:11 espie Exp $ */ +/* $OpenBSD: lst.h,v 1.3 2023/09/05 14:05:41 jsg Exp $ */ /* $NetBSD: lst.h,v 1.7 1996/11/06 17:59:12 christos Exp $ */ /* @@ -154,25 +154,16 @@ extern void * Lst_DeQueue(Lst); #define Lst_Adv(ln) ((ln)->nextPtr) #define Lst_Rev(ln) ((ln)->prevPtr) - -/* Inlines are preferable to macros here because of the type checking. */ -#ifdef HAS_INLINES -static INLINE LstNode +static inline LstNode Lst_FindConst(Lst l, FindProcConst cProc, const void *d) { return Lst_FindFrom(Lst_First(l), (FindProc)cProc, (void *)d); } -static INLINE LstNode +static inline LstNode Lst_FindFromConst(LstNode ln, FindProcConst cProc, const void *d) { return Lst_FindFrom(ln, (FindProc)cProc, (void *)d); } -#else -#define Lst_FindConst(l, cProc, d) \ - Lst_FindFrom(Lst_First(l), (FindProc)cProc, (void *)d) -#define Lst_FindFromConst(ln, cProc, d) \ - Lst_FindFrom(ln, (FindProc)cProc, (void *)d) -#endif #endif /* _LST_H_ */ -- 2.20.1