tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: _XOPEN_SOURCE problem?



In article <201501081217.19083.phil%NetBSD.org@localhost>,
Phil Nelson  <phil%NetBSD.org@localhost> wrote:
>On Thursday 08 January 2015 07:56:41 Christos Zoulas wrote:
>> In article <m8m83d$2qb$1%ger.gmane.org@localhost>,
>> Christos Zoulas <christos%astron.com@localhost> wrote:
>>...
>> I can't reproduce it; what version of the compiler and OS?
>
>$ cat junk.cpp
>#define _XOPEN_SOURCE 600
>#include <string>
>
>int main()
>{
>  return 0;
>}
>$ g++ junk.cpp
>In file included from /usr/include/g++/bits/postypes.h:42:0,
>                 from /usr/include/g++/bits/char_traits.h:42,
>                 from /usr/include/g++/string:42,
>                 from junk.cpp:2:
>/usr/include/g++/cwchar:166:11: error: '::vfwscanf' has not been declared
>/usr/include/g++/cwchar:172:11: error: '::vswscanf' has not been declared
>/usr/include/g++/cwchar:176:11: error: '::vwscanf' has not been declared
>/usr/include/g++/cwchar:193:11: error: '::wcstof' has not been declared
>$ uname -a
>NetBSD wallace 6.1.5 NetBSD 6.1.5 (GENERIC) i386
>$ g++ --version
>g++ (NetBSD nb2 20110806) 4.5.3
>Copyright (C) 2010 Free Software Foundation, Inc.
>This is free software; see the source for copying conditions.  There is NO
>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
>
>Also same results on  5.1 / gcc 4.1.3 (i386)
>
>And:
>mirror[6]$ uname -a
>NetBSD mirror 6.1.2 NetBSD 6.1.2 (GENERIC) amd64

Sent pullups to both -5 and -6...

--- /usr/include/wchar.h	2014-12-07 06:08:22.000000000 -0500
+++ ./wchar.h	2015-01-09 10:13:31.000000000 -0500
@@ -145,7 +145,8 @@
 double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
 
 #if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) > 199901L || \
-    defined(_NETBSD_SOURCE)
+    defined(_NETBSD_SOURCE) || \
+        (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600
 float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
 long double wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
 
@@ -181,7 +182,8 @@
 int wprintf(const wchar_t * __restrict, ...);
 int wscanf(const wchar_t * __restrict, ...);
 #if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) > 199901L || \
-    defined(_NETBSD_SOURCE)
+    defined(_NETBSD_SOURCE) || \
+        (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600
 int vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list);
 int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
     __va_list);



Home | Main Index | Thread Index | Old Index