Re: [AD] Re: binary compatibility check |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] Re: binary compatibility check
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Tue, 7 Feb 2006 19:07:05 -0800
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=To4HHZq22x8Tduf3gBUtvDcd3sZny5hghbRUlmbRj21ZL6JADPAsX/IgszYiRipKyyYnvAML4Z2t9S7SPL3OJYnU0cAZTOHM79CjGnKNwDnlOLJQFUdpse7fcoeMq1uIDldCPuroKnK3DCNYsegbNTzYXYo2XDhmmnRoIYQeypc=
On Tuesday 07 February 2006 13:49, Elias Pschernig wrote:
> It seems, a function declared
> with AL_INLINE can't have #ifs inside it with my mingw version. I'm not
> really sure what's going on, anyone has an idea how to fix it?
Well, as it says:
include/allegro/system.h:87:1: directives may not be used inside a macro
There's a few ways to fix this. One is to move the directives outside of the
body, and duplicate the inline method (this would introduce a bit of code
duplication, though. A second option would be to change AL_INLINE, so the
body is not part of the argument list. eg. instead of:
AL_INLINE(void, func, (args),
{
body
})
to do instead:
AL_INLINE(void, func, (args))
{
body
}
Since the body won't be in the macro, you can use directives. A third
(modified second) method that doesn't involve changing AL_INLINE would be to
just leave the body argument empty, and put the body after the macro:
AL_INLINE(void, func, (args),)
{
body
}
I did this, and it works fine in Linux/GCC 3.4.4.