1
0

004-uClibc-Make-long-long-available-to-C-11.patch 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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
  5. C++11 makes long long available. It is no longer a GNU extension.
  6. Signed-off-by: Rosen Penev <rosenp@gmail.com>
  7. ---
  8. include/istream | 4 ++--
  9. include/istream_helpers | 2 +-
  10. include/ostream | 8 ++++----
  11. include/ostream_helpers | 8 ++++----
  12. tests/sstreamtest.cpp | 4 ++--
  13. 5 files changed, 13 insertions(+), 13 deletions(-)
  14. --- a/include/istream
  15. +++ b/include/istream
  16. @@ -72,7 +72,7 @@ namespace std{
  17. basic_istream<charT,traits>& operator>>(void*& p);
  18. basic_istream<charT,traits>& operator>>(basic_streambuf<char_type,traits>* sb);
  19. -#ifndef __STRICT_ANSI__
  20. +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  21. basic_istream<charT,traits>& operator>>(long long& n);
  22. basic_istream<charT,traits>& operator>>(unsigned long long& n);
  23. #endif
  24. @@ -455,7 +455,7 @@ namespace std{
  25. return *this;
  26. }
  27. -#ifndef __STRICT_ANSI__
  28. +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  29. template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>&
  30. basic_istream<charT,traits>::operator>>(long long& n)
  31. {
  32. --- a/include/istream_helpers
  33. +++ b/include/istream_helpers
  34. @@ -301,7 +301,7 @@ namespace std{
  35. };
  36. -#ifndef __STRICT_ANSI__
  37. +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  38. template <class traits> class _UCXXEXPORT __istream_readin<traits, char, long long>{
  39. public:
  40. inline static void readin(basic_istream<char, traits >& stream, long long & var)
  41. --- a/include/ostream
  42. +++ b/include/ostream
  43. @@ -85,7 +85,7 @@ namespace std {
  44. basic_ostream<charT,traits>& operator<<(long double f);
  45. basic_ostream<charT,traits>& operator<<(void* p);
  46. basic_ostream<charT,traits>& operator<<(basic_streambuf<char_type,traits>* sb);
  47. -#ifndef __STRICT_ANSI__
  48. +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  49. basic_ostream<charT,traits>& operator<<(long long n);
  50. basic_ostream<charT,traits>& operator<<(unsigned long long n);
  51. #endif
  52. @@ -221,7 +221,7 @@ namespace std {
  53. return *this;
  54. }
  55. -#ifndef __STRICT_ANSI__
  56. +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  57. template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(long long n)
  58. {
  59. sentry s(*this);
  60. @@ -487,7 +487,7 @@ namespace std {
  61. #endif
  62. -#ifndef __STRICT_ANSI__
  63. +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  64. //Support for output of long long data types
  65. @@ -509,7 +509,7 @@ template<class Ch, class Tr> _UCXXEXPORT
  66. }
  67. -#endif //__STRICT_ANSI__
  68. +#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  69. --- a/include/ostream_helpers
  70. +++ b/include/ostream_helpers
  71. @@ -142,7 +142,7 @@ namespace std{
  72. }
  73. };
  74. -#ifndef __STRICT_ANSI__
  75. +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  76. template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, signed long long int>{
  77. public:
  78. @@ -237,7 +237,7 @@ namespace std{
  79. };
  80. -#endif //__STRICT_ANSI__
  81. +#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  82. template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, double>{
  83. public:
  84. @@ -357,7 +357,7 @@ namespace std{
  85. }
  86. };
  87. -#ifndef __STRICT_ANSI__
  88. +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  89. template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, signed long long int>{
  90. public:
  91. @@ -428,7 +428,7 @@ namespace std{
  92. };
  93. -#endif //__STRICT_ANSI__
  94. +#endif // !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  95. template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, double>{
  96. public:
  97. --- a/tests/sstreamtest.cpp
  98. +++ b/tests/sstreamtest.cpp
  99. @@ -9,7 +9,7 @@ int main(){
  100. int i;
  101. std::string s;
  102. char c;
  103. -#ifndef __STRICT_ANSI__
  104. +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  105. long long ll;
  106. unsigned long long ull;
  107. #endif
  108. @@ -32,7 +32,7 @@ int main(){
  109. -#ifndef __STRICT_ANSI__
  110. +#if !defined(__STRICT_ANSI__) || (__cplusplus >= 201103L)
  111. a.str("678 76 54");
  112. a >> ll >> ull >> s;
  113. std::cout << "ll (should be 678): " << ll << std::endl;