aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-02-05 16:48:22 -0800
committerElliott Hughes <enh@google.com>2019-02-05 16:48:22 -0800
commit01809e1fd10bfd21bcdbecb8ca2ee81bc65f8374 (patch)
tree255ca3ed84fc17bf7faa552d420851de676fe388
parente7c5954b31c23d00a60ed2403660917df6c5ae9e (diff)
downloadandroid_bionic-01809e1fd10bfd21bcdbecb8ca2ee81bc65f8374.tar.gz
android_bionic-01809e1fd10bfd21bcdbecb8ca2ee81bc65f8374.tar.bz2
android_bionic-01809e1fd10bfd21bcdbecb8ca2ee81bc65f8374.zip
Switch to OpenBSD div/ldiv/lldiv.
Test: ran tests Change-Id: I6ecf5878162d7cee81af40edd4b44406196f49be
-rw-r--r--libc/Android.bp6
-rw-r--r--libc/upstream-openbsd/lib/libc/stdlib/div.c (renamed from libc/upstream-netbsd/lib/libc/stdlib/div.c)17
-rw-r--r--libc/upstream-openbsd/lib/libc/stdlib/ldiv.c (renamed from libc/upstream-netbsd/lib/libc/stdlib/ldiv.c)16
-rw-r--r--libc/upstream-openbsd/lib/libc/stdlib/lldiv.c (renamed from libc/upstream-netbsd/lib/libc/stdlib/lldiv.c)26
4 files changed, 16 insertions, 49 deletions
diff --git a/libc/Android.bp b/libc/Android.bp
index 51a7bf047..dc437d803 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -328,13 +328,10 @@ cc_library_static {
"upstream-netbsd/lib/libc/regex/regexec.c",
"upstream-netbsd/lib/libc/regex/regfree.c",
"upstream-netbsd/lib/libc/stdlib/bsearch.c",
- "upstream-netbsd/lib/libc/stdlib/div.c",
"upstream-netbsd/lib/libc/stdlib/drand48.c",
"upstream-netbsd/lib/libc/stdlib/erand48.c",
"upstream-netbsd/lib/libc/stdlib/jrand48.c",
"upstream-netbsd/lib/libc/stdlib/lcong48.c",
- "upstream-netbsd/lib/libc/stdlib/ldiv.c",
- "upstream-netbsd/lib/libc/stdlib/lldiv.c",
"upstream-netbsd/lib/libc/stdlib/lrand48.c",
"upstream-netbsd/lib/libc/stdlib/mrand48.c",
"upstream-netbsd/lib/libc/stdlib/nrand48.c",
@@ -452,13 +449,16 @@ cc_library_static {
"upstream-openbsd/lib/libc/stdio/wbuf.c",
"upstream-openbsd/lib/libc/stdio/wsetup.c",
"upstream-openbsd/lib/libc/stdlib/abs.c",
+ "upstream-openbsd/lib/libc/stdlib/div.c",
"upstream-openbsd/lib/libc/stdlib/getenv.c",
"upstream-openbsd/lib/libc/stdlib/getsubopt.c",
"upstream-openbsd/lib/libc/stdlib/insque.c",
"upstream-openbsd/lib/libc/stdlib/imaxabs.c",
"upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
"upstream-openbsd/lib/libc/stdlib/labs.c",
+ "upstream-openbsd/lib/libc/stdlib/ldiv.c",
"upstream-openbsd/lib/libc/stdlib/llabs.c",
+ "upstream-openbsd/lib/libc/stdlib/lldiv.c",
"upstream-openbsd/lib/libc/stdlib/lsearch.c",
"upstream-openbsd/lib/libc/stdlib/remque.c",
"upstream-openbsd/lib/libc/stdlib/setenv.c",
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/div.c b/libc/upstream-openbsd/lib/libc/stdlib/div.c
index f3bd32f26..beaa428c7 100644
--- a/libc/upstream-netbsd/lib/libc/stdlib/div.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/div.c
@@ -1,8 +1,7 @@
-/* $NetBSD: div.c,v 1.8 2012/06/25 22:32:45 abs Exp $ */
-
+/* $OpenBSD: div.c,v 1.6 2015/09/13 08:31:47 guenther Exp $ */
/*
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1990 Regents of the University of California.
+ * All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
@@ -32,15 +31,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)div.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: div.c,v 1.8 2012/06/25 22:32:45 abs Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
#include <stdlib.h> /* div_t */
div_t
@@ -79,3 +69,4 @@ div(int num, int denom)
}
return (r);
}
+DEF_STRONG(div);
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/ldiv.c b/libc/upstream-openbsd/lib/libc/stdlib/ldiv.c
index 507c831bf..775065f52 100644
--- a/libc/upstream-netbsd/lib/libc/stdlib/ldiv.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/ldiv.c
@@ -1,8 +1,7 @@
-/* $NetBSD: ldiv.c,v 1.8 2012/06/25 22:32:45 abs Exp $ */
-
+/* $OpenBSD: ldiv.c,v 1.5 2005/08/08 08:05:36 espie Exp $ */
/*
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1990 Regents of the University of California.
+ * All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
@@ -32,15 +31,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)ldiv.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: ldiv.c,v 1.8 2012/06/25 22:32:45 abs Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
#include <stdlib.h> /* ldiv_t */
ldiv_t
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/lldiv.c b/libc/upstream-openbsd/lib/libc/stdlib/lldiv.c
index 47104b378..59c37b878 100644
--- a/libc/upstream-netbsd/lib/libc/stdlib/lldiv.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/lldiv.c
@@ -1,8 +1,7 @@
-/* $NetBSD: lldiv.c,v 1.4 2012/06/25 22:32:45 abs Exp $ */
-
+/* $OpenBSD: lldiv.c,v 1.2 2016/08/14 23:18:03 guenther Exp $ */
/*
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1990 Regents of the University of California.
+ * All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
@@ -32,25 +31,10 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "from: @(#)ldiv.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: lldiv.c,v 1.4 2012/06/25 22:32:45 abs Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
#include <stdlib.h> /* lldiv_t */
-#ifdef __weak_alias
-__weak_alias(lldiv, _lldiv)
-#endif
-
-/* LONGLONG */
lldiv_t
-lldiv(long long int num, long long int denom)
+lldiv(long long num, long long denom)
{
lldiv_t r;
@@ -64,3 +48,5 @@ lldiv(long long int num, long long int denom)
}
return (r);
}
+
+__weak_alias(qdiv, lldiv);