List Info

Thread: CR-Client: Fixing Sun's Build Error When Function Pointer Assignment Is done With Di




CR-Client: Fixing Sun's Build Error When Function Pointer Assignment Is done With Di
country flaguser name
United States
2008-03-18 15:56:47
Hi,

My little understanding is that SunStudio compilers employed
optimized 
calling conventions for different types of functions (extern
"C", member 
functions, etc.), just like Microsoft's compilers.

Perhaps the ultimate way to fix this is to figure out the
correct 
definitions of:
common/include/hxtypes.h
STDAPICALLTYPE
STDAPIVCALLTYPE

common/include/hxcom.h
STDMETHODIMP
etc.

Before that happens, I think this patch from Sun create a
fix simple 
enough to be good.

Please review the patch.

There are other solutions utilizing  function pointers
typedefs (which 
should work too, but can be a little more "messy"
in the code.)

Thanks.

-- 
Daniel Yek.



-------- Original Message --------
Subject: 	fail to build new sun branch
Date: 	Tue, 18 Mar 2008 18:30:24 +0800
From: 	C Wang <Chris.WangSun.COM>
To: 	Daniel Yek <dyekreal.com>
CC: 	sun-private-devhelixcommunity.org



Daniel:
There is one build error...The build
fail module is datatype/group/video/vidplin.cpp. It reported
cannot use
long(*const)()* to initiate extern "C"
long(*const)()*.

The cause of problem is that the function HXShutdown has
been declared
as extern "C", and when you use the c++ function
pointer to initiate a c
interface function pointer, it will fail with strict
prototype
inspection (which sunstudio does), since the c++ function
pointer will
pass a intrinsic argument (*this) compare to c function
pointer. gcc may
can compromise with this kind of casting, but sun's compiler
cannot.

I've attached the patch for the fix, but as I inspected our
previous
release, I found datatype/group/video and image are not
delivered
previously, I don't think any of the new module is depending
on them.
So, you may just remove these two directories from Sun's
branch if you
don't think the fix is necessary.

Chris







_______________________________________________
Datatype-dev mailing list
Datatype-devhelixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/da
tatype-dev

  
RE: CR-Client: Fixing Sun's Build Error When Function Pointer Assignment Is done Wit
country flaguser name
United States
2008-03-19 09:51:26
Looks good.

=============================================
Eric Hyche (ehychereal.com)
Technical Lead
RealNetworks, Inc.  

> -----Original Message-----
> From: datatype-dev-bounceshelixcommunity.org 
> [mailto:datatype-dev-bounceshelixcommunity.org] On
Behalf Of 
> Daniel Yek
> Sent: Tuesday, March 18, 2008 4:57 PM
> To: datatype-devhelixcommunity.org
> Cc: C Wang
> Subject: [datatype-dev] CR-Client: Fixing Sun's Build
Error 
> When Function Pointer Assignment Is done With Different

> Implicit Calling Convention in vidplin.cpp
HXShutdown()
> 
> Hi,
> 
> My little understanding is that SunStudio compilers
employed 
> optimized 
> calling conventions for different types of functions
(extern 
> "C", member 
> functions, etc.), just like Microsoft's compilers.
> 
> Perhaps the ultimate way to fix this is to figure out
the correct 
> definitions of:
> common/include/hxtypes.h
> STDAPICALLTYPE
> STDAPIVCALLTYPE
> 
> common/include/hxcom.h
> STDMETHODIMP
> etc.
> 
> Before that happens, I think this patch from Sun create
a fix simple 
> enough to be good.
> 
> Please review the patch.
> 
> There are other solutions utilizing  function pointers

> typedefs (which 
> should work too, but can be a little more
"messy" in the code.)
> 
> Thanks.
> 
> -- 
> Daniel Yek.
> 
> 
> 
> -------- Original Message --------
> Subject: 	fail to build new sun branch
> Date: 	Tue, 18 Mar 2008 18:30:24 +0800
> From: 	C Wang <Chris.WangSun.COM>
> To: 	Daniel Yek <dyekreal.com>
> CC: 	sun-private-devhelixcommunity.org
> 
> 
> 
> Daniel:
> There is one build error...The build
> fail module is datatype/group/video/vidplin.cpp. It
reported 
> cannot use
> long(*const)()* to initiate extern "C"
long(*const)()*.
> 
> The cause of problem is that the function HXShutdown
has been declared
> as extern "C", and when you use the c++
function pointer to 
> initiate a c
> interface function pointer, it will fail with strict
prototype
> inspection (which sunstudio does), since the c++
function pointer will
> pass a intrinsic argument (*this) compare to c function

> pointer. gcc may
> can compromise with this kind of casting, but sun's
compiler cannot.
> 
> I've attached the patch for the fix, but as I inspected
our previous
> release, I found datatype/group/video and image are not
delivered
> previously, I don't think any of the new module is
depending on them.
> So, you may just remove these two directories from
Sun's branch if you
> don't think the fix is necessary.
> 
> Chris
> 
> 
> 
> 
> 
> 
> 


_______________________________________________
Datatype-dev mailing list
Datatype-devhelixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/da
tatype-dev

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )