Back to index

glibc  2.9
strtold_l.c
Go to the documentation of this file.
00001 /* Copyright (C) 1999, 2002, 2004, 2007 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #include <math.h>
00020 #include <stdlib.h>
00021 #include <xlocale.h>
00022 
00023 #if defined _LIBC || defined HAVE_WCHAR_H
00024 # include <wchar.h>
00025 #endif
00026 
00027 #ifdef USE_WIDE_CHAR
00028 # define STRING_TYPE wchar_t
00029 # define STRTOLD     wcstold_l
00030 # define __STRTOLD   __wcstold_l
00031 # define __STRTOD    __wcstod_l
00032 #else
00033 # define STRING_TYPE char
00034 # define STRTOLD     strtold_l
00035 # define __STRTOLD   __strtold_l
00036 # define __STRTOD    __strtod_l
00037 #endif
00038 
00039 #define INTERNAL(x) INTERNAL1(x)
00040 #define INTERNAL1(x) __##x##_internal
00041 
00042 extern double INTERNAL (__STRTOD) (const STRING_TYPE *, STRING_TYPE **,
00043                                int, __locale_t);
00044 
00045 /* There is no `long double' type, use the `double' implementations.  */
00046 long double
00047 INTERNAL (__STRTOLD) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
00048                     int group, __locale_t loc)
00049 {
00050   return INTERNAL (__STRTOD) (nptr, endptr, group, loc);
00051 }
00052 #ifndef USE_WIDE_CHAR
00053 libc_hidden_def (INTERNAL (__STRTOLD))
00054 #endif
00055 
00056 long double
00057 weak_function
00058 __STRTOLD (const STRING_TYPE *nptr, STRING_TYPE **endptr, __locale_t loc)
00059 {
00060   return INTERNAL (__STRTOD) (nptr, endptr, 0, loc);
00061 }
00062 #if defined _LIBC
00063 libc_hidden_def (__STRTOLD)
00064 libc_hidden_ver (__STRTOLD, STRTOLD)
00065 #endif
00066 weak_alias (__STRTOLD, STRTOLD)