[racket] forward pointer declarations

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Feb 2 01:17:01 EST 2015

At Sun, 01 Feb 2015 19:08:08 -0500, Anthony Carrico wrote:
> On 02/01/2015 05:57 PM, Anthony Carrico wrote:
> > I get a "duplicate definition" error if I declare a pointer ahead:
> > 
> > (define _wl_interface-pointer (_cpointer 'wl_interface))
> This isn't perfectly satisfying, but one option is to use a different
> name for the forward declaration:
> (define _wl_interface_foward_pointer (_pointer 'wl_interface))

It's also valid to reference `wl_interface-pointer` directly:

 (define-cstruct _wl_interface
   ((name _string/utf-8)
    (version _int)
    (method_count _int)
    (methods _wl_interface-pointer)
    (event_count _int)
    (events _wl_interface-pointer)))

I don't have a nicer solution if you want to refer to
`_wl_message-pointer`, though.

Posted on the users mailing list.