guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] guile-snarf: allow multiple init actions on one line


From: BT Templeton
Subject: [PATCH] guile-snarf: allow multiple init actions on one line
Date: Tue, 22 Feb 2011 14:14:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Guile-SDL contains some cpp macros that define multiple subrs. To allow
that, this patch modifies guile-snarf to recognize more than one
initialization action per line, which is necessary because GNU's C
preprocessor removes newlines from macro expansions.

>From e14436798deb8c9bb59273844d194c1bc4af6682 Mon Sep 17 00:00:00 2001
From: BT Templeton <address@hidden>
Date: Tue, 22 Feb 2011 13:15:31 -0500
Subject: [PATCH] guile-snarf: allow multiple init actions on one line

* libguile/guile-snarf.in (modern_snarf): Allow programs to specify
  multiple initialization actions on a single line. This makes it
  possible for C programs to define multiple subrs with a single macro
  invocation.
---
 libguile/guile-snarf.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in
index 043b3ed..a1aeba5 100644
--- a/libguile/guile-snarf.in
+++ b/libguile/guile-snarf.in
@@ -51,7 +51,7 @@ modern_snarf ()                         # writes stdout
     ## empty file.
     echo "/* cpp arguments: $@ */" ;
     ${cpp} -DSCM_MAGIC_SNARF_INITS -DSCM_MAGIC_SNARFER "$@" > ${temp} && 
cpp_ok_p=true
-    grep "^ *\^ *\^" ${temp} | sed -e "s/ *\^ *\^//g" -e "s/\^ *: *\^/;/g"
+    sed -ne "s/ *\^ *: *\^/\n/;s/[^\n]*\^ *\^ *\([^\n]*\)/\1;/;tx;d;:x;P;D" 
${temp}
 }
 
 ## main
-- 
1.7.2.3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]