Subject: [dtn-users] [PATCH] Compiling oasys with readline 6.3

From: Roland Hieber <[email-masked]>
Date: Tue, 22 Apr 2014 18:50:18 +0200

Hi,

I tried to compile oasys on my Debian testing, and I got the following
error:

gcc  -g -fno-inline  -fPIC -DPIC -MMD -MP -MT "tclcmd/tclreadline.o
tclcmd/tclreadline.E"  -DHAVE_CONFIG_H -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I. -I. -I/home/rohieb/Projects/dtn/oasys -I./ext
-I/usr/include/tcl8.4  -w -c tclcmd/tclreadline.c -o tclcmd/tclreadline.o
tclcmd/tclreadline.c: In function ‘TclReadlineInitialize’:
tclcmd/tclreadline.c:702:41: error: ‘CPPFunction’ undeclared (first use
in this function)
     rl_attempted_completion_function = (CPPFunction *)
TclReadlineCompletion;

Apparently [0], CPPFunction got renamed in readline 6.3. Unfortunately,
I cannot log in to SourceForge right now, so please see the attached
patch (based on hg 675b978f435b), which works for me. (Well, oasys
compiles, but when building the test suite, I get different errors about
memcpy not being found, so I cannot test it right now. Anyway, this
should be a trivial change.)

[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741767#19

 - Roland
diff -r 675b978f435b tclcmd/tclreadline.c
--- a/tclcmd/tclreadline.c	Mon Feb 18 09:50:19 2013 +0000
+++ b/tclcmd/tclreadline.c	Tue Apr 22 18:45:25 2014 +0200
@@ -699,7 +699,7 @@
      * directory. If this failes, this
      * is *not* an error.
      */
-    rl_attempted_completion_function = (CPPFunction *) TclReadlineCompletion;
+    rl_attempted_completion_function = (rl_completion_func_t *) TclReadlineCompletion;
     if (read_history(historyfile)) {
 	if (write_history(historyfile)) {
 	    Tcl_AppendResult (interp, "warning: `",