{
const line_map_ordinary *bltin_map
= linemap_check_ordinary (linemap_add (line_table, LC_RENAME, 0,
- _("<built-in>"), 0));
+ special_fname_builtin (), 0));
cb_file_change (parse_in, bltin_map);
linemap_line_start (line_table, 0, 1);
const char *file = s.file ? s.file : progname;
int line = 0;
int col = -1;
- if (strcmp (file, N_("<built-in>")))
+ if (strcmp (file, special_fname_builtin ()))
{
line = s.line;
if (context->show_column)
if (gfc_option.flag_preprocessed)
return;
- cpp_change_file (cpp_in, LC_RENAME, _("<built-in>"));
+ cpp_change_file (cpp_in, LC_RENAME, special_fname_builtin ());
if (!gfc_cpp_option.no_predefined)
{
/* Make sure all of the builtins about to be declared have
const char *locus_ce = colorize_stop (pp_show_color (pp));
return (s.file == NULL
? build_message_string ("%s%s:%s", locus_cs, progname, locus_ce )
- : !strcmp (s.file, N_("<built-in>"))
+ : !strcmp (s.file, special_fname_builtin ())
? build_message_string ("%s%s:%s", locus_cs, s.file, locus_ce)
: context->show_column
? build_message_string ("%s%s:%d:%d:%s", locus_cs, s.file, s.line,
return (s.file == NULL
? build_message_string ("%s%s:%s", locus_cs, progname, locus_ce )
- : !strcmp (s.file, N_("<built-in>"))
+ : !strcmp (s.file, special_fname_builtin ())
? build_message_string ("%s%s:%s", locus_cs, s.file, locus_ce)
: context->show_column
? build_message_string ("%s%s:%d:%d-%d:%s", locus_cs, s.file, s.line,
if (!gfc_cpp_enabled ())
{
linemap_add (line_table, LC_ENTER, false, gfc_source_file, 1);
- linemap_add (line_table, LC_RENAME, false, "<built-in>", 0);
+ linemap_add (line_table, LC_RENAME, false, special_fname_builtin (), 0);
}
else
gfc_cpp_init_0 ();
#define HAVE_ICONV 0
#endif
+const char *
+special_fname_builtin ()
+{
+ return _("<built-in>");
+}
+
/* Input charset configuration. */
static const char *default_charset_callback (const char *)
{
xloc.data = block;
if (loc <= BUILTINS_LOCATION)
- xloc.file = loc == UNKNOWN_LOCATION ? NULL : _("<built-in>");
+ xloc.file = loc == UNKNOWN_LOCATION ? NULL : special_fname_builtin ();
return xloc;
}
static void
test_builtins ()
{
- assert_loceq (_("<built-in>"), 0, 0, BUILTINS_LOCATION);
+ assert_loceq (special_fname_builtin (), 0, 0, BUILTINS_LOCATION);
ASSERT_PRED1 (is_location_from_builtin_token, BUILTINS_LOCATION);
}
/* The location for declarations in "<built-in>" */
#define BUILTINS_LOCATION ((location_t) 1)
+/* Returns the translated string referring to the special location. */
+const char *special_fname_builtin ();
+
/* line-map.cc reserves RESERVED_LOCATION_COUNT to the user. Ensure
both UNKNOWN_LOCATION and BUILTINS_LOCATION fit into that. */
STATIC_ASSERT (BUILTINS_LOCATION < RESERVED_LOCATION_COUNT);