[Ecls-list] Defconstant impossible with ffi?

Peter Enerccio enerccio at gmail.com
Thu Dec 13 15:17:28 UTC 2012


Hello,

I am trying to compile file containing only this:

(DEFCONSTANT +SDL_HWSURFACE+
  (FFI:C-INLINE () () :INT "SDL_HWSURFACE" :ONE-LINER T :SIDE-EFFECTS NIL))

however, I get

> (compile-file "test.lisp")

;;;
;;; Compiling test.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; Error:
;;;   in file test.lisp, position 0
;;;   at (DEFCONSTANT +SDL_HWSURFACE+ ...)
;;;   * The form (PROGN (SI:*MAKE-CONSTANT '+SDL_HWSURFACE+ (FFI:C-INLINE
NIL NIL :INT "SDL_HWSURFACE" :ONE-LINER T :SIDE-EFFECTS NIL))
(SI::REGISTER-GLOBAL '+SDL_HWSURFACE+)) was not evaluated successfully.
;;; Error detected:
;;; The special form c-inline cannot be used in the interpreter: (NIL NIL
INT SDL_HWSURFACE ONE-LINER T SIDE-EFFECTS NIL)


Why is that? The file is compiled, not evaluated. Also, I tried to put it
around eval-when with only :compile-toplevel option and it still failed.

-- 
Bc. Peter Vaňušanik
http://www.bishojo.tk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20121213/ab127de5/attachment.html>


More information about the ecl-devel mailing list