Re: gcc 4.2 generates error that was OK before
Re: gcc 4.2 generates error that was OK before
- Subject: Re: gcc 4.2 generates error that was OK before
- From: Steve Mills <email@hidden>
- Date: Tue, 22 Sep 2009 15:17:19 -0500
On Sep 22, 2009, at 14:57:47, Jeffrey Schmidt wrote:
It looks like this has to do with some ambiguities in what a typedef
of void is trying to do in this context. In C it's ok to do this,
but it isn't in C++. Is that typedef just acting to rename void, and
then the function should take no parameters? Or is it specifying the
type of a parameter? C++ decided to say it's just not allowed. At
least that's my understanding of this error.
On the Mac, those are both typedef'd to void. On Windows, they're
typedef'd to int and size_t. Maybe it's just the "static" that's
making it puke? No, getting rid of that didn't help. Still, I don't
see the need for it in the *declaration* of hsGGlyphCacheHandler.
Changing the 2 typedefs below to #defines made it work.
#if defined(HS_BUILD_FOR_WIN32) && !defined(__MWERKS__)
typedef int hsNewHandler_ReturnType;
typedef size_t hsNewHandler_ParamType;
#define hsNewHandler_Param size
#else
typedef void hsNewHandler_ReturnType;
typedef void hsNewHandler_ParamType;
#define hsNewHandler_Param
#endif
static hsNewHandler_ReturnType hsGGlyphCacheHandler
(hsNewHandler_ParamType);
hsNewHandler_ReturnType hsGGlyphCacheHandler(hsNewHandler_ParamType
hsNewHandler_Param)
{
blah
}
elsewhere:
gPrevHandler = hsSetNewHandler(hsGGlyphCacheHandler);
Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden