SYNFIGLIB_DIR=$libdir/synfig
AC_SUBST(SYNFIGLIB_DIR)
+# Check for unordered_map or hash_map headers
+AC_CHECK_HEADERS([tr1/unordered_map],[
+ AC_DEFINE([HASH_MAP_CLASS],[HASH_MAP_NAMESPACE::unordered_map],[The template name for unordered maps.])
+ AC_DEFINE([HASH_MAP_H],[<tr1/unordered_map>],[The header file to include for unordered maps.])
+ AC_DEFINE([HASH_MAP_NAMESPACE],[std::tr1],[The namespace for unordered maps.])
+],[
+ AC_CHECK_HEADERS([ext/hash_map],[
+ AC_DEFINE([HASH_MAP_CLASS],[HASH_MAP_NAMESPACE::hash_map],[The template name for unordered maps.])
+ AC_DEFINE([HASH_MAP_H],[<ext/hash_map>],[The header file to include for unordered maps.])
+ AC_DEFINE([HASH_MAP_NAMESPACE],[__gnu_cxx],[The namespace for unordered maps.])
+ ],[
+ AC_MSG_ERROR([C++ compiler does not seem to support unordered containers])
+ ])
+])
+
+# Check for unordered_set or hash_set headers
+AC_CHECK_HEADERS([tr1/unordered_set],[
+ AC_DEFINE([HASH_SET_CLASS],[HASH_SET_NAMESPACE::unordered_set],[The template name for unordered sets.])
+ AC_DEFINE([HASH_SET_H],[<tr1/unordered_set>],[The header file to include for unordered sets.])
+ AC_DEFINE([HASH_SET_NAMESPACE],[std::tr1],[The namespace for unordered sets.])
+],[
+ AC_CHECK_HEADERS([ext/hash_set],[
+ AC_DEFINE([HASH_SET_CLASS],[HASH_SET_NAMESPACE::hash_set],[The template name for unordered sets.])
+ AC_DEFINE([HASH_SET_H],[<ext/hash_set>],[The header file to include for unordered sets.])
+ AC_DEFINE([HASH_SET_NAMESPACE],[__gnu_cxx],[The namespace for unordered sets.])
+ ],[
+ AC_MSG_ERROR([C++ compiler does not seem to support unordered containers])
+ ])
+])
+
/* === H E A D E R S ======================================================= */
-#define HASH_MAP_H <ext/hash_map>
#define SUBTRACT_RNG_H <ext/functional>
#ifdef USING_PCH
#ifdef HASH_MAP_H
#include HASH_MAP_H
-using namespace __gnu_cxx;
#endif
#ifdef SUBTRACT_RNG_H
synfig::GUID::hasher(const String& str)
{
#ifdef HASH_MAP_H
- hash<const char*> string_hash_;
+ HASH_MAP_NAMESPACE::hash<const char*> string_hash_;
const unsigned int seed(
string_hash_(
str.c_str()
#ifndef __SYNFIG_GUIDSET_H
#define __SYNFIG_GUIDSET_H
-#define HASH_SET_H <ext/hash_set>
-
/* === H E A D E R S ======================================================= */
#include "guid.h"
#ifdef HASH_SET_H
std::set<synfig::GUID>
#else
-std::hash_set<synfig::GUID,synfig::GUIDHash>
+HASH_SET_CLASS<synfig::GUID,synfig::GUIDHash>
#endif
{
}; // END of class GUIDSet
/* === H E A D E R S ======================================================= */
-#define HASH_MAP_H <ext/hash_map>
-
#ifdef USING_PCH
# include "pch.h"
#else
#ifdef HASH_MAP_H
#include HASH_MAP_H
-using namespace __gnu_cxx;
#else
#include <map>
#endif
/* === G L O B A L S ======================================================= */
#ifdef HASH_MAP_H
-typedef hash_map<GUID,Node*,GUIDHash> GlobalNodeMap;
+typedef HASH_MAP_CLASS<GUID,Node*,GUIDHash> GlobalNodeMap;
#else
typedef map<GUID,Node*> GlobalNodeMap;
#endif
FMOD_LIBS=
} ; fi
+# Check for unordered_map or hash_map headers
+AC_CHECK_HEADERS([tr1/unordered_map],[
+ AC_DEFINE([HASH_MAP_CLASS],[HASH_MAP_NAMESPACE::unordered_map],[The template name for unordered maps.])
+ AC_DEFINE([HASH_MAP_H],[<tr1/unordered_map>],[The header file to include for unordered maps.])
+ AC_DEFINE([HASH_MAP_NAMESPACE],[std::tr1],[The namespace for unordered maps.])
+],[
+ AC_CHECK_HEADERS([ext/hash_map],[
+ AC_DEFINE([HASH_MAP_CLASS],[HASH_MAP_NAMESPACE::hash_map],[The template name for unordered maps.])
+ AC_DEFINE([HASH_MAP_H],[<ext/hash_map>],[The header file to include for unordered maps.])
+ AC_DEFINE([HASH_MAP_NAMESPACE],[__gnu_cxx],[The namespace for unordered maps.])
+ ],[
+ AC_MSG_ERROR([C++ compiler does not seem to support unordered containers])
+ ])
+])
+
+# Check for unordered_set or hash_set headers
+AC_CHECK_HEADERS([tr1/unordered_set],[
+ AC_DEFINE([HASH_SET_CLASS],[HASH_SET_NAMESPACE::unordered_set],[The template name for unordered sets.])
+ AC_DEFINE([HASH_SET_H],[<tr1/unordered_set>],[The header file to include for unordered sets.])
+ AC_DEFINE([HASH_SET_NAMESPACE],[std::tr1],[The namespace for unordered sets.])
+],[
+ AC_CHECK_HEADERS([ext/hash_set],[
+ AC_DEFINE([HASH_SET_CLASS],[HASH_SET_NAMESPACE::hash_set],[The template name for unordered sets.])
+ AC_DEFINE([HASH_SET_H],[<ext/hash_set>],[The header file to include for unordered sets.])
+ AC_DEFINE([HASH_SET_NAMESPACE],[__gnu_cxx],[The namespace for unordered sets.])
+ ],[
+ AC_MSG_ERROR([C++ compiler does not seem to support unordered containers])
+ ])
+])
+
# -- H E A D E R S --------------------------------------------
AC_CHECK_HEADERS([unistd.h signal.h fcntl.h])
/* === M A C R O S ========================================================= */
-#define HASH_MAP_H <ext/hash_map>
-#define HASH_SET_H <ext/hash_set>
-
#ifdef HASH_MAP_H
#include HASH_MAP_H
#ifndef __STRING_HASH__
#define __STRING_HASH__
class StringHash
{
- __gnu_cxx::hash<const char*> hasher_;
+ HASH_MAP_NAMESPACE::hash<const char*> hasher_;
public:
size_t operator()(const synfig::String& x)const
{
class DuckMap : public
#ifdef HASH_MAP_H
-__gnu_cxx::hash_map<synfig::GUID,etl::handle<studio::Duck>,synfig::GUIDHash>
+HASH_MAP_CLASS<synfig::GUID,etl::handle<studio::Duck>,synfig::GUIDHash>
{
- typedef __gnu_cxx::hash_map<synfig::GUID,etl::handle<studio::Duck>,synfig::GUIDHash> PARENT_TYPE;
+ typedef HASH_MAP_CLASS<synfig::GUID,etl::handle<studio::Duck>,synfig::GUIDHash> PARENT_TYPE;
#else
std::map<synfig::GUID,etl::handle<studio::Duck> >
{
/* === M A C R O S ========================================================= */
-#define HASH_MAP_H <ext/hash_map>
-
#ifdef HASH_MAP_H
#include HASH_MAP_H
#ifndef __STRING_HASH__
#define __STRING_HASH__
class StringHash
{
- __gnu_cxx::hash<const char*> hasher_;
+ HASH_MAP_NAMESPACE::hash<const char*> hasher_;
public:
size_t operator()(const synfig::String& x)const
{
public:
#ifdef HASH_MAP_H
-typedef __gnu_cxx::hash_map<synfig::GUID,etl::smart_ptr<synfig::Point>,synfig::GUIDHash> DuckDataMap;
+typedef HASH_MAP_CLASS<synfig::GUID,etl::smart_ptr<synfig::Point>,synfig::GUIDHash> DuckDataMap;
#else
typedef std::map<synfig::GUID,etl::smart_ptr<synfig::Point> > DuckDataMap;
#endif