Skip to content

Commit 6ca3eff

Browse files
Remove strerror call
1 parent eadefcb commit 6ca3eff

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

patches/gcc4.8/gcc-exception-what-to-pmem.patch

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -730,19 +730,20 @@ index d05e4b9..39e5721 100644
730730
+
731731
#endif /* _STL_MAP_H */
732732
diff --git a/libstdc++-v3/src/c++11/system_error.cc b/libstdc++-v3/src/c++11/system_error.cc
733-
index 453c687..32e563c 100644
733+
index 453c687..e86e369 100644
734734
--- a/libstdc++-v3/src/c++11/system_error.cc
735735
+++ b/libstdc++-v3/src/c++11/system_error.cc
736-
@@ -28,6 +28,8 @@
736+
@@ -27,6 +27,9 @@
737+
#include <system_error>
737738
#include <bits/functexcept.h>
738739
#include <limits>
739-
740-
+#define __EXCSTR(s) (__extension__({static const char __c[] __attribute__((section(".irom.exceptiontext,\"MS\",@progbits,1#"))) = (s); &__c[0];}))
740+
+#include <cstdlib>
741741
+
742+
+#define __EXCSTR(s) (__extension__({static const char __c[] __attribute__((section(".irom.exceptiontext,\"MS\",@progbits,1#"))) = (s); &__c[0];}))
743+
742744
namespace
743745
{
744-
using std::string;
745-
@@ -36,7 +38,7 @@ namespace
746+
@@ -36,14 +39,15 @@ namespace
746747
{
747748
virtual const char*
748749
name() const noexcept
@@ -751,7 +752,16 @@ index 453c687..32e563c 100644
751752

752753
virtual string
753754
message(int i) const
754-
@@ -51,7 +53,7 @@ namespace
755+
{
756+
// XXX locale issues: how does one get or set loc.
757+
// _GLIBCXX_HAVE_STRERROR_L, strerror_l(i, cloc)
758+
- return string(strerror(i));
759+
+ char buff[16];
760+
+ return string(itoa(i, buff, 10));
761+
}
762+
};
763+
764+
@@ -51,14 +55,15 @@ namespace
755765
{
756766
virtual const char*
757767
name() const noexcept
@@ -760,3 +770,12 @@ index 453c687..32e563c 100644
760770

761771
virtual string
762772
message(int i) const
773+
{
774+
// XXX locale issues: how does one get or set loc.
775+
// _GLIBCXX_HAVE_STRERROR_L, strerror_l(i, cloc)
776+
- return string(strerror(i));
777+
+ char buff[16];
778+
+ return string(itoa(i, buff, 10));
779+
}
780+
};
781+

0 commit comments

Comments
 (0)