From bc17c802bb436be9b27451456b82f557320b59e8 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Fri, 14 Feb 2014 14:59:53 +0000 Subject: [PATCH 1/2] Assume C++11 support Remove all CMake checks for C++11 support since we now assume that we have it. Replace all polyvox_* macros with standard C++ names. See #48 --- CMakeLists.txt | 4 - cmake/Modules/CheckCXX11Features.cmake | 133 ------------------ .../cxx11-test-__func__.cpp | 8 -- .../CheckCXX11Features/cxx11-test-auto.cpp | 12 -- .../cxx11-test-auto_fail_compile.cpp | 7 - .../cxx11-test-auto_ret_type.cpp | 8 -- .../cxx11-test-class_override_final.cpp | 21 --- ...test-class_override_final_fail_compile.cpp | 25 ---- .../cxx11-test-constexpr.cpp | 19 --- .../CheckCXX11Features/cxx11-test-cstdint.cpp | 11 -- .../cxx11-test-decltype.cpp | 10 -- .../cxx11-test-initializer_list.cpp | 27 ---- .../CheckCXX11Features/cxx11-test-lambda.cpp | 5 - .../cxx11-test-long_long.cpp | 7 - .../CheckCXX11Features/cxx11-test-nullptr.cpp | 6 - .../cxx11-test-nullptr_fail_compile.cpp | 6 - .../CheckCXX11Features/cxx11-test-regex.cpp | 26 ---- .../cxx11-test-rvalue-references.cpp | 57 -------- .../cxx11-test-shared_ptr.cpp | 7 - .../cxx11-test-sizeof_member.cpp | 14 -- .../cxx11-test-sizeof_member_fail.cpp | 9 -- .../cxx11-test-static_assert.cpp | 5 - .../cxx11-test-static_assert_fail_compile.cpp | 5 - .../cxx11-test-variadic_templates.cpp | 23 --- examples/OpenGL/OpenGLWidget.cpp | 4 +- examples/OpenGL/OpenGLWidget.h | 2 +- library/PolyVoxCore/CMakeLists.txt | 6 - .../include/PolyVoxCore/AStarPathfinder.h | 13 +- .../include/PolyVoxCore/Impl/ArraySizesImpl.h | 2 + .../PolyVoxCore/Impl/CompilerCapabilities.h | 23 --- .../Impl/CompilerCapabilities.h.in | 17 --- .../include/PolyVoxCore/Impl/ErrorHandling.h | 29 ---- .../PolyVoxCore/Impl/MarchingCubesTables.h | 2 + .../include/PolyVoxCore/Impl/TypeDef.h | 50 ------- .../PolyVoxCore/PolyVoxForwardDeclarations.h | 2 + .../include/PolyVoxCore/SurfaceMesh.h | 4 +- .../include/PolyVoxCore/SurfaceMesh.inl | 8 +- .../include/PolyVoxCore/Vector.inl | 20 +-- library/PolyVoxCore/source/ArraySizes.cpp | 2 + library/bindings/PolyVoxCore.i | 1 - 40 files changed, 36 insertions(+), 604 deletions(-) delete mode 100644 cmake/Modules/CheckCXX11Features.cmake delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-__func__.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-auto.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-auto_fail_compile.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-auto_ret_type.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-class_override_final.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-class_override_final_fail_compile.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-constexpr.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-cstdint.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-decltype.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-initializer_list.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-lambda.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-long_long.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-nullptr.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-nullptr_fail_compile.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-regex.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-rvalue-references.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-shared_ptr.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-sizeof_member.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-sizeof_member_fail.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-static_assert.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-static_assert_fail_compile.cpp delete mode 100644 cmake/Modules/CheckCXX11Features/cxx11-test-variadic_templates.cpp delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h delete mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e261a0e..cadcdb15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,10 +69,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode endif() -if(NOT MSVC) #This is causing problems in Visual Studio so disable it for now - INCLUDE(cmake/Modules/CheckCXX11Features.cmake) -endif() - ADD_SUBDIRECTORY(library) OPTION(ENABLE_EXAMPLES "Should the examples be built" ON) diff --git a/cmake/Modules/CheckCXX11Features.cmake b/cmake/Modules/CheckCXX11Features.cmake deleted file mode 100644 index b3158f4c..00000000 --- a/cmake/Modules/CheckCXX11Features.cmake +++ /dev/null @@ -1,133 +0,0 @@ -# - Check which parts of the C++11 standard the compiler supports -# -# When found it will set the following variables -# -# CXX11_COMPILER_FLAGS - the compiler flags needed to get C++11 features -# -# HAS_CXX11_AUTO - auto keyword -# HAS_CXX11_AUTO_RET_TYPE - function declaration with deduced return types -# HAS_CXX11_CLASS_OVERRIDE - override and final keywords for classes and methods -# HAS_CXX11_CONSTEXPR - constexpr keyword -# HAS_CXX11_CSTDINT_H - cstdint header -# HAS_CXX11_DECLTYPE - decltype keyword -# HAS_CXX11_FUNC - __func__ preprocessor constant -# HAS_CXX11_INITIALIZER_LIST - initializer list -# HAS_CXX11_LAMBDA - lambdas -# HAS_CXX11_LIB_REGEX - regex library -# HAS_CXX11_LONG_LONG - long long signed & unsigned types -# HAS_CXX11_NULLPTR - nullptr -# HAS_CXX11_RVALUE_REFERENCES - rvalue references -# HAS_CXX11_SIZEOF_MEMBER - sizeof() non-static members -# HAS_CXX11_STATIC_ASSERT - static_assert() -# HAS_CXX11_VARIADIC_TEMPLATES - variadic templates - -#============================================================================= -# Copyright 2011,2012 Rolf Eike Beer -# Copyright 2012 Andreas Weis -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -if (NOT CMAKE_CXX_COMPILER_LOADED) - message(FATAL_ERROR "CheckCXX11Features modules only works if language CXX is enabled") -endif () - -cmake_minimum_required(VERSION 2.8.3) - -# -### Check for needed compiler flags -# -include(CheckCXXCompilerFlag) -check_cxx_compiler_flag("-std=c++11" _HAS_CXX11_FLAG) -if (NOT _HAS_CXX11_FLAG) - check_cxx_compiler_flag("-std=c++0x" _HAS_CXX0X_FLAG) -endif () - -if (_HAS_CXX11_FLAG) - set(CXX11_COMPILER_FLAGS "-std=c++11") -elseif (_HAS_CXX0X_FLAG) - set(CXX11_COMPILER_FLAGS "-std=c++0x") -endif () - -function(cxx11_check_feature FEATURE_NAME RESULT_VAR) - if (NOT DEFINED ${RESULT_VAR}) - set(_bindir "${CMAKE_CURRENT_BINARY_DIR}/cxx11_${FEATURE_NAME}") - - set(_SRCFILE_BASE ${CMAKE_CURRENT_LIST_DIR}/CheckCXX11Features/cxx11-test-${FEATURE_NAME}) - set(_LOG_NAME "\"${FEATURE_NAME}\"") - message(STATUS "Checking C++11 support for ${_LOG_NAME}") - - set(_SRCFILE "${_SRCFILE_BASE}.cpp") - set(_SRCFILE_FAIL "${_SRCFILE_BASE}_fail.cpp") - set(_SRCFILE_FAIL_COMPILE "${_SRCFILE_BASE}_fail_compile.cpp") - - if (CROSS_COMPILING) - try_compile(${RESULT_VAR} "${_bindir}" "${_SRCFILE}" - COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}") - if (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL}) - try_compile(${RESULT_VAR} "${_bindir}_fail" "${_SRCFILE_FAIL}" - COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}") - endif (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL}) - else (CROSS_COMPILING) - try_run(_RUN_RESULT_VAR _COMPILE_RESULT_VAR - "${_bindir}" "${_SRCFILE}" - COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}") - if (_COMPILE_RESULT_VAR AND NOT _RUN_RESULT_VAR) - set(${RESULT_VAR} TRUE) - else (_COMPILE_RESULT_VAR AND NOT _RUN_RESULT_VAR) - set(${RESULT_VAR} FALSE) - endif (_COMPILE_RESULT_VAR AND NOT _RUN_RESULT_VAR) - if (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL}) - try_run(_RUN_RESULT_VAR _COMPILE_RESULT_VAR - "${_bindir}_fail" "${_SRCFILE_FAIL}" - COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}") - if (_COMPILE_RESULT_VAR AND _RUN_RESULT_VAR) - set(${RESULT_VAR} TRUE) - else (_COMPILE_RESULT_VAR AND _RUN_RESULT_VAR) - set(${RESULT_VAR} FALSE) - endif (_COMPILE_RESULT_VAR AND _RUN_RESULT_VAR) - endif (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL}) - endif (CROSS_COMPILING) - if (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL_COMPILE}) - try_compile(_TMP_RESULT "${_bindir}_fail_compile" "${_SRCFILE_FAIL_COMPILE}" - COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}") - if (_TMP_RESULT) - set(${RESULT_VAR} FALSE) - else (_TMP_RESULT) - set(${RESULT_VAR} TRUE) - endif (_TMP_RESULT) - endif (${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL_COMPILE}) - - if (${RESULT_VAR}) - message(STATUS "Checking C++11 support for ${_LOG_NAME}: works") - else (${RESULT_VAR}) - message(STATUS "Checking C++11 support for ${_LOG_NAME}: not supported") - endif (${RESULT_VAR}) - set(${RESULT_VAR} ${${RESULT_VAR}} CACHE INTERNAL "C++11 support for ${_LOG_NAME}") - endif (NOT DEFINED ${RESULT_VAR}) -endfunction(cxx11_check_feature) - -#cxx11_check_feature("__func__" HAS_CXX11_FUNC) -#cxx11_check_feature("auto" HAS_CXX11_AUTO) -#cxx11_check_feature("auto_ret_type" HAS_CXX11_AUTO_RET_TYPE) -#cxx11_check_feature("class_override_final" HAS_CXX11_CLASS_OVERRIDE) -cxx11_check_feature("constexpr" HAS_CXX11_CONSTEXPR) -cxx11_check_feature("cstdint" HAS_CXX11_CSTDINT_H) -#cxx11_check_feature("decltype" HAS_CXX11_DECLTYPE) -#cxx11_check_feature("initializer_list" HAS_CXX11_INITIALIZER_LIST) -#cxx11_check_feature("lambda" HAS_CXX11_LAMBDA) -#cxx11_check_feature("long_long" HAS_CXX11_LONG_LONG) -#cxx11_check_feature("nullptr" HAS_CXX11_NULLPTR) -#cxx11_check_feature("regex" HAS_CXX11_LIB_REGEX) -#cxx11_check_feature("rvalue-references" HAS_CXX11_RVALUE_REFERENCES) -#cxx11_check_feature("sizeof_member" HAS_CXX11_SIZEOF_MEMBER) -cxx11_check_feature("static_assert" HAS_CXX11_STATIC_ASSERT) -#cxx11_check_feature("variadic_templates" HAS_CXX11_VARIADIC_TEMPLATES) -cxx11_check_feature("shared_ptr" HAS_CXX11_SHARED_PTR) diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-__func__.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-__func__.cpp deleted file mode 100644 index 3bfd8a89..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-__func__.cpp +++ /dev/null @@ -1,8 +0,0 @@ -int main(void) -{ - if (!__func__) - return 1; - if (!(*__func__)) - return 1; - return 0; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-auto.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-auto.cpp deleted file mode 100644 index 948648e9..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-auto.cpp +++ /dev/null @@ -1,12 +0,0 @@ - -int main() -{ - auto i = 5; - auto f = 3.14159f; - auto d = 3.14159; - bool ret = ( - (sizeof(f) < sizeof(d)) && - (sizeof(i) == sizeof(int)) - ); - return ret ? 0 : 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-auto_fail_compile.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-auto_fail_compile.cpp deleted file mode 100644 index 3c0e3f2e..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-auto_fail_compile.cpp +++ /dev/null @@ -1,7 +0,0 @@ -int main(void) -{ - // must fail because there is no initializer - auto i; - - return 0; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-auto_ret_type.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-auto_ret_type.cpp deleted file mode 100644 index 937b6835..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-auto_ret_type.cpp +++ /dev/null @@ -1,8 +0,0 @@ -auto foo(int i) -> int { - return i - 1; -} - -int main() -{ - return foo(1); -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-class_override_final.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-class_override_final.cpp deleted file mode 100644 index f5870b19..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-class_override_final.cpp +++ /dev/null @@ -1,21 +0,0 @@ -class base { -public: - virtual int foo(int a) - { return 4 + a; } - int bar(int a) final - { return a - 2; } -}; - -class sub final : public base { -public: - virtual int foo(int a) override - { return 8 + 2 * a; }; -}; - -int main(void) -{ - base b; - sub s; - - return (b.foo(2) * 2 == s.foo(2)) ? 0 : 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-class_override_final_fail_compile.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-class_override_final_fail_compile.cpp deleted file mode 100644 index bc00b278..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-class_override_final_fail_compile.cpp +++ /dev/null @@ -1,25 +0,0 @@ -class base { -public: - virtual int foo(int a) - { return 4 + a; } - virtual int bar(int a) final - { return a - 2; } -}; - -class sub final : public base { -public: - virtual int foo(int a) override - { return 8 + 2 * a; }; - virtual int bar(int a) - { return a; } -}; - -class impossible : public sub { }; - -int main(void) -{ - base b; - sub s; - - return 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-constexpr.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-constexpr.cpp deleted file mode 100644 index ed624512..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-constexpr.cpp +++ /dev/null @@ -1,19 +0,0 @@ -constexpr int square(int x) -{ - return x*x; -} - -constexpr int the_answer() -{ - return 42; -} - -int main() -{ - int test_arr[square(3)]; - bool ret = ( - (square(the_answer()) == 1764) && - (sizeof(test_arr)/sizeof(test_arr[0]) == 9) - ); - return ret ? 0 : 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-cstdint.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-cstdint.cpp deleted file mode 100644 index ca2c72dd..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-cstdint.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include - -int main() -{ - bool test = - (sizeof(int8_t) == 1) && - (sizeof(int16_t) == 2) && - (sizeof(int32_t) == 4) && - (sizeof(int64_t) == 8); - return test ? 0 : 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-decltype.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-decltype.cpp deleted file mode 100644 index 0dbb1cc5..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-decltype.cpp +++ /dev/null @@ -1,10 +0,0 @@ -bool check_size(int i) -{ - return sizeof(int) == sizeof(decltype(i)); -} - -int main() -{ - bool ret = check_size(42); - return ret ? 0 : 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-initializer_list.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-initializer_list.cpp deleted file mode 100644 index 35e6c384..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-initializer_list.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include - -class seq { -public: - seq(std::initializer_list list); - - int length() const; -private: - std::vector m_v; -}; - -seq::seq(std::initializer_list list) - : m_v(list) -{ -} - -int seq::length() const -{ - return m_v.size(); -} - -int main(void) -{ - seq a = {18, 20, 2, 0, 4, 7}; - - return (a.length() == 6) ? 0 : 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-lambda.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-lambda.cpp deleted file mode 100644 index 4c33ed58..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-lambda.cpp +++ /dev/null @@ -1,5 +0,0 @@ -int main() -{ - int ret = 0; - return ([&ret]() -> int { return ret; })(); -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-long_long.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-long_long.cpp deleted file mode 100644 index 09111275..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-long_long.cpp +++ /dev/null @@ -1,7 +0,0 @@ -int main(void) -{ - long long l; - unsigned long long ul; - - return ((sizeof(l) >= 8) && (sizeof(ul) >= 8)) ? 0 : 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-nullptr.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-nullptr.cpp deleted file mode 100644 index 9f410715..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-nullptr.cpp +++ /dev/null @@ -1,6 +0,0 @@ -int main(void) -{ - void *v = nullptr; - - return v ? 1 : 0; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-nullptr_fail_compile.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-nullptr_fail_compile.cpp deleted file mode 100644 index 6a002bcb..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-nullptr_fail_compile.cpp +++ /dev/null @@ -1,6 +0,0 @@ -int main(void) -{ - int i = nullptr; - - return 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-regex.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-regex.cpp deleted file mode 100644 index 2fe01c4f..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-regex.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -int parse_line(std::string const& line) -{ - std::string tmp; - if(std::regex_search(line, std::regex("(\\s)+(-)?(\\d)+//(-)?(\\d)+(\\s)+"))) { - tmp = std::regex_replace(line, std::regex("(-)?(\\d)+//(-)?(\\d)+"), std::string("V")); - } else if(std::regex_search(line, std::regex("(\\s)+(-)?(\\d)+/(-)?(\\d)+(\\s)+"))) { - tmp = std::regex_replace(line, std::regex("(-)?(\\d)+/(-)?(\\d)+"), std::string("V")); - } else if(std::regex_search(line, std::regex("(\\s)+(-)?(\\d)+/(-)?(\\d)+/(-)?(\\d)+(\\s)+"))) { - tmp = std::regex_replace(line, std::regex("(-)?(\\d)+/(-)?(\\d)+/(-)?(\\d)+"), std::string("V")); - } else { - tmp = std::regex_replace(line, std::regex("(-)?(\\d)+"), std::string("V")); - } - return static_cast(std::count(tmp.begin(), tmp.end(), 'V')); -} - -int main() -{ - bool test = (parse_line("f 7/7/7 -3/3/-3 2/-2/2") == 3) && - (parse_line("f 7//7 3//-3 -2//2") == 3) && - (parse_line("f 7/7 3/-3 -2/2") == 3) && - (parse_line("f 7 3 -2") == 3); - return test ? 0 : 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-rvalue-references.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-rvalue-references.cpp deleted file mode 100644 index e6e7e5a9..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-rvalue-references.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include - -class rvmove { -public: - void *ptr; - char *array; - - rvmove() - : ptr(0), - array(new char[10]) - { - ptr = this; - } - - rvmove(rvmove &&other) - : ptr(other.ptr), - array(other.array) - { - other.array = 0; - other.ptr = 0; - } - - ~rvmove() - { - assert(((ptr != 0) && (array != 0)) || ((ptr == 0) && (array == 0))); - delete[] array; - } - - rvmove &operator=(rvmove &&other) - { - delete[] array; - ptr = other.ptr; - array = other.array; - other.array = 0; - other.ptr = 0; - return *this; - } - - static rvmove create() - { - return rvmove(); - } -private: - rvmove(const rvmove &); - rvmove &operator=(const rvmove &); -}; - -int main() -{ - rvmove mine; - if (mine.ptr != &mine) - return 1; - mine = rvmove::create(); - if (mine.ptr == &mine) - return 1; - return 0; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-shared_ptr.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-shared_ptr.cpp deleted file mode 100644 index 2d9c6bd1..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-shared_ptr.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main() -{ - std::shared_ptr test; - return 0; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-sizeof_member.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-sizeof_member.cpp deleted file mode 100644 index 4902fc73..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-sizeof_member.cpp +++ /dev/null @@ -1,14 +0,0 @@ -struct foo { - char bar; - int baz; -}; - -int main(void) -{ - bool ret = ( - (sizeof(foo::bar) == 1) && - (sizeof(foo::baz) >= sizeof(foo::bar)) && - (sizeof(foo) >= sizeof(foo::bar) + sizeof(foo::baz)) - ); - return ret ? 0 : 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-sizeof_member_fail.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-sizeof_member_fail.cpp deleted file mode 100644 index 0348c2ce..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-sizeof_member_fail.cpp +++ /dev/null @@ -1,9 +0,0 @@ -struct foo { - int baz; - double bar; -}; - -int main(void) -{ - return (sizeof(foo::bar) == 4) ? 0 : 1; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-static_assert.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-static_assert.cpp deleted file mode 100644 index 47c2fefb..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-static_assert.cpp +++ /dev/null @@ -1,5 +0,0 @@ -int main(void) -{ - static_assert(0 < 1, "your ordering of integers is screwed"); - return 0; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-static_assert_fail_compile.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-static_assert_fail_compile.cpp deleted file mode 100644 index 362fcdde..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-static_assert_fail_compile.cpp +++ /dev/null @@ -1,5 +0,0 @@ -int main(void) -{ - static_assert(1 < 0, "your ordering of integers is screwed"); - return 0; -} diff --git a/cmake/Modules/CheckCXX11Features/cxx11-test-variadic_templates.cpp b/cmake/Modules/CheckCXX11Features/cxx11-test-variadic_templates.cpp deleted file mode 100644 index 4518e886..00000000 --- a/cmake/Modules/CheckCXX11Features/cxx11-test-variadic_templates.cpp +++ /dev/null @@ -1,23 +0,0 @@ -int Accumulate() -{ - return 0; -} - -template -int Accumulate(T v, Ts... vs) -{ - return v + Accumulate(vs...); -} - -template -int CountElements() -{ - return sizeof...(Is); -} - -int main() -{ - int acc = Accumulate(1, 2, 3, 4, -5); - int count = CountElements<1,2,3,4,5>(); - return ((acc == 5) && (count == 5)) ? 0 : 1; -} diff --git a/examples/OpenGL/OpenGLWidget.cpp b/examples/OpenGL/OpenGLWidget.cpp index 1cd271b6..beebc2eb 100644 --- a/examples/OpenGL/OpenGLWidget.cpp +++ b/examples/OpenGL/OpenGLWidget.cpp @@ -87,7 +87,7 @@ void OpenGLWidget::setVolume(PolyVox::LargeVolume* volDat //Extract the surface for this region //extractSurface(m_volData, 0, PolyVox::Region(regLowerCorner, regUpperCorner), meshCurrent); - polyvox_shared_ptr< SurfaceMesh > mesh(new SurfaceMesh); + std::shared_ptr< SurfaceMesh > mesh(new SurfaceMesh); MarchingCubesSurfaceExtractor< LargeVolume > surfaceExtractor(volData, PolyVox::Region(regLowerCorner, regUpperCorner), mesh.get()); surfaceExtractor.execute(); @@ -193,7 +193,7 @@ void OpenGLWidget::paintGL() Vector3DUint8 v3dRegPos(uRegionX,uRegionY,uRegionZ); if(m_mapSurfaceMeshes.find(v3dRegPos) != m_mapSurfaceMeshes.end()) { - polyvox_shared_ptr< SurfaceMesh > meshCurrent = m_mapSurfaceMeshes[v3dRegPos]; + std::shared_ptr< SurfaceMesh > meshCurrent = m_mapSurfaceMeshes[v3dRegPos]; unsigned int uLodLevel = 0; //meshCurrent->m_vecLodRecords.size() - 1; if(m_bUseOpenGLVertexBufferObjects) { diff --git a/examples/OpenGL/OpenGLWidget.h b/examples/OpenGL/OpenGLWidget.h index ef6ff636..ca475b3a 100644 --- a/examples/OpenGL/OpenGLWidget.h +++ b/examples/OpenGL/OpenGLWidget.h @@ -88,7 +88,7 @@ class OpenGLWidget : public QGLWidget //Rather than storing one big mesh, the volume is broken into regions and a mesh is stored for each region std::map m_mapOpenGLSurfaceMeshes; - std::map >, Vector3DUint8Compare> m_mapSurfaceMeshes; + std::map >, Vector3DUint8Compare> m_mapSurfaceMeshes; unsigned int m_uRegionSideLength; unsigned int m_uVolumeWidthInRegions; diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 371ebc5d..0d07f2b8 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -22,11 +22,6 @@ PROJECT(PolyVoxCore) -if(NOT MSVC) - #Set up the C++11 feature header file based on the CheckCXX11Features script - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/include/PolyVoxCore/Impl/CompilerCapabilities.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/PolyVoxCore/Impl/CompilerCapabilities.h) -endif() - #Projects source files SET(CORE_SRC_FILES source/ArraySizes.cpp @@ -119,7 +114,6 @@ SET(IMPL_INC_FILES include/PolyVoxCore/Impl/ArraySizesImpl.h include/PolyVoxCore/Impl/ArraySizesImpl.inl include/PolyVoxCore/Impl/AStarPathfinderImpl.h - include/PolyVoxCore/Impl/CompilerCapabilities.h include/PolyVoxCore/Impl/Config.h include/PolyVoxCore/Impl/ErrorHandling.h include/PolyVoxCore/Impl/Logging.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h index 3817f0ad..e6fceddf 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h @@ -32,6 +32,11 @@ freely, subject to the following restrictions: #include #include //For runtime_error +namespace std { +template +class function; +} + namespace PolyVox { const float sqrt_1 = 1.0f; @@ -71,8 +76,8 @@ namespace PolyVox float fHBias = 1.0, uint32_t uMaxNoOfNodes = 10000, Connectivity requiredConnectivity = TwentySixConnected, - polyvox_function funcIsVoxelValidForPath = &aStarDefaultVoxelValidator, - polyvox_function funcProgressCallback = nullptr + std::function funcIsVoxelValidForPath = &aStarDefaultVoxelValidator, + std::function funcProgressCallback = nullptr ) :volume(volData) ,start(v3dStart) @@ -126,14 +131,14 @@ namespace PolyVox /// you could check to ensure that the voxel above is empty and the voxel below is solid. /// /// \sa aStarDefaultVoxelValidator - polyvox_function isVoxelValidForPath; + std::function isVoxelValidForPath; /// This function is called by the AStarPathfinder to report on its progress in getting to /// the goal. The progress is reported by computing the distance from the closest node found /// so far to the end node, and comparing this with the distance from the start node to the /// end node. This progress value is guarenteed to never decrease, but it may stop increasing ///for short periods of time. It may even stop increasing altogether if a path cannot be found. - polyvox_function progressCallback; + std::function progressCallback; }; /// The AStarPathfinder compute a path from one point in the volume to another. diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.h index 19ab244f..3a65c217 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/ArraySizesImpl.h @@ -26,6 +26,8 @@ distribution. #include "PolyVoxCore/Impl/TypeDef.h" +#include + namespace PolyVox { /* diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h deleted file mode 100644 index 074c3555..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This file describes the capabilities of the C++ compiler and is used to determine which features to enable in PolyVox. - * It assumes that if the compiler is from VS2008 or earlier then no C++11 is present, otherwise it assumes full support - * is present. - * - * Not that this file is usually overwritten by CMake which does careful tests of the true compiler capabilities. However, - * we provide this default file so that CMake is not actually required for users of PolyVox and they can instead just drop - * PolyVox code into their project/makefile if they prefer. - */ - -#ifndef __PolyVox_CompilerCapabilities_H__ -#define __PolyVox_CompilerCapabilities_H__ - -// If we are not using Visual Studio (or we are but it -// is a recent version) then assume support for these. -#if !defined(_MSC_VER) || (_MSC_VER >= 1600) - #define HAS_CXX11_CONSTEXPR - #define HAS_CXX11_STATIC_ASSERT - #define HAS_CXX11_CSTDINT_H - #define HAS_CXX11_SHARED_PTR -#endif - -#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in b/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in deleted file mode 100644 index 31f1ba80..00000000 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/CompilerCapabilities.h.in +++ /dev/null @@ -1,17 +0,0 @@ -/* - * This file is an input file for the CMake build system. It is processed and - * placed in the build directory by CMake. -*/ - -#ifndef __PolyVox_CompilerCapabilities_H__ -#define __PolyVox_CompilerCapabilities_H__ - -#cmakedefine HAS_CXX11_CONSTEXPR - -#cmakedefine HAS_CXX11_STATIC_ASSERT - -#cmakedefine HAS_CXX11_CSTDINT_H - -#cmakedefine HAS_CXX11_SHARED_PTR - -#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h index acfd5e7f..be7515a6 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h @@ -110,35 +110,6 @@ freely, subject to the following restrictions: #endif -/* - * Static Assertions - * ----------------- - * These map to C+11 static_assert if available or our own implentation otherwise. - */ - -#if defined(HAS_CXX11_STATIC_ASSERT) - //In this case we can just use static_assert - #define POLYVOX_STATIC_ASSERT static_assert -#else - namespace PolyVox - { - // empty default template - template - struct StaticAssert {}; - - // template specialized on true - template <> - struct StaticAssert - { - // If the static assertion is failing then this function won't exist. It will then - // appear in the error message which gives a clue to the user about what is wrong. - static void ERROR_The_static_assertion_has_failed() {} - }; - } - - #define POLYVOX_STATIC_ASSERT(condition, message) StaticAssert<(condition)>::ERROR_The_static_assertion_has_failed(); -#endif - /* * Exceptions * ---------- diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h index 19aece87..2f29ae43 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/MarchingCubesTables.h @@ -26,6 +26,8 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Impl/TypeDef.h" +#include + namespace PolyVox { extern const POLYVOX_API uint16_t edgeTable[256]; diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h index 4500207e..1069a791 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/TypeDef.h @@ -24,8 +24,6 @@ freely, subject to the following restrictions: #ifndef __PolyVox_TypeDef_H__ #define __PolyVox_TypeDef_H__ -#include "PolyVoxCore/Impl/CompilerCapabilities.h" - //Definitions needed to make library functions accessable // See http://gcc.gnu.org/wiki/Visibility for more info. #if defined _WIN32 || defined __CYGWIN__ @@ -69,52 +67,4 @@ freely, subject to the following restrictions: #define POLYVOX_LOCAL #endif // POLYVOX_SHARED -//Check which compiler we are using and work around unsupported features as necessary. -#if defined(_MSC_VER) && (_MSC_VER < 1600) - //To support old (pre-vc2010) Microsoft compilers we use boost to replace the - //std::shared_ptr and potentially other C++0x features. To use this capability you - //will need to make sure you have boost installed on your system. - #include - #define polyvox_function boost::function - - #include - #define polyvox_bind boost::bind - #define polyvox_placeholder_1 _1 - #define polyvox_placeholder_2 _2 -#else - //We have a decent compiler - use real C++0x features - #include - #define polyvox_function std::function - #define polyvox_bind std::bind - #define polyvox_placeholder_1 std::placeholders::_1 - #define polyvox_placeholder_2 std::placeholders::_2 -#endif - -#if defined(HAS_CXX11_CONSTEXPR) - #define polyvox_constexpr_const constexpr //constexpr which falls back to const - #define polyvox_constexpr constexpr //constexpr which falls back to nothing -#else - #define polyvox_constexpr_const const - #define polyvox_constexpr -#endif - -#if defined(HAS_CXX11_CSTDINT_H) - #include -#else - typedef signed char int8_t; - typedef unsigned char uint8_t; - typedef short int16_t; - typedef unsigned short uint16_t; - typedef long int32_t; - typedef unsigned long uint32_t; -#endif - -#if defined(HAS_CXX11_SHARED_PTR) - #include - #define polyvox_shared_ptr std::shared_ptr -#else - #include - #define polyvox_shared_ptr boost::shared_ptr -#endif - #endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h index 2eef3077..702e786a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h +++ b/library/PolyVoxCore/include/PolyVoxCore/PolyVoxForwardDeclarations.h @@ -26,6 +26,8 @@ freely, subject to the following restrictions: #include "Impl/TypeDef.h" +#include + namespace PolyVox { //////////////////////////////////////////////////////////////////////////////// diff --git a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h index 9ccc58fb..1de4a905 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.h @@ -75,7 +75,7 @@ namespace PolyVox //RATE THE STD::SET CAUSES PROBLEMS WITH SWIG. IF YOU UNCOMMENT ANY OF THESE FUNCTIONS, PLEASE POST ON //THE FORUM SO WE CAN KNOW THE FUNCTIONALITY IS STILL NEEDED IN SOME FORM. //void sumNearbyNormals(bool bNormaliseResult = true); - //polyvox_shared_ptr< SurfaceMesh > extractSubset(std::set setMaterials); + //std::shared_ptr< SurfaceMesh > extractSubset(std::set setMaterials); //void generateAveragedFaceNormals(bool bNormalise, bool bIncludeEdgeVertices = false); int noOfDegenerateTris(void); @@ -96,7 +96,7 @@ namespace PolyVox }; template - polyvox_shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials); + std::shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials); } #include "PolyVoxCore/SurfaceMesh.inl" diff --git a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl index 0ce70aea..d9355466 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SurfaceMesh.inl @@ -245,9 +245,9 @@ namespace PolyVox }*/ /*template - polyvox_shared_ptr< SurfaceMesh > SurfaceMesh::extractSubset(std::set setMaterials) + std::shared_ptr< SurfaceMesh > SurfaceMesh::extractSubset(std::set setMaterials) { - polyvox_shared_ptr< SurfaceMesh > result(new SurfaceMesh); + std::shared_ptr< SurfaceMesh > result(new SurfaceMesh); if(m_vecVertices.size() == 0) //FIXME - I don't think we should need this test, but I have seen crashes otherwise... { @@ -395,9 +395,9 @@ namespace PolyVox //Currently a free function - think where this needs to go. template - polyvox_shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials) + std::shared_ptr< SurfaceMesh > extractSubset(SurfaceMesh& inputMesh, std::set setMaterials) { - polyvox_shared_ptr< SurfaceMesh > result(new SurfaceMesh); + std::shared_ptr< SurfaceMesh > result(new SurfaceMesh); result->m_Region = inputMesh.m_Region; diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl index a877fea0..6dc04e90 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl @@ -53,7 +53,7 @@ namespace PolyVox template Vector::Vector(StorageType x, StorageType y) { - POLYVOX_STATIC_ASSERT(Size == 2, "This constructor should only be used for vectors with two elements."); + static_assert(Size == 2, "This constructor should only be used for vectors with two elements."); m_tElements[0] = x; m_tElements[1] = y; @@ -68,7 +68,7 @@ namespace PolyVox template Vector::Vector(StorageType x, StorageType y, StorageType z) { - POLYVOX_STATIC_ASSERT(Size == 3, "This constructor should only be used for vectors with three elements."); + static_assert(Size == 3, "This constructor should only be used for vectors with three elements."); m_tElements[0] = x; m_tElements[1] = y; @@ -86,7 +86,7 @@ namespace PolyVox template Vector::Vector(StorageType x, StorageType y, StorageType z, StorageType w) { - POLYVOX_STATIC_ASSERT(Size == 4, "This constructor should only be used for vectors with four elements."); + static_assert(Size == 4, "This constructor should only be used for vectors with four elements."); m_tElements[0] = x; m_tElements[1] = y; @@ -136,7 +136,7 @@ namespace PolyVox // vector with one element, and supporting this would cause confusion over the // behaviour of the constructor taking a single value, as this fills all elements // to that value rather than just the first one. - POLYVOX_STATIC_ASSERT(Size > 1, "Vector must have a length greater than one."); + static_assert(Size > 1, "Vector must have a length greater than one."); } /** @@ -446,7 +446,7 @@ namespace PolyVox template inline StorageType Vector::getZ(void) const { - POLYVOX_STATIC_ASSERT(Size >= 3, "You can only get the 'z' component from a vector with at least three elements."); + static_assert(Size >= 3, "You can only get the 'z' component from a vector with at least three elements."); return m_tElements[2]; } @@ -457,7 +457,7 @@ namespace PolyVox template inline StorageType Vector::getW(void) const { - POLYVOX_STATIC_ASSERT(Size >= 4, "You can only get the 'w' component from a vector with at least four elements."); + static_assert(Size >= 4, "You can only get the 'w' component from a vector with at least four elements."); return m_tElements[3]; } @@ -499,7 +499,7 @@ namespace PolyVox template inline void Vector::setElements(StorageType x, StorageType y, StorageType z) { - POLYVOX_STATIC_ASSERT(Size >= 3, "You can only use this version of setElements() on a vector with at least three elements."); + static_assert(Size >= 3, "You can only use this version of setElements() on a vector with at least three elements."); m_tElements[0] = x; m_tElements[1] = y; @@ -516,7 +516,7 @@ namespace PolyVox template inline void Vector::setElements(StorageType x, StorageType y, StorageType z, StorageType w) { - POLYVOX_STATIC_ASSERT(Size >= 4, "You can only use this version of setElements() on a vector with at least four elements."); + static_assert(Size >= 4, "You can only use this version of setElements() on a vector with at least four elements."); m_tElements[0] = x; m_tElements[1] = y; @@ -548,7 +548,7 @@ namespace PolyVox template inline void Vector::setZ(StorageType tZ) { - POLYVOX_STATIC_ASSERT(Size >= 3, "You can only set the 'w' component from a vector with at least three elements."); + static_assert(Size >= 3, "You can only set the 'w' component from a vector with at least three elements."); m_tElements[2] = tZ; } @@ -559,7 +559,7 @@ namespace PolyVox template inline void Vector::setW(StorageType tW) { - POLYVOX_STATIC_ASSERT(Size >= 4, "You can only set the 'w' component from a vector with at least four elements."); + static_assert(Size >= 4, "You can only set the 'w' component from a vector with at least four elements."); m_tElements[3] = tW; } diff --git a/library/PolyVoxCore/source/ArraySizes.cpp b/library/PolyVoxCore/source/ArraySizes.cpp index 4328ad3c..52755a73 100644 --- a/library/PolyVoxCore/source/ArraySizes.cpp +++ b/library/PolyVoxCore/source/ArraySizes.cpp @@ -23,6 +23,8 @@ freely, subject to the following restrictions: #include "PolyVoxCore/ArraySizes.h" +#include + namespace PolyVox { /** diff --git a/library/bindings/PolyVoxCore.i b/library/bindings/PolyVoxCore.i index 6fe2f6d4..09e63e88 100644 --- a/library/bindings/PolyVoxCore.i +++ b/library/bindings/PolyVoxCore.i @@ -1,7 +1,6 @@ %module PolyVoxCore #define POLYVOX_API -%include "PolyVoxCore/Impl/CompilerCapabilities.h" %include "Impl/TypeDef.h" #define __attribute__(x) //Silence DEPRECATED errors From 0e8973e722582f171c1a4ac0509c4372545bbb70 Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Mon, 17 Feb 2014 15:23:44 +0100 Subject: [PATCH 2/2] Fixed minor compile errors: - Lack of in AStarPathfinder.h - Lack of in several files (why did this compile on GCC?) --- library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h | 6 +----- .../PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h | 2 ++ library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.h | 2 ++ library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h index e6fceddf..7b86d8bc 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h @@ -29,14 +29,10 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Array.h" +#include #include #include //For runtime_error -namespace std { -template -class function; -} - namespace PolyVox { const float sqrt_1 = 1.0f; diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h index 81ddb9e5..fcaebe7b 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h @@ -26,6 +26,8 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Impl/TypeDef.h" +#include + namespace PolyVox { template diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.h index 3e1b305f..3e70a02c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/SubArray.h @@ -26,6 +26,8 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Impl/TypeDef.h" +#include + namespace PolyVox { template class Array; diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h index b46df744..71dc7b83 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Utility.h @@ -26,6 +26,8 @@ freely, subject to the following restrictions: #include "PolyVoxCore/Impl/TypeDef.h" +#include + namespace PolyVox { POLYVOX_API uint8_t logBase2(uint32_t uInput);