Redone gcc 3.4 build fix. Previous aproach just made gcc quiet

and resulted in lost symbols for Gtk::wrap methods.

Reported by:	pointyhat via kris
This commit is contained in:
Alexander Nedotsukov 2004-10-13 11:12:05 +00:00
parent 306a3a6dec
commit 3710c9da14
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=119202
6 changed files with 94 additions and 42 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= gtkmm
PORTVERSION= 1.2.8
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= x11-toolkits
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/gtkmm/1.2

View file

@ -1,25 +1,40 @@
--- src/gtk--/base.h.orig Tue Nov 14 21:23:11 2000
+++ src/gtk--/base.h Sun Sep 5 06:11:48 2004
@@ -454,6 +454,13 @@
pointer operator -> () const { return &operator*(); }
};
+++ src/gtk--/base.h Wed Oct 13 05:01:59 2004
@@ -99,12 +99,10 @@
+namespace Gtk {
+
+template <class impl, class interf>
+interf* wrap(impl*);
+
+}
+
// this iterator variation returns interf (wrapped from impl)
// Equivelency G_List_Cpp_Iterator<GtkWidget,Gtk_Widget>
// => list<Gtk_Widget*>::iterator
@@ -482,7 +489,7 @@
value_type operator*() const
/* Translating API */
-/*
// used to give error on unwrapped types; connect Gtk-- crew
-template <class C> struct NotWrapped;
+template <class C> struct NotWrapped {typedef void Type;};
// hook for C => C++ translation
template <class C> struct Wrap {typedef typename NotWrapped<C>::Type CppType;};
-*/
class Object;
class ObjectClass;
@@ -118,19 +116,19 @@
// Request a specific wrapper for an object.
template <class Cpp>
-Cpp* wrap_new(typename Cpp::BaseObjectType* o)
+inline Cpp* wrap_new(typename Cpp::BaseObjectType* o)
{
if (node && node->data)
- return Gtk::wrap(static_cast<impl*>((*node).data));
+ return Gtk::wrap<impl, interf>(static_cast<impl*>((*node).data));
return 0;
return (typename Cpp::CppClassType::wrap_new(o));
}
// interface to gtk--
-/*
+
template <class C>
-typename Wrap<C>::CppType* wrap(C* o)
+inline typename Wrap<C>::CppType* wrap(C* o)
{
return dynamic_cast<typename Wrap<C>::CppType*>(wrap_auto((GtkObject*)(o)));
}
-*/
+
/********************************************************************/

View file

@ -0,0 +1,11 @@
--- src/gtkmmproc/stage1.m4.orig Thu Feb 15 04:42:47 2001
+++ src/gtkmmproc/stage1.m4 Wed Oct 13 02:35:02 2004
@@ -198,7 +198,7 @@
class __CPPNAME__;
class __CPPNAME__`'_Class;
}
-namespace Gtk { __NAMESPACE__::__CPPNAME__ *wrap (__CNAME__ *o); }
+namespace Gtk { template<> struct Wrap<__CNAME__> { typedef __CPPNAME__ CppType; }; }
dnl
dnl
GTKMM_SECTION(PRIVATE)

View file

@ -7,7 +7,7 @@
PORTNAME= gtkmm
PORTVERSION= 1.2.8
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= x11-toolkits
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/gtkmm/1.2

View file

@ -1,25 +1,40 @@
--- src/gtk--/base.h.orig Tue Nov 14 21:23:11 2000
+++ src/gtk--/base.h Sun Sep 5 06:11:48 2004
@@ -454,6 +454,13 @@
pointer operator -> () const { return &operator*(); }
};
+++ src/gtk--/base.h Wed Oct 13 05:01:59 2004
@@ -99,12 +99,10 @@
+namespace Gtk {
+
+template <class impl, class interf>
+interf* wrap(impl*);
+
+}
+
// this iterator variation returns interf (wrapped from impl)
// Equivelency G_List_Cpp_Iterator<GtkWidget,Gtk_Widget>
// => list<Gtk_Widget*>::iterator
@@ -482,7 +489,7 @@
value_type operator*() const
/* Translating API */
-/*
// used to give error on unwrapped types; connect Gtk-- crew
-template <class C> struct NotWrapped;
+template <class C> struct NotWrapped {typedef void Type;};
// hook for C => C++ translation
template <class C> struct Wrap {typedef typename NotWrapped<C>::Type CppType;};
-*/
class Object;
class ObjectClass;
@@ -118,19 +116,19 @@
// Request a specific wrapper for an object.
template <class Cpp>
-Cpp* wrap_new(typename Cpp::BaseObjectType* o)
+inline Cpp* wrap_new(typename Cpp::BaseObjectType* o)
{
if (node && node->data)
- return Gtk::wrap(static_cast<impl*>((*node).data));
+ return Gtk::wrap<impl, interf>(static_cast<impl*>((*node).data));
return 0;
return (typename Cpp::CppClassType::wrap_new(o));
}
// interface to gtk--
-/*
+
template <class C>
-typename Wrap<C>::CppType* wrap(C* o)
+inline typename Wrap<C>::CppType* wrap(C* o)
{
return dynamic_cast<typename Wrap<C>::CppType*>(wrap_auto((GtkObject*)(o)));
}
-*/
+
/********************************************************************/

View file

@ -0,0 +1,11 @@
--- src/gtkmmproc/stage1.m4.orig Thu Feb 15 04:42:47 2001
+++ src/gtkmmproc/stage1.m4 Wed Oct 13 02:35:02 2004
@@ -198,7 +198,7 @@
class __CPPNAME__;
class __CPPNAME__`'_Class;
}
-namespace Gtk { __NAMESPACE__::__CPPNAME__ *wrap (__CNAME__ *o); }
+namespace Gtk { template<> struct Wrap<__CNAME__> { typedef __CPPNAME__ CppType; }; }
dnl
dnl
GTKMM_SECTION(PRIVATE)