diff options
author | Antonio Sanchez <cantonios@google.com> | 2021-04-09 19:50:19 -0700 |
---|---|---|
committer | Antonio Sanchez <cantonios@google.com> | 2021-04-12 19:00:39 -0700 |
commit | 69adf26aa3e853418002562f623c42a9c7008271 (patch) | |
tree | 0b09d0d1158f93ae0af28318ef47142781b58c2a /unsupported/test | |
parent | 9357feedc7635105a23974ddf30e17560ba2c182 (diff) |
Modify googlehash use to account for namespace issues.
The namespace declaration for googlehash is a configurable macro that
can be disabled. In particular, it is disabled within google, causing
compile errors since `dense_hash_map`/`sparse_hash_map` are then in
the global namespace instead of in `::google`.
Here we play a bit of gynastics to allow for both `google::*_hash_map`
and `*_hash_map`, while limiting namespace polution. Symbols within
the `::google` namespace are imported into `Eigen::google`.
We also remove checks based on `_SPARSE_HASH_MAP_H_`, as this is
fragile, and instead require `EIGEN_GOOGLEHASH_SUPPORT` to be
defined.
Diffstat (limited to 'unsupported/test')
-rw-r--r-- | unsupported/test/sparse_extra.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/unsupported/test/sparse_extra.cpp b/unsupported/test/sparse_extra.cpp index bc681e3b1..cdfd10ca4 100644 --- a/unsupported/test/sparse_extra.cpp +++ b/unsupported/test/sparse_extra.cpp @@ -123,10 +123,8 @@ template<typename SparseMatrixType> void sparse_extra(const SparseMatrixType& re #ifdef EIGEN_UNORDERED_MAP_SUPPORT VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, StdUnorderedMapTraits> >(m,refMat,nonzeroCoords) )); #endif - #ifdef _DENSE_HASH_MAP_H_ + #ifdef EIGEN_GOOGLEHASH_SUPPORT VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, GoogleDenseHashMapTraits> >(m,refMat,nonzeroCoords) )); - #endif - #ifdef _SPARSE_HASH_MAP_H_ VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, GoogleSparseHashMapTraits> >(m,refMat,nonzeroCoords) )); #endif |