summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkinori Hattori <hattya@gentoo.org>2018-07-11 23:36:37 +0900
committerAkinori Hattori <hattya@gentoo.org>2018-07-11 23:39:29 +0900
commita978300051b39f7dbdf54e5d09ca8c084ec61187 (patch)
tree4a2bdf3ef95839ea6cc325784a15578863bc4ae2 /dev-scheme
parentdev-scheme/c-wrapper: fix finalizer of ffi_closure (diff)
downloadgentoo-a978300051b39f7dbdf54e5d09ca8c084ec61187.tar.gz
gentoo-a978300051b39f7dbdf54e5d09ca8c084ec61187.tar.bz2
gentoo-a978300051b39f7dbdf54e5d09ca8c084ec61187.zip
dev-scheme/c-wrapper: fix for >=sys-devel/gcc-5
Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'dev-scheme')
-rw-r--r--dev-scheme/c-wrapper/c-wrapper-0.6.1-r1.ebuild1
-rw-r--r--dev-scheme/c-wrapper/files/c-wrapper-gcc-5.patch45
2 files changed, 46 insertions, 0 deletions
diff --git a/dev-scheme/c-wrapper/c-wrapper-0.6.1-r1.ebuild b/dev-scheme/c-wrapper/c-wrapper-0.6.1-r1.ebuild
index 709c8c2eb64..c47ed5ad71e 100644
--- a/dev-scheme/c-wrapper/c-wrapper-0.6.1-r1.ebuild
+++ b/dev-scheme/c-wrapper/c-wrapper-0.6.1-r1.ebuild
@@ -20,6 +20,7 @@ DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-closure.patch
+ "${FILESDIR}"/${PN}-gcc-5.patch
"${FILESDIR}"/${PN}-gentoo.patch
)
HTML_DOCS=( doc/${PN}-ref{e,j}.html )
diff --git a/dev-scheme/c-wrapper/files/c-wrapper-gcc-5.patch b/dev-scheme/c-wrapper/files/c-wrapper-gcc-5.patch
new file mode 100644
index 00000000000..091b1e2da10
--- /dev/null
+++ b/dev-scheme/c-wrapper/files/c-wrapper-gcc-5.patch
@@ -0,0 +1,45 @@
+--- a/src/c-parser.c
++++ b/src/c-parser.c
+@@ -1668,6 +1668,7 @@
+ {
+ static ScmObj trigger_line = SCM_FALSE;
+ ScmObj line_str;
++ ScmObj regexp = Scm_RegComp(SCM_STRING(SCM_MAKE_STR_IMMUTABLE("^#\\s+\\d+\\s+\"<stdin>\"")), 0);
+
+ /* skip the first line '# 1 "<stdin>"' */
+ Scm_ReadLineUnsafe(SCM_PORT(in));
+@@ -1682,16 +1683,26 @@
+ }
+ }
+
+- while (!SCM_EOFP(line_str = Scm_ReadLineUnsafe(SCM_PORT(in)))) {
+- if (SCM_NULLP(macro_list)) {
++ line_str = SCM_NIL;
++ while (!SCM_NULLP(macro_list)) {
++ ScmObj body_str = line_str;
++ if (SCM_NULLP(body_str)
++ && SCM_EOFP(body_str = Scm_ReadLineUnsafe(SCM_PORT(in)))) {
+ Scm_Error("[bug] lost macro body");
+- } else {
+- ScmObj pos_name_args = SCM_CDAR(macro_list);
+- macro_list = SCM_CDR(macro_list);
+- Scm_FilenameSet(SCM_CAAR(pos_name_args));
+- Scm_LineNumberSet(SCM_INT_VALUE(SCM_CDAR(pos_name_args)));
+- parse_macro_body(SCM_CADR(pos_name_args), SCM_CDDR(pos_name_args), line_str);
+ }
++ while (!SCM_EOFP(line_str = Scm_ReadLineUnsafe(SCM_PORT(in)))
++ && SCM_REGMATCHP(Scm_RegExec(SCM_REGEXP(regexp), SCM_STRING(line_str)))) {
++ if (SCM_EOFP(line_str = Scm_ReadLineUnsafe(SCM_PORT(in)))) {
++ Scm_Error("[bug] unexpected EOF while parsing macro body");
++ }
++ body_str = Scm_StringAppend2(SCM_STRING(body_str), SCM_STRING(line_str));
++ line_str = SCM_NIL;
++ }
++ ScmObj pos_name_args = SCM_CDAR(macro_list);
++ macro_list = SCM_CDR(macro_list);
++ Scm_FilenameSet(SCM_CAAR(pos_name_args));
++ Scm_LineNumberSet(SCM_INT_VALUE(SCM_CDAR(pos_name_args)));
++ parse_macro_body(SCM_CADR(pos_name_args), SCM_CDDR(pos_name_args), body_str);
+ }
+
+ SCM_RETURN(SCM_UNDEFINED);