<div dir="ltr"><div><div><div>In fact, I'm not sure about this whole issue. I think plain C allows standard library functions to be defined as macros. I wonder how C++ handles this... i.e. is the name disallowed then? Should the compiler tread it specially?<br>
<br></div>At any rate, a workaround for compilation would be to use the following:<br><br>class A {<br>public:<br>        void (remove)(const char *);<br>};<br><br>void (A::remove)(const char *) {<br>}<br><br></div>i.e. use parenthesis around the remove use (this is somewhat suggested in the C standard when you declare library functions on your own or take their address IIRC).<br>
<br></div>// Johannes<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 31, 2013 at 2:26 PM, Willem Jan Palenstijn <span dir="ltr"><<a href="mailto:wjp@usecode.org" target="_blank">wjp@usecode.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Oct 31, 2013 at 02:21:56PM +0100, Johannes Schickel wrote:<br>
> On Thu, Oct 31, 2013 at 1:55 PM, Willem Jan Palenstijn <<a href="mailto:wjp@usecode.org">wjp@usecode.org</a>>wrote:<br>
><br>
> > On Thu, Oct 31, 2013 at 12:35:28AM +0400, Икар wrote:<br>
> > ><br>
> > > When I building Tsage engine for symbian with GCCE 4.4.1 I got many<br>
> > erros "macro `remove' used without args" because compilers think what<br>
> > function :<br>
> > > virtual void remove()=0<br>
> > > and his virtual inheritance comes from macro definition<br>
> > > #define remove(x) unlink(x)<br>
> > > This define placed in sys/unistd.h<br>
> > ><br>
> > >  I try to  use '#undef remove' in core.h but it doesn't work.<br>
> ><br>
> > What do you mean by "doesn't work"?<br>
> ><br>
> > We use remove() in more places than just core.h, so I'm not sure what you<br>
> > tried or how it doesn't work...<br>
> ><br>
><br>
> I think he talks about<br>
> <a href="https://github.com/scummvm/scummvm/commit08cd61acc249f93c2760fc45b45705c8836fbc7bwhich" target="_blank">https://github.com/scummvm/scummvm/commit08cd61acc249f93c2760fc45b45705c8836fbc7bwhich</a><br>
> was reverted later. One possibly issue here could've been that you<br>
> undefine such macros by simple "#undef remove" instead of "#undef<br>
> remove(x)". Other issues might include core.h wasn't included in the<br>
> offending files, core.h was included first and then #undef remove was<br>
> before the actual #define.<br>
<br>
</div></div>The #undefine was at the very top of the header, so that does not sound like a<br>
very safe or robust way to undefine something defined in a system header. It<br>
doesn't surprise me at all that it doesn't compile after just thar one change.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Willem Jan<br>
</font></span></blockquote></div><br></div>