From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Date: Thu, 6 Sep 2012 16:05:06 +0400 From: "Ivan A. Melnikov" To: devel@lists.altlinux.org Message-ID: <20120906160506.44cfd459@deimos.localdomain> In-Reply-To: <20120906074722.GX22718@osdn.org.ua> References: <20120905220117.GA20195@ssh.git.altlinux.org> <20120906074722.GX22718@osdn.org.ua> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.11; x86_64-alt-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/5XAjZ7U37EA1um98c=08GEo" Subject: Re: [devel] boost: SimGear X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 12:05:16 -0000 Archived-At: List-Archive: List-Post: --MP_/5XAjZ7U37EA1um98c=08GEo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thu, 6 Sep 2012 10:47:23 +0300 Michael Shigorin wrote: > On Wed, Sep 05, 2012 at 10:01:18PM +0000, ALT beekeeper wrote: > > SimGear-2.8.0-alt1 > > /usr/src/RPM/BUILD/SimGear-2.8.0/simgear/scene/material/Effect.cxx:708= :67: > > instantiated from here > > /usr/include/boost/functional/hash/extensions.hpp:257:34: > > error: no matching function for call to 'hash_value(const > > osg::Shader::Type&)' /usr/include/boost/functional/hash/extensions.hpp:= 257:34: > > note: candidates are: >=20 > =D0=90 =D1=81 =D1=8D=D1=82=D0=B8=D0=BC =D1=87=D1=82=D0=BE =D0=B4=D0=B5=D0= =BB=D0=B0=D1=82=D1=8C? >=20 =D0=92 =D0=BF=D1=80=D0=B8=D0=BD=D1=86=D0=B8=D0=BF=D0=B5, =D1=81=D0=B1=D0=BE= =D1=80=D0=BA=D0=B0 =D1=87=D0=B8=D0=BD=D0=B8=D1=82=D1=81=D1=8F =D0=BF=D1=80= =D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=BD=D1=8B=D0=BC =D0=BF=D0=B0=D1=82= =D1=87=D0=B5=D0=BC, =D0=BD=D0=BE =D0=BC=D0=BD=D0=B5 =D0=BE=D0=BD =D0=BD=D0= =B5 =D0=BD=D1=80=D0=B0=D0=B2=D0=B8=D1=82=D1=81=D1=8F. =D0=98=D1=81=D1=82=D0=BE=D1=80=D0=B8=D1=8F =D0=BD=D0=B0 =D0=B0=D0=BD=D0=B3= =D0=BB=D0=B8=D0=B9=D1=81=D0=BA=D0=BE=D0=BC, =D0=BD=D0=B0 =D1=81=D0=BB=D1=83= =D1=87=D0=B0=D0=B9 =D1=81=D0=B2=D1=8F=D0=B7=D0=B8 =D1=81 =D0=B0=D0=BF=D1=81= =D1=82=D1=80=D0=B8=D0=BC=D0=BE=D0=BC: Since boost 1.51.0 boost::hash_value is implemented using SFINAE to avoid implicit casts to built in types when calling it [1]. Because of that compiler can't use boost::hash_value(int) for enum osg::Shader::Type any more. Thus one can't use osg::Shader::Type as a (part of) key for boost::unordered_map. The proper solution is to overload hash_value function for osg::Shader::Type as described in [2]. This function should be found via argument dependent lookup (ADL), so it must be defined in osg namespace. I don't know if it is appropriate for OpenSceneGraph to add it (also it should not hurt), and how it should be implemented in that case. So in my patch I put it right into simgear/scene/material/Effect.cxx, which of course is a dirty hack. Maybe, the best solution would be to change implementation of hash_value(const ProgramKey& key) (simgear/scene/material/Effect.cxx, line 712). References: [1] http://www.boost.org/users/history/version_1_51_0.html [2] http://www.boost.org/doc/libs/1_51_0/doc/html/hash/custom.html --=20 WBR, Ivan A. Melnikov --MP_/5XAjZ7U37EA1um98c=08GEo Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=SimGear-2.8.0-alt-boost-1.51.0-compatibility.patch diff --git a/SimGear/simgear/scene/material/Effect.cxx b/SimGear/simgear/scene/material/Effect.cxx index 2e10318..5c839d6 100644 --- a/SimGear/simgear/scene/material/Effect.cxx +++ b/SimGear/simgear/scene/material/Effect.cxx @@ -76,6 +76,14 @@ #include #include +namespace osg +{ + std::size_t hash_value(osg::Shader::Type t) + { + return boost::hash_value(static_cast(t)); + } +} + namespace simgear { --MP_/5XAjZ7U37EA1um98c=08GEo--