Re: Making ORBit work with MS VS compilers



Hi Tor,

On Sun, Mar 16, 2008 at 12:54 AM, Tor Lillqvist <tml iki fi> wrote:
> >  The problem with people calling those functions is
>  >  that they have to be exported in the library.
>
>  You mean that upper level code in other libraries *do* call the
>  functions commented as "internal"? (And presumably have done so, then,
>  for several GNOME release cycles?)

I mean I don't know. I was asking, because my initial thought is not
to expose those functions in the Windows DLL. But if people use them,
then that may not be the best approach.

>  Yes, I know. Back when I used hand-maintained .def files in GLib and
>  GTK+ it was a pain. Nowadays, luckily, .symbols files are used for
>  GLib and GTK+ on Linux, too (and thus get maintained by others, too),
>  and the .def files are generated from the .symbols files.

I took a look at the glib sources, and to me the .symbol approach
looks just as unappealing as .def files.

>  Ah yes, that is a pain. There are a couple of variables in the API of
>  GLib and GTK+, and they require an ugly ifdef mess in the header.

The real problem is with exported data. The only way not to have the
messy macros for exported data is to *not* include the header file
defining the variable in the .c file that actually contains the
declaration, otherwise the VC compiler will complain about
"conflicting dll linkage" or something like that. It's a pain, but I
haven't really figured out a better approach yet...

I submitted a patch for libIDL
(http://bugzilla.gnome.org/show_bug.cgi?id=522697) which uses the
macro approach. It's somewhat similar to glib's macros, although a
little bit simplified. If you could take a look and see what you think
about taking that approach, it would be really appreciated.

>  > That's a point that I forgot to mention in my original message... do
>  >  you know of any good autoconf/automake tutorials I could read?
>
>  There is a book called "GNU Autoconf, Automake and Libtool.

Well, I'll stick to custom makefiles until I have time to figure out
all that. :-)

>  >  Are gcc for [cygwin/] mingw
>  >  compatible with MS's extensions like the __declspec stuff?)
>  Yes.

So in the worst case, my current patch won't do any harm. Haven't
tested with gcc on cygwin, though...

Jules: I'll take a look at e-b, thanks for the suggestion.


-- 
Marcelo Vanzin
mmvgroups gmail com
"Life's too short to drink cheap beer."


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]