diff --git a/AssemblyInfo.cs.in b/AssemblyInfo.cs.in index 474e9d69f..37a374aa1 100644 --- a/AssemblyInfo.cs.in +++ b/AssemblyInfo.cs.in @@ -3,4 +3,3 @@ using System.Runtime.CompilerServices; [assembly:AssemblyVersion("@API_VERSION@")] [assembly:AssemblyDelaySign(false)] -[assembly:GLib.IgnoreClassInitializers] diff --git a/glib/ClassInitializerAttribute.cs b/glib/ClassInitializerAttribute.cs deleted file mode 100644 index d38ec83ee..000000000 --- a/glib/ClassInitializerAttribute.cs +++ /dev/null @@ -1,31 +0,0 @@ -// ClassInitializerAttribute.cs -// -// Author: Mike Kestner -// -// Copyright (c) 2004 Novell, Inc. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of version 2 of the Lesser GNU General -// Public License as published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the -// Free Software Foundation, Inc., 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. - - -namespace GLib { - - using System; - - [Obsolete ("Replaced by TypeInitializerAttribute")] - public sealed class ClassInitializerAttribute : Attribute - { - public ClassInitializerAttribute () {} - } -} diff --git a/glib/IgnoreClassInitializersAttribute.cs b/glib/IgnoreClassInitializersAttribute.cs deleted file mode 100644 index 1dada10f4..000000000 --- a/glib/IgnoreClassInitializersAttribute.cs +++ /dev/null @@ -1,31 +0,0 @@ -// IgnoreClassInitializersAttribute.cs -// -// Author: Mike Kestner -// -// Copyright (c) 2007 Novell, Inc. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of version 2 of the Lesser GNU General -// Public License as published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the -// Free Software Foundation, Inc., 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. - - -namespace GLib { - - using System; - - [AttributeUsage (AttributeTargets.Assembly)] - public sealed class IgnoreClassInitializersAttribute : Attribute - { - public IgnoreClassInitializersAttribute () {} - } -} diff --git a/glib/Makefile.am b/glib/Makefile.am index fdaf96ada..3962717ca 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -10,7 +10,7 @@ pkgconfig_DATA = glib-sharp-3.0.pc gapidir = $(datadir)/gapi-3.0 gapi_DATA = glib-api.xml -CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb AssemblyInfo.cs $(POLICY_ASSEMBLIES) $(POLICY_CONFIGS) +CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb $(POLICY_ASSEMBLIES) $(POLICY_CONFIGS) DISTCLEANFILES = $(ASSEMBLY).config POLICY_ASSEMBLIES = $(addsuffix .$(ASSEMBLY), $(addprefix policy., $(POLICY_VERSIONS))) @@ -22,7 +22,6 @@ sources = \ Argv.cs \ Boxed.cs \ CDeclCallbackAttribute.cs \ - ClassInitializerAttribute.cs \ ConnectBeforeAttribute.cs \ DefaultSignalHandlerAttribute.cs \ DelegateWrapper.cs \ @@ -39,7 +38,6 @@ sources = \ GType.cs \ GTypeAttribute.cs \ Idle.cs \ - IgnoreClassInitializersAttribute.cs \ InitiallyUnowned.cs \ IOChannel.cs \ IWrapper.cs \ @@ -79,7 +77,7 @@ sources = \ Value.cs \ Variant.cs -build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs +build_sources = $(addprefix $(srcdir)/, $(sources)) $(top_builddir)/AssemblyInfo.cs dist_sources = $(sources) EXTRA_DIST = \ @@ -88,10 +86,7 @@ EXTRA_DIST = \ glib-sharp-3.0.pc.in \ glib-api.xml -AssemblyInfo.cs: $(top_builddir)/AssemblyInfo.cs - cp $(top_builddir)/AssemblyInfo.cs . - -$(ASSEMBLY): $(build_sources) $(SNK) AssemblyInfo.cs +$(ASSEMBLY): $(build_sources) $(SNK) @rm -f $(ASSEMBLY).mdb $(CSC) $(CSFLAGS) -keyfile:$(SNK) -unsafe -nowarn:0169,0612,0618 -out:$(ASSEMBLY) -target:library $(references) $(build_sources) diff --git a/glib/Object.cs b/glib/Object.cs index 3555b83e6..d665d7197 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -151,7 +151,7 @@ namespace GLib { } - private static void InvokeClassInitializers (GType gtype, System.Type t) + private static void InvokeTypeInitializers (GType gtype, System.Type t) { object[] parms = {gtype, t}; @@ -162,16 +162,6 @@ namespace GLib { if (m != null) m.Invoke (null, parms); } - - for (Type curr = t; curr != typeof(GLib.Object); curr = curr.BaseType) { - - if (curr.Assembly.IsDefined (typeof (IgnoreClassInitializersAttribute), false)) - continue; - - foreach (MethodInfo minfo in curr.GetMethods(flags)) - if (minfo.IsDefined (typeof (ClassInitializerAttribute), true)) - minfo.Invoke (null, parms); - } } // Key: The pointer to the ParamSpec of the property @@ -376,7 +366,7 @@ namespace GLib { } AddProperties (gtype, t, is_first_subclass); ConnectDefaultHandlers (gtype, t); - InvokeClassInitializers (gtype, t); + InvokeTypeInitializers (gtype, t); AddInterfaces (gtype, t); return gtype; }