ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] boost: SimGear
  @ 2012-09-06  7:47 ` Michael Shigorin
  2012-09-06  8:11   ` Ivan A. Melnikov
  2012-09-06 12:05   ` Ivan A. Melnikov
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Shigorin @ 2012-09-06  7:47 UTC (permalink / raw)
  To: devel

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:

А с этим что делать?

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/
 ----        Sep 29, Kiev, Ukraine:
--       http://conference.osdn.org.ua


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [devel] boost: SimGear
  2012-09-06  7:47 ` [devel] boost: SimGear Michael Shigorin
@ 2012-09-06  8:11   ` Ivan A. Melnikov
  2012-09-06 12:05   ` Ivan A. Melnikov
  1 sibling, 0 replies; 4+ messages in thread
From: Ivan A. Melnikov @ 2012-09-06  8:11 UTC (permalink / raw)
  To: devel

On Thu, 6 Sep 2012 10:47:23 +0300
Michael Shigorin <mike@osdn.org.ua> 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:
> 
> А с этим что делать?
> 

Пока не знаю, сегодня попробую разобраться.

-- 
WBR,
Ivan A. Melnikov


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [devel] boost: SimGear
  2012-09-06  7:47 ` [devel] boost: SimGear Michael Shigorin
  2012-09-06  8:11   ` Ivan A. Melnikov
@ 2012-09-06 12:05   ` Ivan A. Melnikov
  2012-09-06 17:51     ` Michael Shigorin
  1 sibling, 1 reply; 4+ messages in thread
From: Ivan A. Melnikov @ 2012-09-06 12:05 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1879 bytes --]

On Thu, 6 Sep 2012 10:47:23 +0300
Michael Shigorin <mike@osdn.org.ua> 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:
> 
> А с этим что делать?
> 

В принципе, сборка чинится приложенным патчем, но мне он не нравится.
История на английском, на случай связи с апстримом:

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

-- 
WBR,
Ivan A. Melnikov

[-- Attachment #2: SimGear-2.8.0-alt-boost-1.51.0-compatibility.patch --]
[-- Type: text/x-patch, Size: 509 bytes --]

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 <simgear/structure/SGExpression.hxx>
 #include <simgear/props/vectorPropTemplates.hxx>
 
+namespace osg
+{
+    std::size_t hash_value(osg::Shader::Type t)
+    {
+        return boost::hash_value(static_cast<int>(t));
+    }
+}
+
 
 namespace simgear
 {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [devel] boost: SimGear
  2012-09-06 12:05   ` Ivan A. Melnikov
@ 2012-09-06 17:51     ` Michael Shigorin
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Shigorin @ 2012-09-06 17:51 UTC (permalink / raw)
  To: devel

On Thu, Sep 06, 2012 at 04:05:06PM +0400, Ivan A. Melnikov wrote:
> > > SimGear-2.8.0-alt1
> > А с этим что делать?
> В принципе, сборка чинится приложенным патчем, но мне он не нравится.

Приложил, спасибо.

> История на английском, на случай связи с апстримом:

Разумеется: http://code.google.com/p/flightgear-bugs/issues/detail?id=868

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/
 ----        Sep 29, Kiev, Ukraine:
--       http://conference.osdn.org.ua


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-06 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-06  7:47 ` [devel] boost: SimGear Michael Shigorin
2012-09-06  8:11   ` Ivan A. Melnikov
2012-09-06 12:05   ` Ivan A. Melnikov
2012-09-06 17:51     ` Michael Shigorin

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git