aboutsummaryrefslogtreecommitdiff
path: root/gcc/selftest.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/selftest.c')
-rw-r--r--gcc/selftest.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/selftest.c b/gcc/selftest.c
index 27de9a4..dc90557 100644
--- a/gcc/selftest.c
+++ b/gcc/selftest.c
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "selftest.h"
+#include "intl.h"
#if CHECKING_P
@@ -192,6 +193,25 @@ temp_source_file::temp_source_file (const location &loc,
fclose (out);
}
+/* Avoid introducing locale-specific differences in the results
+ by hardcoding open_quote and close_quote. */
+
+auto_fix_quotes::auto_fix_quotes ()
+{
+ m_saved_open_quote = open_quote;
+ m_saved_close_quote = close_quote;
+ open_quote = "`";
+ close_quote = "'";
+}
+
+/* Restore old values of open_quote and close_quote. */
+
+auto_fix_quotes::~auto_fix_quotes ()
+{
+ open_quote = m_saved_open_quote;
+ close_quote = m_saved_close_quote;
+}
+
/* Read the contents of PATH into memory, returning a 0-terminated buffer
that must be freed by the caller.
Fail (and abort) if there are any problems, with LOC as the reported