Hide the declaration of ffs() if an inline ffs() is implemented.
I couldn't find a better way to avoid compiler warnings about redundant and/or inconsistent declaration of ffs(). I'd like to be able to declare prototypes in general headers without committing to implementing them as `static inline' or `extern', but there seems to be no way to do this with gcc-2.6.1. E.g., int foo(void); static __inline int foo(void) { return 1; } causes a warning about the linkage mismatch, while the opposite order causes a warning about the redundant declaration.
This commit is contained in:
parent
e77e2e6ca1
commit
1b099e1e02
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4477
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)libkern.h 8.1 (Berkeley) 6/10/93
|
||||
* $Id: libkern.h,v 1.3 1994/08/30 18:19:47 davidg Exp $
|
||||
* $Id: libkern.h,v 1.4 1994/09/18 23:04:25 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -49,7 +49,9 @@ static inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); }
|
||||
|
||||
/* Prototypes for non-quad routines. */
|
||||
int bcmp __P((const void *, const void *, size_t));
|
||||
#ifndef HAVE_INLINE_FFS
|
||||
int ffs __P((int));
|
||||
#endif
|
||||
int locc __P((int, char *, u_int));
|
||||
u_long random __P((void));
|
||||
char *rindex __P((const char *, int));
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)libkern.h 8.1 (Berkeley) 6/10/93
|
||||
* $Id: libkern.h,v 1.3 1994/08/30 18:19:47 davidg Exp $
|
||||
* $Id: libkern.h,v 1.4 1994/09/18 23:04:25 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -49,7 +49,9 @@ static inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); }
|
||||
|
||||
/* Prototypes for non-quad routines. */
|
||||
int bcmp __P((const void *, const void *, size_t));
|
||||
#ifndef HAVE_INLINE_FFS
|
||||
int ffs __P((int));
|
||||
#endif
|
||||
int locc __P((int, char *, u_int));
|
||||
u_long random __P((void));
|
||||
char *rindex __P((const char *, int));
|
||||
|
Loading…
Reference in New Issue
Block a user