machdep_ldisQ.c revision 174204
141502Swpaul/*-
241502Swpaul * Copyright (c) 2003 David Schultz <das@FreeBSD.ORG>
341502Swpaul * All rights reserved.
441502Swpaul *
541502Swpaul * Redistribution and use in source and binary forms, with or without
641502Swpaul * modification, are permitted provided that the following conditions
741502Swpaul * are met:
841502Swpaul * 1. Redistributions of source code must retain the above copyright
941502Swpaul *    notice, this list of conditions and the following disclaimer.
1041502Swpaul * 2. Redistributions in binary form must reproduce the above copyright
1141502Swpaul *    notice, this list of conditions and the following disclaimer in the
1241502Swpaul *    documentation and/or other materials provided with the distribution.
1341502Swpaul *
1441502Swpaul * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1541502Swpaul * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1641502Swpaul * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1741502Swpaul * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1841502Swpaul * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1941502Swpaul * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2041502Swpaul * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2141502Swpaul * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2241502Swpaul * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2341502Swpaul * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2441502Swpaul * SUCH DAMAGE.
2541502Swpaul */
2641502Swpaul
2741502Swpaul/*
2841502Swpaul * Machine-dependent glue to integrate David Gay's gdtoa
2941502Swpaul * package into libc for architectures where a long double
3041502Swpaul * uses quad precision, such as sparc64.
3141502Swpaul */
3241502Swpaul
3341502Swpaul#include <sys/cdefs.h>
3441502Swpaul__FBSDID("$FreeBSD: head/lib/libc/gdtoa/machdep_ldisQ.c 174204 2007-12-03 07:17:33Z das $");
3541502Swpaul
3641502Swpaul#include <float.h>
3741502Swpaul
3841502Swpaul#include "gdtoaimp.h"
3941502Swpaul
4041502Swpaullong double
4141502Swpaulstrtold(const char * __restrict s, char ** __restrict sp)
4241502Swpaul{
4341502Swpaul	long double result;
4441502Swpaul
4541502Swpaul	strtorQ(s, sp, FLT_ROUNDS, &result);
4641502Swpaul	return result;
4741502Swpaul}
4841502Swpaul