Re: [evolution-patches] Fix for evolution/shell/Evolution-Component.idl
- From: Not Zed <notzed ximian com>
- To: Tor Lillqvist <tml novell com>
- Cc: evolution-patches lists ximian com
- Subject: Re: [evolution-patches] Fix for evolution/shell/Evolution-Component.idl
- Date: Wed, 08 Jun 2005 10:42:15 +0800
I wonder if all the idl's shouldn't be built into a single library
anyway ...
But this looks good, dont forget changelogs.
Thanks,
Michael
On Tue, 2005-06-07 at 21:58 +0300, Tor Lillqvist wrote:
> The mail/Evolution-Mail.idl file includes
> shell/Evolution-Component.idl. This means that, unless precautions are
> taken, the IDL compiler will generate duplicate function inthe skels
> (and maybe stubs, but I only noticed this in the skels) when massaging
> shell/Evolution.idl and mail/Evolution-Mail.idl. In both
> shell/Evolution-skels.c and mail/Evolution-Mail-skels.c you have for
> instance a function POA_GNOME_Evolution_Component__init(). Clearly,
> this makes little sense.
>
> Things happen to work out correctly on Linux, apparently more or less
> by chance, because of the order in which the shared libraries
> libeshell.so and libevolution-mail.so are loaded, and the detail of
> how ELF dynamic loading works. On Win32 things happen to work out
> differently, leading to a hard-to-diagnose bug over which I and
> Michael Meeks spent some hours debugging and IRCing today.
>
> The fix is to surround Evolution-Component.idl with guards that
> prevent the IDL compiler from generating code when that IDL file is
> just included in some other IDL file. This is the same technique that
> Bonobo.idl uses, for instance.
>
> Below is the patch to shell/Evolution-Component.idl and
> shell/Makefile.am. (Here I edited out irrelevant parts from the
> Makefile.am diff.)
>
> Quite probably the same thing should be done in all IDL files that get
> includes by other IDL files, for instance
> Evolution-DataServer-Calendar.idl in e-d-s.
>
> Thanks to Michael Meeks for the explanation and advice.
>
> --tml
>
> Index: shell/Evolution-Component.idl
> ===================================================================
> RCS file: /cvs/gnome/evolution/shell/Evolution-Component.idl,v
> retrieving revision 1.16
> diff -p -u -2 -r1.16 Evolution-Component.idl
> --- shell/Evolution-Component.idl 2 Jun 2005 05:51:53 -0000 1.16
> +++ shell/Evolution-Component.idl 7 Jun 2005 15:15:03 -0000
> @@ -14,4 +14,13 @@
> #include <Bonobo.idl>
>
> +#ifndef __Evolution_Component_COMPILATION
> +#ifdef __ORBIT_IDL__
> +%{
> +#pragma include_defs shell/evolution-component.h
> +%}
> +#pragma inhibit push
> +#endif
> +#endif
> +
> module GNOME {
> module Evolution {
> @@ -103,3 +112,8 @@ module Evolution {
> };
>
> +#ifndef __Evolution_Component_COMPILATION
> +#ifdef __ORBIT_IDL__
> +#pragma inhibit pop
> +#endif
> #endif
> +#endif /* _GNOME_EVOLUTION_COMPONENT_IDL */
> Index: shell/Makefile.am
> ===================================================================
> RCS file: /cvs/gnome/evolution/shell/Makefile.am,v
> retrieving revision 1.207
> diff -p -u -2 -r1.207 Makefile.am
> --- shell/Makefile.am 2 Jun 2005 04:28:11 -0000 1.207
> +++ shell/Makefile.am 7 Jun 2005 15:15:03 -0000
> @@ -40,8 +39,11 @@ IDL_GENERATED_C = \
> Evolution-stubs.c
>
> +idl_defines = \
> + -D__Evolution_Component_COMPILATION
> +
> IDL_GENERATED = $(IDL_GENERATED_H) $(IDL_GENERATED_C)
>
> $(IDL_GENERATED_H): $(IDLS)
> - $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(srcdir)/Evolution.idl
> + $(ORBIT_IDL) -I $(srcdir) $(idl_defines) $(IDL_INCLUDES) $(srcdir)/Evolution.idl
>
> $(IDL_GENERATED_C): $(IDL_GENERATED_H)
>
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]