diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-09-05 14:05:42 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-09-05 14:05:42 +0000 |
commit | 3ddd7c0d789d1857a4d3d08aaf4e2af8f993716a (patch) | |
tree | 7f8e1904b47f92e6e48ebe7ad92e63f168e33c6e /usr.bin/make | |
parent | 09b6f85f57dc18e8d9350a4dfcdbbd50b87f6e44 (diff) |
unifdef HAS_INLINES
inline is part of gnu89 and c99
ok kn@ espie@
Diffstat (limited to 'usr.bin/make')
-rw-r--r-- | usr.bin/make/defines.h | 10 | ||||
-rw-r--r-- | usr.bin/make/lst.h | 15 | ||||
-rw-r--r-- | 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_ */ |