aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-const.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2008-02-25 08:36:15 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2008-02-25 08:36:15 +0000
commitee37d2f54c14956c32feca7bef17a4b7b8802717 (patch)
tree762dc6796ed285b4d67938d43837434f3b44d4b8 /gcc/fortran/trans-const.c
parent4cfaec1cefa9e393cceb88fa818c7c2530e75289 (diff)
downloadgcc-ee37d2f54c14956c32feca7bef17a4b7b8802717.zip
gcc-ee37d2f54c14956c32feca7bef17a4b7b8802717.tar.gz
gcc-ee37d2f54c14956c32feca7bef17a4b7b8802717.tar.bz2
re PR fortran/34729 (Localization of run-time error messages, written into the executable)
PR fortran/34729 * trans-const.c (gfc_build_string_const): Don't call gettext. (gfc_build_localized_string_const): New function. * trans-const.h (gfc_build_localized_string_const): New prototype. * trans.c (gfc_trans_runtime_check): Use gfc_build_localized_string_const instead of gfc_build_string_const. (gfc_call_malloc): Likewise. (gfc_allocate_with_status): Likewise. (gfc_allocate_array_with_status): Likewise. (gfc_deallocate_with_status): Likewise. (gfc_call_realloc): Likewise. * trans-io.c (gfc_trans_io_runtime_check): Likewise. From-SVN: r132612
Diffstat (limited to 'gcc/fortran/trans-const.c')
-rw-r--r--gcc/fortran/trans-const.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index 8d5f8a8..37251ef 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -82,14 +82,22 @@ gfc_build_string_const (int length, const char *s)
}
/* Build a Fortran character constant from a zero-terminated string.
- Since this is mainly used for error messages, the string will get
- translated. */
+ There a two version of this function, one that translates the string
+ and one that doesn't. */
tree
-gfc_build_cstring_const (const char *msgid)
+gfc_build_cstring_const (const char *string)
{
- return gfc_build_string_const (strlen (msgid) + 1, _(msgid));
+ return gfc_build_string_const (strlen (string) + 1, string);
}
+tree
+gfc_build_localized_cstring_const (const char *msgid)
+{
+ const char *localized = _(msgid);
+ return gfc_build_string_const (strlen (localized) + 1, localized);
+}
+
+
/* Return a string constant with the given length. Used for static
initializers. The constant will be padded or truncated to match
length. */