[openssh-commits] [openssh] 01/01: Add llabs() implementation.

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Mar 20 13:39:46 AEDT 2017


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit d38f05dbdd291212bc95ea80648b72b7177e9f4e
Author: Darren Tucker <dtucker at zip.com.au>
Date:   Mon Mar 20 13:38:27 2017 +1100

    Add llabs() implementation.
---
 configure.ac              | 1 +
 openbsd-compat/bsd-misc.c | 8 ++++++++
 openbsd-compat/bsd-misc.h | 4 ++++
 3 files changed, 13 insertions(+)

diff --git a/configure.ac b/configure.ac
index f5c1bea..c2878e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1717,6 +1717,7 @@ AC_CHECK_FUNCS([ \
 	inet_ntoa \
 	inet_ntop \
 	innetgr \
+	llabs \
 	login_getcapbool \
 	md5_crypt \
 	memmove \
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 6f3bc8f..cfd7326 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)
 	return 1;
 }
 #endif
+
+#ifndef HAVE_LLABS
+long long
+llabs(long long j)
+{
+	return (j < 0 ? -j : j);
+}
+#endif
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index 6f08b09..70a538f 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)));
 void warn(const char *, ...) __attribute__((format(printf, 1, 2)));
 #endif
 
+#ifndef HAVE_LLABS
+long long llabs(long long);
+#endif
+
 #endif /* _BSD_MISC_H */

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list