Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add support for GCC 10
- Add missing include to Element.cpp.
- Minor refactor of MaterialXCore dependencies.
- Update Travis configuration for GCC 10.
  • Loading branch information
jstone-lucasfilm committed May 23, 2020
1 parent 1795dc8 commit abb5e03
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -39,12 +39,12 @@ matrix:
- os: linux
dist: bionic
compiler: gcc
env: MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
env: MATRIX_EVAL="CC=gcc-10 && CXX=g++-10"
addons:
apt:
sources:
sourceline: "ppa:ubuntu-toolchain-r/test"
packages: [*packages_base, g++-9]
packages: [*packages_base, g++-10]
- os: linux
dist: bionic
compiler: clang
Expand Down
2 changes: 0 additions & 2 deletions source/MaterialXCore/Document.h
Expand Up @@ -12,9 +12,7 @@
#include <MaterialXCore/Library.h>

#include <MaterialXCore/Look.h>
#include <MaterialXCore/Material.h>
#include <MaterialXCore/Node.h>
#include <MaterialXCore/Variant.h>

namespace MaterialX
{
Expand Down
2 changes: 2 additions & 0 deletions source/MaterialXCore/Element.cpp
Expand Up @@ -9,6 +9,8 @@
#include <MaterialXCore/Node.h>
#include <MaterialXCore/Util.h>

#include <stdexcept>

namespace MaterialX
{

Expand Down
2 changes: 0 additions & 2 deletions source/MaterialXCore/Interface.h
Expand Up @@ -11,8 +11,6 @@

#include <MaterialXCore/Library.h>

#include <MaterialXCore/Element.h>

#include <MaterialXCore/Geom.h>

namespace MaterialX
Expand Down
6 changes: 0 additions & 6 deletions source/MaterialXCore/Library.h
Expand Up @@ -70,12 +70,6 @@ class Exception : public std::exception
string _msg;
};

/// Combine the hash of an arbitrary value with an existing seed.
template<typename T> void hashCombine(size_t& seed, const T& value)
{
seed ^= std::hash<T>()(value) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}

} // namespace MaterialX

#endif
2 changes: 2 additions & 0 deletions source/MaterialXCore/Observer.h
Expand Up @@ -9,6 +9,8 @@
/// @file
/// Observer classes

#include <MaterialXCore/Library.h>

#include <MaterialXCore/Document.h>

namespace MaterialX
Expand Down
2 changes: 2 additions & 0 deletions source/MaterialXCore/Types.h
Expand Up @@ -11,6 +11,8 @@

#include <MaterialXCore/Library.h>

#include <MaterialXCore/Util.h>

#include <array>
#include <cmath>

Expand Down
1 change: 0 additions & 1 deletion source/MaterialXCore/Unit.h
Expand Up @@ -13,7 +13,6 @@

#include <MaterialXCore/Definition.h>
#include <MaterialXCore/Document.h>
#include <MaterialXCore/Types.h>

namespace MaterialX
{
Expand Down
6 changes: 6 additions & 0 deletions source/MaterialXCore/Util.h
Expand Up @@ -45,6 +45,12 @@ string stringToLower(string str);
/// Return true if the given string ends with the given suffix.
bool stringEndsWith(const string& str, const string& suffix);

/// Combine the hash of a value with an existing seed.
template<typename T> void hashCombine(size_t& seed, const T& value)
{
seed ^= std::hash<T>()(value) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}

} // namespace MaterialX

#endif

0 comments on commit abb5e03

Please sign in to comment.