At 08:20 07.02.00 +0800, James Henstridge wrote:
>On Sun, 6 Feb 2000, Alexander Larsson wrote:
>
>> > - the color variables (color_black, gdk_color_black, ...) in
>> >   lib/color.h need to be exported explicitly when compiling
>> >   libdia.dll and to be imported from the other modules to get
>> >   initialized properly.
>>  The OS/2 port needed this too. I guess we're stuck with it.
>> 
>
>It looks like there is something in the gmodule.h header which looks like
>it could help with this.  Instead of adding the stuff to the header file,
>does it work if we change color.c to include gmodule.h and declare the
>exported variables as:
>  G_MODULE_EXPORT Color color_black = { 0.0, 0.0, 0.0 };
>  ...
>
>This seems to be used in a few other programs on CVS, and looks a little
>nicer (after doing a quick check with LXR).  I can't test if this works on
>win32 as I don't have a windows system set up with compilers and
>everything.
>

AFAIK if it is used, it's rather useless, because the same effect
- exporting a function - can be done by the *.def file.
This isn't needed on *ix because everything is exported by default.

Variables like color_black are a special case, at least on Win32. 
They not only need to be *exported* but *imported* too.
Otherwise they wont get initialized correctly, in DIA case all
colors remain zero - simply drawing black on black ...

BTW: they same code is needed in libgimp, but there it is 
called GIMPVAR.

        Hans


-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert

Reply via email to