Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2636244

Browse files
committed
override is a C++11 keyword.
1 parent 3025ccc commit 2636244

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tiny_obj_loader.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ THE SOFTWARE.
6363

6464
namespace tinyobj {
6565

66+
// TODO(syoyo): Better C++11 detection for older compiler
67+
#if __cplusplus > 199711L
68+
#define TINYOBJ_OVERRIDE override
69+
#else
70+
#define TINYOBJ_OVERRIDE
71+
#endif
72+
6673
#ifdef __clang__
6774
#pragma clang diagnostic push
6875
#if __has_warning("-Wzero-as-null-pointer-constant")
@@ -444,7 +451,7 @@ class MaterialFileReader : public MaterialReader {
444451
virtual bool operator()(const std::string &matId,
445452
std::vector<material_t> *materials,
446453
std::map<std::string, int> *matMap, std::string *warn,
447-
std::string *err) override;
454+
std::string *err) TINYOBJ_OVERRIDE;
448455

449456
private:
450457
std::string m_mtlBaseDir;
@@ -461,7 +468,7 @@ class MaterialStreamReader : public MaterialReader {
461468
virtual bool operator()(const std::string &matId,
462469
std::vector<material_t> *materials,
463470
std::map<std::string, int> *matMap, std::string *warn,
464-
std::string *err) override;
471+
std::string *err) TINYOBJ_OVERRIDE;
465472

466473
private:
467474
std::istream &m_inStream;

0 commit comments

Comments
 (0)