Date: Fri, 8 Dec 2017 21:01:09 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326716 - head/contrib/ofed/libibnetdisc Message-ID: <201712082101.vB8L19nZ021021@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Fri Dec 8 21:01:09 2017 New Revision: 326716 URL: https://svnweb.freebsd.org/changeset/base/326716 Log: Correctly define the unordered_map namespace in ofed/libibnetdisc . This should fix ofed/libibnetdisc compilation with C-compilers different from clang and GCC v4.2.1. Submitted by: kib Sponsored by: Mellanox Technologies Modified: head/contrib/ofed/libibnetdisc/Makefile head/contrib/ofed/libibnetdisc/g_hash_table.cpp Modified: head/contrib/ofed/libibnetdisc/Makefile ============================================================================== --- head/contrib/ofed/libibnetdisc/Makefile Fri Dec 8 20:04:10 2017 (r326715) +++ head/contrib/ofed/libibnetdisc/Makefile Fri Dec 8 21:01:09 2017 (r326716) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include <src.opts.mk> + .PATH: ${.CURDIR} ${.CURDIR}/man SHLIBDIR?= /usr/lib @@ -28,6 +30,9 @@ LIBADD= osmcomp ibmad ibumad CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${.CURDIR} CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/infiniband +.if ${COMPILER_FEATURES:Mc++11} +CXXFLAGS+= -std=c++11 +.endif VERSION_MAP= ${.CURDIR}/libibnetdisc.map .include <bsd.lib.mk> Modified: head/contrib/ofed/libibnetdisc/g_hash_table.cpp ============================================================================== --- head/contrib/ofed/libibnetdisc/g_hash_table.cpp Fri Dec 8 20:04:10 2017 (r326715) +++ head/contrib/ofed/libibnetdisc/g_hash_table.cpp Fri Dec 8 21:01:09 2017 (r326716) @@ -31,17 +31,17 @@ * */ -#if defined(__clang__) +#if __cplusplus >= 201103L #include <unordered_map> -#define HASH_TABLE_UNORDERED_MAP std::unordered_map +#define UM_NAMESPACE std #else #include <tr1/unordered_map> -#define HASH_TABLE_UNORDERED_MAP std::tr1::unordered_map +#define UM_NAMESPACE std::tr1 #endif class HashTable { public: - HASH_TABLE_UNORDERED_MAP<void *, void *> map; + UM_NAMESPACE::unordered_map<void *, void *> map; HashTable() { }; ~HashTable() { }; };
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712082101.vB8L19nZ021021>