OSDN Git Service

2a572204529f5eb17294dca7a7c25241309e86b7
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / tr1 / 8_c_compatibility / cwchar / functions.cc
1 // { dg-do compile }
2
3 // 2006-02-03  Paolo Carlini  <pcarlini@suse.de>
4 //
5 // Copyright (C) 2006, 2009 Free Software Foundation, Inc.
6 //
7 // This file is part of the GNU ISO C++ Library.  This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 3, or (at your option)
11 // any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License along
19 // with this library; see the file COPYING3.  If not see
20 // <http://www.gnu.org/licenses/>.
21
22 // 8.6 Additions to header <cwchar>
23
24 #include <tr1/cwchar>
25 #include <cstdio>
26 #include <cstdarg>
27
28 #if _GLIBCXX_USE_WCHAR_T
29
30 void test01(int dummy, ...)
31 {
32   std::va_list arg;
33   va_start(arg, dummy);
34
35 #if _GLIBCXX_HAVE_WCSTOF
36   const wchar_t* nptr1 = 0;
37   wchar_t** endptr1 = 0;
38   float fret;
39   fret = std::tr1::wcstof(nptr1, endptr1);
40 #endif
41
42 #if _GLIBCXX_HAVE_VFWSCANF
43   FILE* stream = 0;
44   const wchar_t* format1 = 0;
45   int ret1;
46   ret1 = std::tr1::vfwscanf(stream, format1, arg);
47 #endif
48
49 #if _GLIBCXX_HAVE_VSWSCANF
50   const wchar_t* s = 0;
51   const wchar_t* format2 = 0;
52   int ret2;
53   ret2 = std::tr1::vswscanf(s, format2, arg);
54 #endif
55
56 #if _GLIBCXX_HAVE_VWSCANF
57   const wchar_t* format3 = 0;
58   int ret3;
59   ret3 = std::tr1::vwscanf(format3, arg);
60 #endif
61
62 #if _GLIBCXX_USE_C99
63
64   const wchar_t* nptr2 = 0;
65   wchar_t** endptr2 = 0;
66   long double ldret;
67   ldret = std::tr1::wcstold(nptr2, endptr2);
68
69   int base = 0;
70   long long llret;
71   unsigned long long ullret;
72   llret = std::tr1::wcstoll(nptr2, endptr2, base);
73   ullret = std::tr1::wcstoull(nptr2, endptr2, base);
74
75 #endif
76 }
77
78 #endif