machdep_ldisQ.c revision 174204
1139749Simp/*-
2119815Smarcel * Copyright (c) 2003 David Schultz <das@FreeBSD.ORG>
3119815Smarcel * All rights reserved.
4119815Smarcel *
5119815Smarcel * Redistribution and use in source and binary forms, with or without
6119815Smarcel * modification, are permitted provided that the following conditions
7119815Smarcel * are met:
8119815Smarcel * 1. Redistributions of source code must retain the above copyright
9119815Smarcel *    notice, this list of conditions and the following disclaimer.
10119815Smarcel * 2. Redistributions in binary form must reproduce the above copyright
11119815Smarcel *    notice, this list of conditions and the following disclaimer in the
12119815Smarcel *    documentation and/or other materials provided with the distribution.
13119815Smarcel *
14119815Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15119815Smarcel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16119815Smarcel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17119815Smarcel * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18119815Smarcel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19119815Smarcel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20119815Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21119815Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22119815Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23119815Smarcel * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24119815Smarcel * SUCH DAMAGE.
25119815Smarcel */
26119815Smarcel
27119815Smarcel/*
28119815Smarcel * Machine-dependent glue to integrate David Gay's gdtoa
29119815Smarcel * package into libc for architectures where a long double
30119815Smarcel * uses quad precision, such as sparc64.
31119815Smarcel */
32119815Smarcel
33119815Smarcel#include <sys/cdefs.h>
34119815Smarcel__FBSDID("$FreeBSD: head/lib/libc/gdtoa/machdep_ldisQ.c 174204 2007-12-03 07:17:33Z das $");
35119815Smarcel
36119815Smarcel#include <float.h>
37119815Smarcel
38119815Smarcel#include "gdtoaimp.h"
39119815Smarcel
40137949Smarcellong double
41137949Smarcelstrtold(const char * __restrict s, char ** __restrict sp)
42119815Smarcel{
43119815Smarcel	long double result;
44119815Smarcel
45119815Smarcel	strtorQ(s, sp, FLT_ROUNDS, &result);
46119815Smarcel	return result;
47119815Smarcel}
48119815Smarcel