On Mon, Sep 14, 2020 at 01:54:14PM +0200, John Darrington wrote: > On Sun, Sep 13, 2020 at 11:11:55PM +0200, Bruno Haible wrote: > > > The workaround is simple: Make sure that you include the corresponding > file - > here <unistd.h> - before the struct definition. That is, in this case, > at the beginning of ags/object/ags_application_context.h, add > #include <unistd.h> > > > I don't think this will solve all problems. > > For example if you have: > > > > #include <unistd.h> > > struct foo > { > void write (char *); > }; > > func (struct foo *f) > { > f->write ("hello"); > } > > > > then one will get an error similar to "rpl_write is not a member of foo"
Why? The following is a valid program: #include <unistd.h> struct foo { void rpl_write (char *); }; func (struct foo *f) { f->rpl_write ("hello"); }