Skip to content

Commit

Permalink
Fixed the gcc 9.1 failing to compile with the patch supplied in the c…
Browse files Browse the repository at this point in the history
…omments
  • Loading branch information
Programatic committed Aug 7, 2019
1 parent 405ee61 commit 2796b11
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .SRCINFO
Expand Up @@ -16,10 +16,12 @@ pkgbase = ddd
source = http://ftp.gnu.org/gnu/ddd/ddd-3.3.12.tar.gz
source = http://ftp.gnu.org/gnu/ddd/ddd-3.3.12.tar.gz.sig
source = ddd-3.3.12-gcc44.patch
source = friend-default.patch
validpgpkeys = 4B286694DE99D517AA8DFF2D6656C593E5158D1A
sha1sums = b91d2dfb1145af409138bd34517a898341724e56
sha1sums = de155d812da6e11e55cc882292bb5c7b30bd31a1
sha1sums = 3d43c9d56347f248732b1d72f29c7bf799f03864
sha1sums = 4fcb220ed3f2b84b9f6a9090a7e147341ed98ee2

pkgname = ddd

6 changes: 4 additions & 2 deletions PKGBUILD
Expand Up @@ -13,15 +13,17 @@ optdepends=('gdb: to use the Gnu debugger'
'java-runtime-openjdk: to use the Java debugger'
'pydb: to use the Python debugger'
'perl: to use the Perl debugger')
source=(http://ftp.gnu.org/gnu/ddd/${pkgname}-${pkgver}.tar.gz{,.sig} ddd-3.3.12-gcc44.patch)
source=(http://ftp.gnu.org/gnu/ddd/${pkgname}-${pkgver}.tar.gz{,.sig} ddd-3.3.12-gcc44.patch friend-default.patch)
sha1sums=('b91d2dfb1145af409138bd34517a898341724e56'
'de155d812da6e11e55cc882292bb5c7b30bd31a1'
'3d43c9d56347f248732b1d72f29c7bf799f03864')
'3d43c9d56347f248732b1d72f29c7bf799f03864'
'4fcb220ed3f2b84b9f6a9090a7e147341ed98ee2')
validpgpkeys=('4B286694DE99D517AA8DFF2D6656C593E5158D1A')

prepare() {
cd ${pkgname}-${pkgver}
patch -p1 -i "${srcdir}/ddd-3.3.12-gcc44.patch"
patch -p1 -i "${srcdir}/friend-default.patch"
}

build() {
Expand Down
68 changes: 68 additions & 0 deletions friend-default.patch
@@ -0,0 +1,68 @@
--- ddd-3.3.12-orig/ddd/strclass.C
+++ ddd-3.3.12/ddd/strclass.C
index 7ef16fa..faea640 100644
--- i/ddd/strclass.h
+++ w/ddd/strclass.h
@@ -810,10 +810,10 @@ public:
friend int split(const string& x, string *res, int maxn,
const regex& sep);

- friend string common_prefix(const string& x, const string& y,
- int startpos = 0);
- friend string common_suffix(const string& x, const string& y,
- int startpos = -1);
+ inline string common_prefix(const string& x, const string& y);
+ friend string common_prefix(const string& x, const string& y, int startpos);
+ inline string common_suffix(const string& x, const string& y);
+ friend string common_suffix(const string& x, const string& y, int startpos);
friend string replicate(char c, int n);
friend string replicate(const string& y, int n);
friend string join(const string *src, int n, const string& sep);
@@ -863,9 +863,10 @@ public:
friend inline std::ostream& operator<<(std::ostream& s, const subString& x);
friend std::istream& operator>>(std::istream& s, string& x);

- friend int readline(std::istream& s, string& x,
- char terminator = '\n',
- int discard_terminator = 1);
+ inline int readline(std::istream& s, string& x);
+ inline int readline(std::istream& s, string& x, char terminator);
+ friend int readline(std::istream& s, string& x, char terminator,
+ int discard_terminator);

// Status
unsigned int length() const;
@@ -1456,6 +1457,16 @@ inline string operator + (char x, const subString& y)
string r; cat(x, y, r); return r;
}

+inline string common_prefix(const string& x, const string& y)
+{
+ return common_prefix(x, y, 0);
+}
+
+inline string common_suffix(const string& x, const string& y)
+{
+ return common_suffix(x, y, -1);
+}
+
inline string reverse(const string& x)
{
string r; r.rep = string_Sreverse(x.rep, r.rep); return r;
@@ -1476,6 +1487,16 @@ inline string capitalize(const string& x)
string r; r.rep = string_Scapitalize(x.rep, r.rep); return r;
}

+inline int readline(std::istream& s, string& x)
+{
+ return readline(s, x, '\n', 1);
+}
+
+inline int readline(std::istream& s, string& x, char terminator)
+{
+ return readline(s, x, terminator, 1);
+}
+
// prepend

inline string& string::prepend(const string& y)

0 comments on commit 2796b11

Please sign in to comment.