From 64f2670874f07aa12b8f94d6ab013bc9320149bb Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sat, 28 Mar 2009 23:06:53 +0100 Subject: [PATCH] Remove function array declaration, which does not work in C++ --- src/cmp/cmptop.lsp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/cmp/cmptop.lsp b/src/cmp/cmptop.lsp index ef66842c5..de5d34d59 100644 --- a/src/cmp/cmptop.lsp +++ b/src/cmp/cmptop.lsp @@ -198,12 +198,6 @@ (wt-nl-h "static cl_object VV[VM];") (wt-nl-h "#endif")))) - (let ((n-cfuns (length *global-cfuns-array*))) - (wt-nl-h "#define compiler_cfuns_size " n-cfuns) - (if (zerop n-cfuns) - (wt-nl-h "#define compiler_cfuns NULL") - (wt-nl-h "static const struct ecl_cfun compiler_cfuns[];"))) - (dolist (l *linking-calls*) (let* ((c-name (fourth l)) (var-name (fifth l))) @@ -698,18 +692,22 @@ (close-inline-blocks))) (defun output-cfuns (stream) - (format stream "~%#ifndef compiler_cfuns~ -~%static const struct ecl_cfun compiler_cfuns[] = {~ + (let ((n-cfuns (length *global-cfuns-array*))) + (wt-nl-h "#define compiler_cfuns_size " n-cfuns) + (if (zerop n-cfuns) + (wt-nl-h "#define compiler_cfuns NULL") + (progn + (format stream "~%static const struct ecl_cfun compiler_cfuns[] = {~ ~%~t/*t,m,narg,padding,name,block,entry*/"); - (loop for (loc fname-loc fun) in (nreverse *global-cfuns-array*) - do (let* ((cfun (fun-cfun fun)) - (minarg (fun-minarg fun)) - (maxarg (fun-maxarg fun)) - (narg (if (= minarg maxarg) maxarg nil))) - (format stream "~%{0,0,~D,0,MAKE_FIXNUM(~D),MAKE_FIXNUM(~D),(cl_objectfn)~A}," - (or narg -1) (second loc) (second fname-loc) - cfun))) - (format stream "~%};~%#endif")) + (loop for (loc fname-loc fun) in (nreverse *global-cfuns-array*) + do (let* ((cfun (fun-cfun fun)) + (minarg (fun-minarg fun)) + (maxarg (fun-maxarg fun)) + (narg (if (= minarg maxarg) maxarg nil))) + (format stream "~%{0,0,~D,0,MAKE_FIXNUM(~D),MAKE_FIXNUM(~D),(cl_objectfn)~A}," + (or narg -1) (second loc) (second fname-loc) + cfun))) + (format stream "~%};"))))) ;;; ----------------------------------------------------------------------