summaryrefslogtreecommitdiffstats
path: root/libc/stdlib
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-03-13 16:17:43 -0700
committerElliott Hughes <enh@google.com>2014-03-13 16:17:43 -0700
commit205c7887add8b8c85434c35158138f16265beb28 (patch)
tree7220cc9b0d62a236ae7e248acd053195cb1a7575 /libc/stdlib
parentd16100c1fb8a39215497243ecb12176e9688ef77 (diff)
downloadbionic-205c7887add8b8c85434c35158138f16265beb28.zip
bionic-205c7887add8b8c85434c35158138f16265beb28.tar.gz
bionic-205c7887add8b8c85434c35158138f16265beb28.tar.bz2
Clean up reentrancy cruft.
The DNS copy of reentrant.h was unused, so remove it. The strtod implementation can use the upstream-netbsd reentrant.h and get a little closer to what was then upstream. (It's since been replaced by gdtoa, and we'll have to follow at some point, but for now this doesn't make anything any worse.) ANDROID_CHANGES is (now) only used in the DNS code, so push the -D down. The <locale.h> change prevents an LP32 hack from leaking into LP64. Change-Id: Idf30b98a59d7ca8f7c6cd6d07020b512057911ef
Diffstat (limited to 'libc/stdlib')
-rw-r--r--libc/stdlib/strtod.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/libc/stdlib/strtod.c b/libc/stdlib/strtod.c
index 3934d9a..0a19446 100644
--- a/libc/stdlib/strtod.c
+++ b/libc/stdlib/strtod.c
@@ -91,12 +91,6 @@
* directly -- and assumed always to succeed.
*/
-#ifdef ANDROID_CHANGES
-#include <pthread.h>
-#define mutex_lock(x) pthread_mutex_lock(x)
-#define mutex_unlock(x) pthread_mutex_unlock(x)
-#endif
-
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: strtod.c,v 1.45.2.1 2005/04/19 13:35:54 tron Exp $");
@@ -151,18 +145,14 @@ __RCSID("$NetBSD: strtod.c,v 1.45.2.1 2005/04/19 13:35:54 tron Exp $");
#ifndef KR_headers
#include "stdlib.h"
#include "string.h"
-#ifndef ANDROID_CHANGES
#include "locale.h"
-#endif /* ANDROID_CHANGES */
#else
#include "malloc.h"
#include "memory.h"
#endif
#endif
-#ifndef ANDROID_CHANGES
-#include "extern.h"
-#include "reentrant.h"
-#endif /* ANDROID_CHANGES */
+#include "../upstream-netbsd/extern.h" /* Android-changed. */
+#include "../upstream-netbsd/reentrant.h" /* Android-changed. */
#ifdef MALLOC
#ifdef KR_headers
@@ -370,13 +360,9 @@ Bigint {
static Bigint *freelist[Kmax+1];
-#ifdef ANDROID_CHANGES
- static pthread_mutex_t freelist_mutex = PTHREAD_MUTEX_INITIALIZER;
-#else
#ifdef _REENTRANT
static mutex_t freelist_mutex = MUTEX_INITIALIZER;
#endif
-#endif
/* Special value used to indicate an invalid Bigint value,
* e.g. when a memory allocation fails. The idea is that we
@@ -1346,16 +1332,14 @@ strtod
Bigint *bb1, *bd0;
Bigint *bb = NULL, *bd = NULL, *bs = NULL, *delta = NULL;/* pacify gcc */
-#ifdef ANDROID_CHANGES
CONST char decimal_point = '.';
-#else /* ANDROID_CHANGES */
+#if 0 /* BEGIN android-changed: no localeconv. */
#ifndef KR_headers
CONST char decimal_point = localeconv()->decimal_point[0];
#else
CONST char decimal_point = '.';
#endif
-
-#endif /* ANDROID_CHANGES */
+#endif /* END android-changed */
sign = nz0 = nz = 0;
value(rv) = 0.;