summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2018-01-31 03:05:14 +0000
committerWarner Losh <imp@FreeBSD.org>2018-01-31 03:05:14 +0000
commit5fe6063df9ba8249ed50b1c96642738296b5d3a8 (patch)
tree856589d4b72637f618782afa2aaecd0a1b9b1520 /lib/libc/stdlib
parent6e76bc32d4a4e816d5e58877b158554c86071cb8 (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/Makefile.inc2
-rw-r--r--lib/libc/stdlib/strtol.c6
-rw-r--r--lib/libc/stdlib/strtold.c45
3 files changed, 46 insertions, 7 deletions
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index 25850929efa8c..d20008f1c810e 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -15,7 +15,7 @@ MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
radixsort.c rand.c \
random.c reallocarray.c reallocf.c realpath.c remque.c \
set_constraint_handler_s.c strfmon.c strtoimax.c \
- strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \
+ strtol.c strtold.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \
strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c
# Work around an issue on case-insensitive file systems.
diff --git a/lib/libc/stdlib/strtol.c b/lib/libc/stdlib/strtol.c
index 8b53b740e8240..25212d8930ade 100644
--- a/lib/libc/stdlib/strtol.c
+++ b/lib/libc/stdlib/strtol.c
@@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include "xlocale_private.h"
-
/*
* Convert a string to a long integer.
*
@@ -153,8 +152,3 @@ strtol(const char * __restrict nptr, char ** __restrict endptr, int base)
{
return strtol_l(nptr, endptr, base, __get_locale());
}
-long double
-strtold(const char * __restrict nptr, char ** __restrict endptr)
-{
- return strtold_l(nptr, endptr, __get_locale());
-}
diff --git a/lib/libc/stdlib/strtold.c b/lib/libc/stdlib/strtold.c
new file mode 100644
index 0000000000000..06fe56eb78248
--- /dev/null
+++ b/lib/libc/stdlib/strtold.c
@@ -0,0 +1,45 @@
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ * Portions of this software were developed by David Chisnall
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <stdlib.h>
+#include "xlocale_private.h"
+
+long double
+strtold(const char * __restrict nptr, char ** __restrict endptr)
+{
+
+ return strtold_l(nptr, endptr, __get_locale());
+}