diff options
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.c | 8 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.h | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index f5c1bea02..c2878e3d4 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1717,6 +1717,7 @@ AC_CHECK_FUNCS([ \ | |||
1717 | inet_ntoa \ | 1717 | inet_ntoa \ |
1718 | inet_ntop \ | 1718 | inet_ntop \ |
1719 | innetgr \ | 1719 | innetgr \ |
1720 | llabs \ | ||
1720 | login_getcapbool \ | 1721 | login_getcapbool \ |
1721 | md5_crypt \ | 1722 | md5_crypt \ |
1722 | memmove \ | 1723 | memmove \ |
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 6f3bc8f1d..cfd73260a 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c | |||
@@ -301,3 +301,11 @@ mbtowc(wchar_t *pwc, const char *s, size_t n) | |||
301 | return 1; | 301 | return 1; |
302 | } | 302 | } |
303 | #endif | 303 | #endif |
304 | |||
305 | #ifndef HAVE_LLABS | ||
306 | long long | ||
307 | llabs(long long j) | ||
308 | { | ||
309 | return (j < 0 ? -j : j); | ||
310 | } | ||
311 | #endif | ||
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index 6f08b09fa..70a538f04 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h | |||
@@ -135,4 +135,8 @@ void errx(int, const char *, ...) __attribute__((format(printf, 2, 3))); | |||
135 | void warn(const char *, ...) __attribute__((format(printf, 1, 2))); | 135 | void warn(const char *, ...) __attribute__((format(printf, 1, 2))); |
136 | #endif | 136 | #endif |
137 | 137 | ||
138 | #ifndef HAVE_LLABS | ||
139 | long long llabs(long long); | ||
140 | #endif | ||
141 | |||
138 | #endif /* _BSD_MISC_H */ | 142 | #endif /* _BSD_MISC_H */ |