[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50529] trunk/blender/extern/libmv/ third_party/ceres: Fix libmv build on OS X with 10.5 SDK.
Brecht Van Lommel
brechtvanlommel at pandora.be
Tue Sep 11 13:54:10 CEST 2012
Revision: 50529
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50529
Author: blendix
Date: 2012-09-11 11:54:10 +0000 (Tue, 11 Sep 2012)
Log Message:
-----------
Fix libmv build on OS X with 10.5 SDK. The tr1::unordered_map implementation
is broken in this SDK, now it uses the boost implementation instead.
Modified Paths:
--------------
trunk/blender/extern/libmv/third_party/ceres/SConscript
trunk/blender/extern/libmv/third_party/ceres/internal/ceres/collections_port.h
Modified: trunk/blender/extern/libmv/third_party/ceres/SConscript
===================================================================
--- trunk/blender/extern/libmv/third_party/ceres/SConscript 2012-09-11 11:41:51 UTC (rev 50528)
+++ trunk/blender/extern/libmv/third_party/ceres/SConscript 2012-09-11 11:54:10 UTC (rev 50529)
@@ -25,6 +25,11 @@
incs = '. ../../ ../../../Eigen3 ./include ./internal ../gflags'
+# work around broken hashtable in 10.5 SDK
+if env['OURPLATFORM'] == 'darwin' and env['WITH_BF_BOOST']:
+ incs += ' ' + env['BF_BOOST_INC']
+ defs.append('CERES_HASH_BOOST')
+
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
incs += ' ../msinttypes'
Modified: trunk/blender/extern/libmv/third_party/ceres/internal/ceres/collections_port.h
===================================================================
--- trunk/blender/extern/libmv/third_party/ceres/internal/ceres/collections_port.h 2012-09-11 11:41:51 UTC (rev 50528)
+++ trunk/blender/extern/libmv/third_party/ceres/internal/ceres/collections_port.h 2012-09-11 11:54:10 UTC (rev 50529)
@@ -33,6 +33,10 @@
#ifndef CERES_INTERNAL_COLLECTIONS_PORT_H_
#define CERES_INTERNAL_COLLECTIONS_PORT_H_
+#ifdef CERES_HASH_BOOST
+#include <boost/tr1/unordered_map.hpp>
+#include <boost/tr1/unordered_set.hpp>
+#else
#if defined(_MSC_VER) && _MSC_VER <= 1700
#include <unordered_map>
#include <unordered_set>
@@ -40,6 +44,8 @@
#include <tr1/unordered_map>
#include <tr1/unordered_set>
#endif
+#endif
+
#include <utility>
#include "ceres/integral_types.h"
#include "ceres/internal/port.h"
@@ -118,7 +124,7 @@
// Hasher for STL pairs. Requires hashers for both members to be defined.
template<typename T>
-struct hash<pair<T, T> > {
+struct hash {
size_t operator()(const pair<T, T>& p) const {
size_t h1 = hash<T>()(p.first);
size_t h2 = hash<T>()(p.second);
More information about the Bf-blender-cvs
mailing list