help-zile
[Top][All Lists]
Advanced

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

Re: [Help-zile] Guile on Zile, module questions


From: Ludovic Courtès
Subject: Re: [Help-zile] Guile on Zile, module questions
Date: Tue, 03 Jan 2012 23:58:28 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux)

Hi Mike!

Mike Gran <address@hidden> skribis:

> I have a somewhat complete version at
> https://github.com/spk121/zile

Nice!

So, first, the obligatory patch:

diff --git a/build-aux/snarf-c2h.scm b/build-aux/snarf-c2h.scm
index 10ca880..edc933c 100755
--- a/build-aux/snarf-c2h.scm
+++ b/build-aux/snarf-c2h.scm
@@ -1,5 +1,5 @@
-#!/usr/local/bin/guile \
--e c2h -s
+#!/bin/sh
+guile -e c2h -s
 !#
 ;;; output.scm  --  Output documentation "snarffed" from C files in Texi/GDF.
 ;;;
Then, it fails to build for me, basically because the all the subrs are
undeclared; for instance, G_beginning_of_line is DEFUN’d in basic.c but
then there’s no header that declares it, which leads to errors when
trying to use it in another compilation unit:

  src/funcs.c: In function 'G_backward_paragraph':
  src/funcs.c:747:58: error: 'G_beginning_of_line' undeclared (first use in 
this function)

I tried the hack below but that doesn’t capture all uses:

diff --git a/src/main.h b/src/main.h
index 3a01b49..f06d4bb 100644
--- a/src/main.h
+++ b/src/main.h
@@ -230,7 +230,10 @@ SCM_DEFINE (G_ ## c_func, zile_func,                       
        \
 
 /* Call an interactive function. */
 #define FUNCALL(c_func)                                \
-  gfuncall (G_ ## c_func)
+  ({                                           \
+     extern SCM G_ ## c_func ();               \
+     gfuncall (G_ ## c_func);                  \
+   })
 
 /* Call an interactive function with a universal argument. */
 #define FUNCALL_ARG(c_func, uniarg)             \
@@ -330,11 +333,17 @@ SCM_DEFINE (G_ ## c_func, zile_func,                      
        \
       cname = true;                                     \
     }
 
-#define G_FUNCALL(c_func) \
-  gfuncall (G_ ## c_func)
-
-#define G_FUNCALL_ARG(c_func, uniarg) \
-  gfuncall_arg (G_ ## c_func, uniarg)
+#define G_FUNCALL(c_func)                      \
+   ({                                          \
+      extern SCM G_ ## c_func ();              \
+      gfuncall (G_ ## c_func);                 \
+    })
+
+#define G_FUNCALL_ARG(c_func, uniarg)          \
+   ({                                          \
+      extern SCM G_ ## c_func ();              \
+      gfuncall_arg (G_ ## c_func, uniarg);     \
+    })
 
 /*--------------------------------------------------------------------------
  * Keyboard handling.
Am I missing something?

Thanks!

Ludo’.

reply via email to

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