From 6ab386c9bc23420816fbcefc84b62cf5438b2c66 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 7 Oct 2019 15:59:52 -0700 Subject: uClibc++: Fix three bugs The first allows usage of several functions in the std namespace, which broke compilation of gddrescue specifically with uClibc-ng and uClibc++. The second allows usage of long long with normal C++11, which is part of the standard. Before, std=gnu++11 needed to be passsed to work around it. As a result of the second patch, the pedantic patch can safely be removed. Both patches are upstream backports. Added -std=c++11 to CFLAGS to guarentee proper inclusion of long long. Added another patch that fixes a typo with the long long support. Sent to upstream. Fixed up license information according to SPDX. Small cleanups for consistency. Signed-off-by: Rosen Penev --- ...4-uClibc-Make-long-long-available-to-C-11.patch | 143 +++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 package/libs/uclibc++/patches/004-uClibc-Make-long-long-available-to-C-11.patch (limited to 'package/libs/uclibc++/patches/004-uClibc-Make-long-long-available-to-C-11.patch') diff --git a/package/libs/uclibc++/patches/004-uClibc-Make-long-long-available-to-C-11.patch b/package/libs/uclibc++/patches/004-uClibc-Make-long-long-available-to-C-11.patch new file mode 100644 index 0000000000..6e13f22c8a --- /dev/null +++ b/package/libs/uclibc++/patches/004-uClibc-Make-long-long-available-to-C-11.patch @@ -0,0 +1,143 @@ +From 8151579eb36d9366632242415ff3f5177fa5e1e2 Mon Sep 17 00:00:00 2001 +From: Rosen Penev +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 +--- + 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& operator>>(void*& p); + basic_istream& operator>>(basic_streambuf* sb); + +-#ifndef __STRICT_ANSI__ ++#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) + basic_istream& operator>>(long long& n); + basic_istream& operator>>(unsigned long long& n); + #endif +@@ -455,7 +455,7 @@ namespace std{ + return *this; + } + +-#ifndef __STRICT_ANSI__ ++#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) + template _UCXXEXPORT basic_istream& + basic_istream::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 _UCXXEXPORT __istream_readin{ + public: + inline static void readin(basic_istream& stream, long long & var) +--- a/include/ostream ++++ b/include/ostream +@@ -85,7 +85,7 @@ namespace std { + basic_ostream& operator<<(long double f); + basic_ostream& operator<<(void* p); + basic_ostream& operator<<(basic_streambuf* sb); +-#ifndef __STRICT_ANSI__ ++#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) + basic_ostream& operator<<(long long n); + basic_ostream& operator<<(unsigned long long n); + #endif +@@ -221,7 +221,7 @@ namespace std { + return *this; + } + +-#ifndef __STRICT_ANSI__ ++#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) + template _UCXXEXPORT basic_ostream& basic_ostream::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 _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 _UCXXEXPORT __ostream_printout{ + public: +@@ -237,7 +237,7 @@ namespace std{ + }; + + +-#endif //__STRICT_ANSI__ ++#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) + + template class _UCXXEXPORT __ostream_printout{ + public: +@@ -357,7 +357,7 @@ namespace std{ + } + }; + +-#ifndef __STRICT_ANSI__ ++#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) + + template class _UCXXEXPORT __ostream_printout{ + public: +@@ -428,7 +428,7 @@ namespace std{ + }; + + +-#endif //__STRICT_ANSI__ ++#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L) + + template class _UCXXEXPORT __ostream_printout{ + 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; -- cgit v1.2.3