1 From 8151579eb36d9366632242415ff3f5177fa5e1e2 Mon Sep 17 00:00:00 2001
2 From: Rosen Penev <rosenp@gmail.com>
3 Date: Thu, 3 Oct 2019 18:58:43 -0700
4 Subject: [PATCH] uClibc++: Make long long available to C++11
6 C++11 makes long long available. It is no longer a GNU extension.
8 Signed-off-by: Rosen Penev <rosenp@gmail.com>
10 include/istream | 4 ++--
11 include/istream_helpers | 2 +-
12 include/ostream | 8 ++++----
13 include/ostream_helpers | 8 ++++----
14 tests/sstreamtest.cpp | 4 ++--
15 5 files changed, 13 insertions(+), 13 deletions(-)
19 @@ -72,7 +72,7 @@ namespace std{
20 basic_istream<charT,traits>& operator>>(void*& p);
21 basic_istream<charT,traits>& operator>>(basic_streambuf<char_type,traits>* sb);
23 -#ifndef __STRICT_ANSI__
24 +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
25 basic_istream<charT,traits>& operator>>(long long& n);
26 basic_istream<charT,traits>& operator>>(unsigned long long& n);
28 @@ -455,7 +455,7 @@ namespace std{
32 -#ifndef __STRICT_ANSI__
33 +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
34 template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>&
35 basic_istream<charT,traits>::operator>>(long long& n)
37 --- a/include/istream_helpers
38 +++ b/include/istream_helpers
39 @@ -301,7 +301,7 @@ namespace std{
43 -#ifndef __STRICT_ANSI__
44 +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
45 template <class traits> class _UCXXEXPORT __istream_readin<traits, char, long long>{
47 inline static void readin(basic_istream<char, traits >& stream, long long & var)
50 @@ -85,7 +85,7 @@ namespace std {
51 basic_ostream<charT,traits>& operator<<(long double f);
52 basic_ostream<charT,traits>& operator<<(void* p);
53 basic_ostream<charT,traits>& operator<<(basic_streambuf<char_type,traits>* sb);
54 -#ifndef __STRICT_ANSI__
55 +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
56 basic_ostream<charT,traits>& operator<<(long long n);
57 basic_ostream<charT,traits>& operator<<(unsigned long long n);
59 @@ -221,7 +221,7 @@ namespace std {
63 -#ifndef __STRICT_ANSI__
64 +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
65 template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(long long n)
68 @@ -487,7 +487,7 @@ namespace std {
72 -#ifndef __STRICT_ANSI__
73 +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
75 //Support for output of long long data types
77 @@ -509,7 +509,7 @@ template<class Ch, class Tr> _UCXXEXPORT
81 -#endif //__STRICT_ANSI__
82 +#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
86 --- a/include/ostream_helpers
87 +++ b/include/ostream_helpers
88 @@ -142,7 +142,7 @@ namespace std{
92 -#ifndef __STRICT_ANSI__
93 +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
95 template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, signed long long int>{
97 @@ -237,7 +237,7 @@ namespace std{
101 -#endif //__STRICT_ANSI__
102 +#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
104 template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, double>{
106 @@ -357,7 +357,7 @@ namespace std{
110 -#ifndef __STRICT_ANSI__
111 +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
113 template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, signed long long int>{
115 @@ -428,7 +428,7 @@ namespace std{
119 -#endif //__STRICT_ANSI__
120 +#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
122 template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, double>{
124 --- a/tests/sstreamtest.cpp
125 +++ b/tests/sstreamtest.cpp
126 @@ -9,7 +9,7 @@ int main(){
130 -#ifndef __STRICT_ANSI__
131 +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
133 unsigned long long ull;
135 @@ -32,7 +32,7 @@ int main(){
139 -#ifndef __STRICT_ANSI__
140 +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
143 std::cout << "ll (should be 678): " << ll << std::endl;