summaryrefslogtreecommitdiffstats
path: root/package/libs/uclibc++/patches/004-uClibc-Make-long-long-available-to-C-11.patch
blob: 6e13f22c8a505b838790b9f1bd99da24e7aa887a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
From 8151579eb36d9366632242415ff3f5177fa5e1e2 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Thu, 3 Oct 2019 18:58:43 -0700
Subject: [PATCH] uClibc++: Make long long available to C++11

C++11 makes long long available. It is no longer a GNU extension.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 include/istream         | 4 ++--
 include/istream_helpers | 2 +-
 include/ostream         | 8 ++++----
 include/ostream_helpers | 8 ++++----
 tests/sstreamtest.cpp   | 4 ++--
 5 files changed, 13 insertions(+), 13 deletions(-)

--- a/include/istream
+++ b/include/istream
@@ -72,7 +72,7 @@ namespace std{
 		basic_istream<charT,traits>& operator>>(void*& p);
 		basic_istream<charT,traits>& operator>>(basic_streambuf<char_type,traits>* sb);
 
-#ifndef __STRICT_ANSI__
+#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 		basic_istream<charT,traits>& operator>>(long long& n);
 		basic_istream<charT,traits>& operator>>(unsigned long long& n);
 #endif
@@ -455,7 +455,7 @@ namespace std{
 		return *this;
 	}
 
-#ifndef __STRICT_ANSI__
+#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 	template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>&
 		basic_istream<charT,traits>::operator>>(long long& n)
 	{
--- a/include/istream_helpers
+++ b/include/istream_helpers
@@ -301,7 +301,7 @@ namespace std{
 	};
 
 
-#ifndef __STRICT_ANSI__
+#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 	template <class traits> class _UCXXEXPORT __istream_readin<traits, char, long long>{
 	public:
 		inline static void readin(basic_istream<char, traits >& stream, long long & var)
--- a/include/ostream
+++ b/include/ostream
@@ -85,7 +85,7 @@ namespace std {
 		basic_ostream<charT,traits>& operator<<(long double f);
 		basic_ostream<charT,traits>& operator<<(void* p);
 		basic_ostream<charT,traits>& operator<<(basic_streambuf<char_type,traits>* sb);
-#ifndef __STRICT_ANSI__
+#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 		basic_ostream<charT,traits>& operator<<(long long n);
 		basic_ostream<charT,traits>& operator<<(unsigned long long n);
 #endif
@@ -221,7 +221,7 @@ namespace std {
 		return *this;
 	}
 
-#ifndef __STRICT_ANSI__
+#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 	template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(long long n)
 	{
 		sentry s(*this);
@@ -487,7 +487,7 @@ namespace std {
 #endif
 
 
-#ifndef __STRICT_ANSI__
+#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 
 //Support for output of long long data types
 
@@ -509,7 +509,7 @@ template<class Ch, class Tr> _UCXXEXPORT
 }
 
 
-#endif	//__STRICT_ANSI__
+#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 
 
 
--- a/include/ostream_helpers
+++ b/include/ostream_helpers
@@ -142,7 +142,7 @@ namespace std{
 		}
 	};
 
-#ifndef __STRICT_ANSI__
+#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 
 	template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, signed long long int>{
 	public:
@@ -237,7 +237,7 @@ namespace std{
 	};
 
 
-#endif	//__STRICT_ANSI__
+#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 
 	template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, double>{
 	public:
@@ -357,7 +357,7 @@ namespace std{
 		}
 	};
 
-#ifndef __STRICT_ANSI__
+#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 
 	template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, signed long long int>{
 	public:
@@ -428,7 +428,7 @@ namespace std{
 	};
 
 
-#endif	//__STRICT_ANSI__
+#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 
 	template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, double>{
 	public:
--- a/tests/sstreamtest.cpp
+++ b/tests/sstreamtest.cpp
@@ -9,7 +9,7 @@ int main(){
 	int i;
 	std::string s;
 	char c;
-#ifndef __STRICT_ANSI__
+#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 	long long ll;
 	unsigned long long ull;
 #endif
@@ -32,7 +32,7 @@ int main(){
 
 
 
-#ifndef __STRICT_ANSI__
+#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
 	a.str("678 76 54");
 	a >> ll >> ull >> s;
 	std::cout << "ll (should be 678): " << ll << std::endl;