List Info

Thread: Re: modifying UNO struct and binary compatibility




Re: modifying UNO struct and binary compatibility
user name
2007-07-17 08:38:02
Kohei Yoshida wrote:
> Hi there,
> 
> When I modify an existing struct in its idl and
re-build the offapi
> module, the buidl fails because of binary incompatible
change.
> 
> But when I create a parent struct, and make the
existing struct a
> subclass of the new parent struct, and move some of the
data members
> from the original struct to the new parent struct, the
build also fails
> due to "binary incompatible change".
> 
> But is that really the case?  For instance, here is the
original struct
> I'm attempting to modify:
> 
> struct TableFilterField
> {
>     com::sun::star::sheet::FilterConnection
Connection;
>     long Field;
>     com::sun::star::sheet::FilterOperator Operator;
>     boolean IsNumeric;
>     double NumericValue;
>     string StringValue;
> };
> 
> by moving the first two data members into the new base
struct, here is
> the change I want to make:
> 
> /** New base struct */
> struct TableFilterFieldBase
> {
>     com::sun::star::sheet::FilterConnection
Connection;
>     long Field;
> };
> 
> /** Modified original struct. */
> struct TableFilterField: TableFilterFieldBase
> {
>     com::sun::star::sheet::FilterOperator Operator;
>     boolean IsNumeric;
>     double NumericValue;
>     string StringValue;
> };
> 
> Since the size of the TableFilterFiled as well as the
data members and
> their order will not change before and after the
change, I would think
> it's safe to make this change, but is it not safe?
> 
> I appreciate your input.

Your reasoning might be valid for C++, but remember that
there are more 
language bindings for UNO.

-Stephan

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeudk.openoffice.org
For additional commands, e-mail: dev-helpudk.openoffice.org


Re: modifying UNO struct and binary compatibility
user name
2007-07-19 10:15:10
On Tue, 2007-07-17 at 15:38 +0200, Stephan Bergmann wrote:
> Kohei Yoshida wrote:

> > Since the size of the TableFilterFiled as well as
the data members and
> > their order will not change before and after the
change, I would think
> > it's safe to make this change, but is it not
safe?
> > 
> > I appreciate your input.
> 
> Your reasoning might be valid for C++, but remember
that there are more 
> language bindings for UNO.

Thanks for your input.  But I would still think that C++ is
probably the
pickest of all the languages UNO has bindings for,
especially when it
comes to ABI compatibility.  In other words, the other
languages are
probably more relaxed about the change I was considering
above.

Anyway, in the end, I've decided to leave the existing
struct alone, and
create a whole new set of structs to cover my need.

Regards,

Kohei

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeudk.openoffice.org
For additional commands, e-mail: dev-helpudk.openoffice.org


[1-2]

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