1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
From: Petter Reinholdtsen <pere@debian.org>
Subject: Fix build problems with current unstable
Bug-Debian: https://bugs.debian.org/1081077
Forwarded: not-needed
Last-Update: 2025-02-14
Convert U"string" to U "string" and provide definition of U when
HAVE_UCHAR is not set. Note, I suspect this will not work properly
when HAVE_UCHAR is set.
Added missing or correct function prototypes and signatures to make
current GCC happy even when STDC_HEADERS is missing for some strange
reason.
---
--- gcc-h8300-hms-3.4.6+dfsg2.orig/gcc/cpphash.h
+++ gcc-h8300-hms-3.4.6+dfsg2/gcc/cpphash.h
@@ -47,8 +47,10 @@ struct cset_converter
#ifndef HAVE_UCHAR
typedef unsigned char uchar;
-#endif
+#define U (const char *)
+#else
#define U (const uchar *) /* Intended use: U"string" */
+#endif
#define BITS_PER_CPPCHAR_T (CHAR_BIT * sizeof (cppchar_t))
--- gcc-h8300-hms-3.4.6+dfsg2.orig/gcc/cpplex.c
+++ gcc-h8300-hms-3.4.6+dfsg2/gcc/cpplex.c
@@ -39,7 +39,7 @@ struct token_spelling
};
static const unsigned char *const digraph_spellings[] =
-{ U"%:", U"%:%:", U"<:", U":>", U"<%", U"%>" };
+{ U "%:", U "%:%:", U "<:", U ":>", U "<%", U "%>" };
#define OP(e, s) { SPELL_OPERATOR, U s },
#define TK(e, s) { s, U #e },
--- gcc-h8300-hms-3.4.6+dfsg2.orig/gcc/cpplib.c
+++ gcc-h8300-hms-3.4.6+dfsg2/gcc/cpplib.c
@@ -191,7 +191,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, U "#", 1, KANDR, IN_I
};
#define SEEN_EOL() (pfile->cur_token[-1].type == CPP_EOF)
@@ -656,7 +656,7 @@ parse_include (cpp_reader *pfile, int *p
const unsigned char *dir;
if (pfile->directive == &dtable[T_PRAGMA])
- dir = U"pragma dependency";
+ dir = U "pragma dependency";
else
dir = pfile->directive->name;
cpp_error (pfile, CPP_DL_ERROR, "#%s expects \"FILENAME\" or <FILENAME>",
--- gcc-h8300-hms-3.4.6+dfsg2.orig/gcc/cppmacro.c
+++ gcc-h8300-hms-3.4.6+dfsg2/gcc/cppmacro.c
@@ -220,8 +220,8 @@ _cpp_builtin_macro_text (cpp_reader *pfi
cpp_errno (pfile, CPP_DL_WARNING,
"could not determine date and time");
- pfile->date = U"\"??? ?? ????\"";
- pfile->time = U"\"??:??:??\"";
+ pfile->date = U "\"??? ?? ????\"";
+ pfile->time = U "\"??:??:??\"";
}
}
--- gcc-h8300-hms-3.4.6+dfsg2.orig/libiberty/md5.c
+++ gcc-h8300-hms-3.4.6+dfsg2/libiberty/md5.c
@@ -33,6 +33,8 @@
#else
# ifndef HAVE_MEMCPY
# define memcpy(d, s, n) bcopy ((s), (d), (n))
+# else
+void *memcpy(void *, const void*, long unsigned int);
# endif
#endif
--- gcc-h8300-hms-3.4.6+dfsg2.orig/libiberty/regex.c
+++ gcc-h8300-hms-3.4.6+dfsg2/libiberty/regex.c
@@ -129,8 +129,10 @@
# if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
# else
-char *malloc ();
-char *realloc ();
+void *malloc (long unsigned int);
+void *realloc (void *, long unsigned int);
+void free(void*);
+void abort(void);
# endif
/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
|