Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] struct sizes hardcoded?

>>>>> "Seth" == Seth Nickell <snickell@xxxxxxxxxxxx> writes:

Seth> This seems like not only a maintenance nightmare in the long run
Seth> (I assume GTK will eventually break GTK compat, and the errors
Seth> generated by hardcoding the sizes could be very difficult to
Seth> find), but worse, doesn't seem portable in the least.

This is definitely one of the problems with porting to a 64-bit
platform.

One idea I had was to change the field initialization from:

    public static final int sizeof = 12;  // e.g., from GdkColor

to:

    public static final int sizeof = OS.sizeof ("GdkColor");

Then the OS native code could simply return the correct value.

Of course there is also the preprocessing idea as floated in the
earlier 64-bit porting thread.

Tom


Back to the top