]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/LibC/gdtoa/strtold_subr.c
StdLib/LibC/Uefi/Devices/Console/daConsole.c: Fix name of the XY offset union.
[mirror_edk2.git] / StdLib / LibC / gdtoa / strtold_subr.c
CommitLineData
2aa62f2b 1/* $NetBSD: strtold_subr.c,v 1.1 2006/03/15 17:35:18 kleink Exp $ */\r
2\r
3/*\r
4 * Written by Klaus Klein <kleink@NetBSD.org>, November 16, 2005.\r
5 * Public domain.\r
6 */\r
7\r
8/*\r
9 * NOTICE: This is not a standalone file. To use it, #include it in\r
10 * the format-specific strtold_*.c, like so:\r
11 *\r
12 * #define GDTOA_LD_FMT <gdtoa extended-precision format code>\r
13 * #include "strtold_subr.c"\r
14 */\r
15#include <LibConfig.h>\r
16#include <sys/EfiCdefs.h>\r
17\r
18#include "namespace.h"\r
19#include <math.h>\r
20#include <sys/stdint.h>\r
21#include <stdlib.h>\r
22#include "gdtoa.h"\r
23\r
24#ifdef __weak_alias\r
25__weak_alias(strtold, _strtold)\r
26#endif\r
27\r
28#ifndef __HAVE_LONG_DOUBLE\r
29#error no extended-precision long double type\r
30#endif\r
31\r
32#ifndef GDTOA_LD_FMT\r
33#error GDTOA_LD_FMT must be defined by format-specific source file\r
34#endif\r
35\r
36#define STRTOP(x) __CONCAT(strtop, x)\r
37\r
38long double\r
39strtold(const char *nptr, char **endptr)\r
40{\r
41 long double ld;\r
42\r
43 (void)STRTOP(GDTOA_LD_FMT)(nptr, endptr, &ld);\r
44 return ld;\r
45}\r