Files
ports/lang/gpc/patches/patch-libcpp_directives_c
T
naddy 512b1fa46d lang/gpc: build fixes for llvm22
This hack in the GCC 4.2.4 code base

#define U (const unsigned char *)  /* Intended use: U"string" */

clashes with the more recent syntax for string literals of type
char32_t[].  Pick an unobtrusive fix from GCC 4.4 and replace U
with UC.
2026-06-11 20:34:24 +00:00

52 lines
1.7 KiB
Plaintext

cpp-id-data.h (UC): Was U, conflicts with U...
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b6baa67d7947f
Index: libcpp/directives.c
--- libcpp/directives.c.orig
+++ libcpp/directives.c
@@ -187,7 +187,7 @@ DIRECTIVE_TABLE
did use this notation in its preprocessed output. */
static const directive linemarker_dir =
{
- do_linemarker, U"#", 1, KANDR, IN_I
+ do_linemarker, UC"#", 1, KANDR, IN_I
};
#define SEEN_EOL() (pfile->cur_token[-1].type == CPP_EOF)
@@ -681,7 +681,7 @@ parse_include (cpp_reader *pfile, int *pangle_brackets
const unsigned char *dir;
if (pfile->directive == &dtable[T_PRAGMA])
- dir = U"pragma dependency";
+ dir = UC"pragma dependency";
else
dir = pfile->directive->name;
cpp_error (pfile, CPP_DL_ERROR, "#%s expects \"FILENAME\" or <FILENAME>",
@@ -1060,7 +1060,7 @@ register_pragma_1 (cpp_reader *pfile, const char *spac
if (space)
{
- node = cpp_lookup (pfile, U space, strlen (space));
+ node = cpp_lookup (pfile, UC space, strlen (space));
entry = lookup_pragma_entry (*chain, node);
if (!entry)
{
@@ -1089,7 +1089,7 @@ register_pragma_1 (cpp_reader *pfile, const char *spac
}
/* Check for duplicates. */
- node = cpp_lookup (pfile, U name, strlen (name));
+ node = cpp_lookup (pfile, UC name, strlen (name));
entry = lookup_pragma_entry (*chain, node);
if (entry == NULL)
{
@@ -1237,7 +1237,7 @@ restore_registered_pragmas (cpp_reader *pfile, struct
{
if (pe->is_nspace)
sd = restore_registered_pragmas (pfile, pe->u.space, sd);
- pe->pragma = cpp_lookup (pfile, U *sd, strlen (*sd));
+ pe->pragma = cpp_lookup (pfile, UC *sd, strlen (*sd));
free (*sd);
sd++;
}