Hi,

I am trying to figure out how to use g-wrap. So far I have hacked the
examples from the documentation into the following minimal sample:

(use-modules (oop goops))
(use-modules (g-wrap))
(use-modules (g-wrap guile))
(use-modules (g-wrap guile ws standard))

(define-class <my-wrapset> (<gw-guile-wrapset>)
  #:id 'my-wrapset
  #:dependencies '(standard))

(define-method (initialize (ws <my-wrapset>) initargs)
  (next-method)
  
  (wrap-function! ws
                  #:name 'strfry
                  #:returns '(mchars caller-owned)
                  #:arguments '(((mchars caller-owned) s))
                  #:c-name "strfry"))

(generate-wrapset 'guile 'my-wrapset "my-wrapset")

This mostly works, but to make it compile I have to edit the generated
source to have it #include <string.h>. (Btw, if you try this example you
need to also compile with -D_GNU_SOURCE, since strfry is a GNU extension.)

How do I tell g-wrap to put "#include <string.h>\n" in the output? There
are some places in the output source where it looks like it is doing
something similar, but I couldn't figure it out.

cheers,

John



_______________________________________________
Guile-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-user

Reply via email to