diff --git a/src/lsp/ffi.lsp b/src/lsp/ffi.lsp index 270f5ce22..48161217a 100644 --- a/src/lsp/ffi.lsp +++ b/src/lsp/ffi.lsp @@ -39,6 +39,13 @@ #-ecl-min (clines "#include ") +(defmacro def-constant (name value &key (export nil)) + "Macro to define a constant and to export it" + `(eval-when (:compile-toplevel :load-toplevel :execute) + (defconstant ,name ,value) + ,(when export (list 'export `(quote ,name))) + ',name)) + ;;;---------------------------------------------------------------------- ;;; FOREIGN TYPES ;;;