aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2017-09-22 12:24:50 -0700
committerDavid Goldblatt <davidtgoldblatt@gmail.com>2018-01-10 21:01:18 -0800
commitf78d4ca3fbff6cab0c704c787706a53ddafcbe13 (patch)
tree8cc6a214bde51a42beb77ac92fe0d00dd44c0c90 /src
parentba5992fe9ac1708c812ec65bff3270bba17f1e1b (diff)
downloadplatform_external_jemalloc_new-f78d4ca3fbff6cab0c704c787706a53ddafcbe13.tar.gz
platform_external_jemalloc_new-f78d4ca3fbff6cab0c704c787706a53ddafcbe13.tar.bz2
platform_external_jemalloc_new-f78d4ca3fbff6cab0c704c787706a53ddafcbe13.zip
Modify configure to determine return value of strerror_r.
On glibc and Android's bionic, strerror_r returns char* when _GNU_SOURCE is defined. Add a configure check for this rather than assume glibc is the only libc that behaves this way.
Diffstat (limited to 'src')
-rw-r--r--src/malloc_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/malloc_io.c b/src/malloc_io.c
index 6b99afcd..fd27bd1c 100644
--- a/src/malloc_io.c
+++ b/src/malloc_io.c
@@ -111,7 +111,7 @@ buferror(int err, char *buf, size_t buflen) {
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0,
(LPSTR)buf, (DWORD)buflen, NULL);
return 0;
-#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
+#elif defined(JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE) && defined(_GNU_SOURCE)
char *b = strerror_r(err, buf, buflen);
if (b != buf) {
strncpy(buf, b, buflen);