Collections port fix for MSVC 2008

Apparently, TR1 symbols are defined in different namespace
comparing to MSVC 2010, which lead to compilation error when
using MSVC 2008.

Change-Id: I4fa3ceae4b4e2c6e7a46b1fb5b498640e7b18b74
This commit is contained in:
Sergey Sharybin
2013-05-31 23:48:06 +06:00
committed by Keir Mierle
parent 14297c977c
commit f806576cf2
+17 -3
View File
@@ -530,9 +530,23 @@ ELSE (DISABLE_TR1)
# Use the std namespace for the hash<> and related templates. This may vary by
# system.
IF (MSVC)
# This is known to work with Visual Studio 2010 Express.
ADD_DEFINITIONS("\"-DCERES_HASH_NAMESPACE_START=namespace std {\"")
ADD_DEFINITIONS("\"-DCERES_HASH_NAMESPACE_END=}\"")
IF (MSVC90)
# Special case for Visual Studio 2008.
# Newer versions have got tr1 symbols in another namespace,
# and this is being handled in Else branch of this condition.
# Probably Visual studio 2003 and 2005 also shall be handled here,
# but don't have by hand to verify and most likely they're not
# used by Ceres users anyway.
ADD_DEFINITIONS("\"-DCERES_HASH_NAMESPACE_START=namespace std { namespace tr1 {\"")
ADD_DEFINITIONS("\"-DCERES_HASH_NAMESPACE_END=}}\"")
ELSE (MSVC90)
# This is known to work with Visual Studio 2010 Express.
# Further, for as long Visual Studio 2012 didn't move tr1 to
# just another namespace, the same define will work for it as well.
# Hopefully all further versions will also keep working with this define.
ADD_DEFINITIONS("\"-DCERES_HASH_NAMESPACE_START=namespace std {\"")
ADD_DEFINITIONS("\"-DCERES_HASH_NAMESPACE_END=}\"")
ENDIF(MSVC90)
ELSE (MSVC)
# This is known to work with recent versions of Linux and Mac OS X.
ADD_DEFINITIONS("\"-DCERES_HASH_NAMESPACE_START=namespace std { namespace tr1 {\"")