From c66b3128ec3d52897a2083b66574b8090bd11b1e Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sun, 20 Jan 2019 18:33:04 +0100 Subject: [PATCH] Use wcstod_l on NetBSD It has wcstod_l, but not uselocale, so we can't use the fallback. --- src/fallback.cpp | 2 +- src/fallback.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/fallback.cpp b/src/fallback.cpp index bcfc4d926..4826426b9 100644 --- a/src/fallback.cpp +++ b/src/fallback.cpp @@ -389,7 +389,7 @@ int flock(int fd, int op) { #endif // HAVE_FLOCK -#ifndef HAVE_WCSTOD_L +#if !defined(HAVE_WCSTOD_L) && !defined(__NetBSD__) #undef wcstod_l // For platforms without wcstod_l C extension, wrap wcstod after changing the // thread-specific locale. diff --git a/src/fallback.h b/src/fallback.h index 0a94c2b5f..62422f923 100644 --- a/src/fallback.h +++ b/src/fallback.h @@ -199,7 +199,10 @@ int flock(int fd, int op); #endif -#ifndef HAVE_WCSTOD_L +// NetBSD _has_ wcstod_l, but it's doing some weak linking hullabaloo that I don't get. +// Since it doesn't have uselocale (yes, the standard function isn't there, the non-standard extension is), +// we can't try to use the fallback. +#if !defined(HAVE_WCSTOD_L) && !defined(__NetBSD__) // On some platforms if this is incorrectly detected and a system-defined // defined version of `wcstod_l` exists, calling `wcstod` from our own // `wcstod_l` can call back into `wcstod_l` causing infinite recursion.