summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2010-10-01 20:10:24 +0000
committerguenther <guenther@openbsd.org>2010-10-01 20:10:24 +0000
commit2095efaf7036da3ac85f05ac847e1653e10f9470 (patch)
tree4d3e1816147d337fdec9d60608cb634325853ad2
parentImplemented combus to support com device on OCTEON without modifing dev/ic/com.c ok deraadt@ (diff)
downloadwireguard-openbsd-2095efaf7036da3ac85f05ac847e1653e10f9470.tar.xz
wireguard-openbsd-2095efaf7036da3ac85f05ac847e1653e10f9470.zip
Now that __only_inline is in <sys/cdefs.h>, replace the local versions in
<ctype.h> and <signal.h> ok kettenis@ millert@ deraadt@
-rw-r--r--include/ctype.h51
-rw-r--r--include/signal.h18
2 files changed, 26 insertions, 43 deletions
diff --git a/include/ctype.h b/include/ctype.h
index 7a50f4e7463..57c3a2b64e6 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctype.h,v 1.21 2010/07/25 15:35:29 kettenis Exp $ */
+/* $OpenBSD: ctype.h,v 1.22 2010/10/01 20:10:24 guenther Exp $ */
/* $NetBSD: ctype.h,v 1.14 1994/10/26 00:55:47 cgd Exp $ */
/*
@@ -57,17 +57,6 @@ extern const char *_ctype_;
extern const short *_tolower_tab_;
extern const short *_toupper_tab_;
-/* extern __inline is a GNU C extension */
-#ifdef __GNUC__
-# if __GNUC_PREREQ__(4, 2)
-#define __CTYPE_INLINE extern __inline __attribute__((__gnu_inline__))
-# else
-#define __CTYPE_INLINE extern __inline
-# endif
-#else
-#define __CTYPE_INLINE static __inline
-#endif
-
#if defined(__GNUC__) || defined(_ANSI_LIBRARY) || defined(lint)
int isalnum(int);
int isalpha(int);
@@ -99,69 +88,69 @@ int _toupper(int);
#if !defined(_ANSI_LIBRARY) && !defined(lint)
-__CTYPE_INLINE int isalnum(int c)
+__only_inline int isalnum(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L|_N)));
}
-__CTYPE_INLINE int isalpha(int c)
+__only_inline int isalpha(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L)));
}
-__CTYPE_INLINE int iscntrl(int c)
+__only_inline int iscntrl(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _C));
}
-__CTYPE_INLINE int isdigit(int c)
+__only_inline int isdigit(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _N));
}
-__CTYPE_INLINE int isgraph(int c)
+__only_inline int isgraph(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N)));
}
-__CTYPE_INLINE int islower(int c)
+__only_inline int islower(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _L));
}
-__CTYPE_INLINE int isprint(int c)
+__only_inline int isprint(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N|_B)));
}
-__CTYPE_INLINE int ispunct(int c)
+__only_inline int ispunct(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _P));
}
-__CTYPE_INLINE int isspace(int c)
+__only_inline int isspace(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _S));
}
-__CTYPE_INLINE int isupper(int c)
+__only_inline int isupper(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _U));
}
-__CTYPE_INLINE int isxdigit(int c)
+__only_inline int isxdigit(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_N|_X)));
}
-__CTYPE_INLINE int tolower(int c)
+__only_inline int tolower(int c)
{
if ((unsigned int)c > 255)
return (c);
return ((_tolower_tab_ + 1)[c]);
}
-__CTYPE_INLINE int toupper(int c)
+__only_inline int toupper(int c)
{
if ((unsigned int)c > 255)
return (c);
@@ -170,29 +159,29 @@ __CTYPE_INLINE int toupper(int c)
#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __POSIX_VISIBLE > 200112 \
|| __XPG_VISIBLE > 600
-__CTYPE_INLINE int isblank(int c)
+__only_inline int isblank(int c)
{
return (c == ' ' || c == '\t');
}
#endif
#if __BSD_VISIBLE || __XPG_VISIBLE
-__CTYPE_INLINE int isascii(int c)
+__only_inline int isascii(int c)
{
return ((unsigned int)c <= 0177);
}
-__CTYPE_INLINE int toascii(int c)
+__only_inline int toascii(int c)
{
return (c & 0177);
}
-__CTYPE_INLINE int _tolower(int c)
+__only_inline int _tolower(int c)
{
return (c - 'A' + 'a');
}
-__CTYPE_INLINE int _toupper(int c)
+__only_inline int _toupper(int c)
{
return (c - 'a' + 'A');
}
@@ -202,6 +191,4 @@ __CTYPE_INLINE int _toupper(int c)
__END_DECLS
-#undef __CTYPE_INLINE
-
#endif /* !_CTYPE_H_ */
diff --git a/include/signal.h b/include/signal.h
index 6af20ad0f5d..7c6724d9fc4 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: signal.h,v 1.13 2010/07/26 07:08:22 kettenis Exp $ */
+/* $OpenBSD: signal.h,v 1.14 2010/10/01 20:10:24 guenther Exp $ */
/* $NetBSD: signal.h,v 1.8 1996/02/29 00:04:57 jtc Exp $ */
/*-
@@ -62,13 +62,9 @@ int sigpending(sigset_t *);
int sigprocmask(int, const sigset_t *, sigset_t *);
int sigsuspend(const sigset_t *);
-#if defined(__GNUC__)
-# if __GNUC_PREREQ__(4, 2)
-#define __SIGNAL_INLINE extern __inline __attribute((__gnu_inline__))
-# else
-#define __SIGNAL_INLINE extern __inline
-# endif
-__SIGNAL_INLINE int sigaddset(sigset_t *set, int signo) {
+#if !defined(_ANSI_LIBRARY) && !defined(lint)
+
+__only_inline int sigaddset(sigset_t *set, int signo) {
int *__errno(void);
if (signo <= 0 || signo >= _NSIG) {
@@ -79,7 +75,7 @@ __SIGNAL_INLINE int sigaddset(sigset_t *set, int signo) {
return (0);
}
-__SIGNAL_INLINE int sigdelset(sigset_t *set, int signo) {
+__only_inline int sigdelset(sigset_t *set, int signo) {
int *__errno(void);
if (signo <= 0 || signo >= _NSIG) {
@@ -90,7 +86,7 @@ __SIGNAL_INLINE int sigdelset(sigset_t *set, int signo) {
return (0);
}
-__SIGNAL_INLINE int sigismember(const sigset_t *set, int signo) {
+__only_inline int sigismember(const sigset_t *set, int signo) {
int *__errno(void);
if (signo <= 0 || signo >= _NSIG) {
@@ -99,7 +95,7 @@ __SIGNAL_INLINE int sigismember(const sigset_t *set, int signo) {
}
return ((*set & (1 << ((signo)-1))) != 0);
}
-#endif
+#endif /* !_ANSI_LIBRARY && !lint */
/* List definitions after function declarations, or Reiser cpp gets upset. */
#define sigemptyset(set) (*(set) = 0, 0)