diff --git a/.travis.yml b/.travis.yml index 922f0b3b..b233fc97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,8 @@ addons: sources: - ubuntu-toolchain-r-test packages: - - gcc-4.8 - - g++-4.8 + - gcc-6 + - g++-6 - clang - libc++-dev @@ -33,9 +33,6 @@ matrix: - compiler: clang "release build with clang3.9" env: EASTL_CONFIG=Release USE_CLANG_39=yes os: osx - - compiler: clang "build with Buck" - env: USE_BUCK=yes - os: osx exclude: - os: osx compiler: gcc @@ -47,11 +44,11 @@ install: # Linux Setup # CMake - - if [[ "$TRAVIS_OS_NAME" == "linux" && ! -n "$USE_BUCK" ]]; then wget --no-check-certificate http://cmake.org/files/v3.1/cmake-3.1.3-Linux-x86_64.tar.gz ;fi - - if [[ "$TRAVIS_OS_NAME" == "linux" && ! -n "$USE_BUCK" ]]; then tar -xzf cmake-3.1.3-Linux-x86_64.tar.gz ;fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget --no-check-certificate http://cmake.org/files/v3.1/cmake-3.1.3-Linux-x86_64.tar.gz ;fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar -xzf cmake-3.1.3-Linux-x86_64.tar.gz ;fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=$PWD/cmake-3.1.3-Linux-x86_64/bin:$PATH ;fi # GCC - - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" = "g++" ]]; then export CXX="g++-4.8" CC="gcc-4.8" ;fi + - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" = "g++" ]]; then export CXX="g++-6" CC="gcc-6" ;fi # Linuxbrew - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then test -d $HOME/.linuxbrew/bin || git clone https://github.com/Linuxbrew/brew.git $HOME/.linuxbrew ;fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then PATH="$HOME/.linuxbrew/bin:$PATH" ;fi @@ -60,15 +57,15 @@ install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export INFOPATH="$(brew --prefix)/share/info:$INFOPATH" ;fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then brew --version ;fi # Linuxbrew GCC - - if [[ "$TRAVIS_OS_NAME" == "linux" && -n "$USE_BUCK" ]]; then brew install gcc ;fi - - if [[ "$TRAVIS_OS_NAME" == "linux" && -n "$USE_BUCK" ]]; then which gcc ;fi - - if [[ "$TRAVIS_OS_NAME" == "linux" && -n "$USE_BUCK" ]]; then gcc --version ;fi + # - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then brew install gcc ;fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then which gcc ;fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then gcc --version ;fi # OSX Setup # CMake - - if [[ "$TRAVIS_OS_NAME" == "osx" && ! -n "$USE_BUCK" ]]; then wget --no-check-certificate http://cmake.org/files/v3.1/cmake-3.1.3-Darwin-x86_64.tar.gz ;fi - - if [[ "$TRAVIS_OS_NAME" == "osx" && ! -n "$USE_BUCK" ]]; then tar -xzf cmake-3.1.3-Darwin-x86_64.tar.gz ;fi - - if [[ "$TRAVIS_OS_NAME" == "osx" && ! -n "$USE_BUCK" ]]; then export PATH=$PWD/cmake-3.1.3-Darwin-x86_64/CMake.app/Contents/bin:$PATH ;fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget --no-check-certificate http://cmake.org/files/v3.1/cmake-3.1.3-Darwin-x86_64.tar.gz ;fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tar -xzf cmake-3.1.3-Darwin-x86_64.tar.gz ;fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=$PWD/cmake-3.1.3-Darwin-x86_64/CMake.app/Contents/bin:$PATH ;fi # Clang 3.9 - if [[ "$TRAVIS_OS_NAME" == "osx" && -n "$USE_CLANG_39" ]]; then export CLANG_URL=http://releases.llvm.org/3.9.0/clang+llvm-3.9.0-x86_64-apple-darwin.tar.xz ;fi - if [[ "$TRAVIS_OS_NAME" == "osx" && -n "$USE_CLANG_39" ]]; then wget --no-check-certificate $CLANG_URL ;fi @@ -83,12 +80,6 @@ install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew --version ;fi # Universal Setup - # Buck - - if [[ -n "$USE_BUCK" ]]; then brew install ant ;fi - - if [[ -n "$USE_BUCK" ]]; then brew tap facebook/fb ;fi - - if [[ -n "$USE_BUCK" ]]; then brew install buck ;fi - - if [[ -n "$USE_BUCK" ]]; then buck --version ;fi - before_script: - if [[ "$CXX" == "clang++" ]]; then export CXXFLAGS="$CXXFLAGS -I${LLVM_ROOT}/install/include -std=c++14 -stdlib=libc++" ;fi - if [[ "$CXX" == "clang++" ]]; then export LDFLAGS="$LDFLAGS -L${LLVM_ROOT}/install/lib" ;fi @@ -97,21 +88,18 @@ before_script: - if [[ -n "$USE_CLANG_39" ]]; then export CXX="clang++" ;fi - if [[ -n "$USE_CLANG_39" ]]; then export CXXFLAGS="$CXXFLAGS -I${CLANG_39_PATH}/include -std=c++14 -stdlib=libc++" ;fi - if [[ -n "$USE_CLANG_39" ]]; then export LDFLAGS="$LDFLAGS -L${CLANG_39_PATH}/lib" ;fi - - if [[ ! -n "$USE_BUCK" ]]; then mkdir build_$EASTL_CONFIG ;fi - - if [[ ! -n "$USE_BUCK" ]]; then cd build_$EASTL_CONFIG ;fi - - if [[ ! -n "$USE_BUCK" ]]; then cmake .. -DEASTL_BUILD_BENCHMARK:BOOL=ON -DEASTL_BUILD_TESTS:BOOL=ON ;fi - - if [[ ! -n "$USE_BUCK" ]]; then cmake --build . --config $EASTL_CONFIG ;fi + - mkdir build_$EASTL_CONFIG + - cd build_$EASTL_CONFIG + - cmake .. -DEASTL_BUILD_BENCHMARK:BOOL=ON -DEASTL_BUILD_TESTS:BOOL=ON + - cmake --build . --config $EASTL_CONFIG script: - # Run the Buck build and tests - - if [[ -n "$USE_BUCK" ]]; then buck build :eastl ;fi - - if [[ -n "$USE_BUCK" ]]; then buck run :test-runner ;fi # Run Tests - - if [[ ! -n "$USE_BUCK" ]]; then cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/test ;fi - - if [[ ! -n "$USE_BUCK" ]]; then ctest -C $EASTL_CONFIG -V || exit 1 ;fi + - cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/test + - ctest -C $EASTL_CONFIG -V || exit 1 # Run Benchmarks - - if [[ ! -n "$USE_BUCK" ]]; then cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/benchmark ;fi - - if [[ ! -n "$USE_BUCK" ]]; then ctest -C $EASTL_CONFIG -V || exit 1 ;fi + - cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/benchmark + - ctest -C $EASTL_CONFIG -V || exit 1 branches: except: diff --git a/include/EASTL/fixed_function.h b/include/EASTL/fixed_function.h index 5340a7bb..6b437b0a 100644 --- a/include/EASTL/fixed_function.h +++ b/include/EASTL/fixed_function.h @@ -120,7 +120,7 @@ namespace ff_detail static const int SIZE_IN_BYTES = SIZE_IN_BYTES_T; functor_storage_type_with_size functor; - const function_table* function_table; + const function_table* function_table_ptr; }; @@ -173,7 +173,7 @@ namespace ff_detail template static void init_function_table(TotalStorageType& storage) { - storage.function_table = &get_default_function_table(); + storage.function_table_ptr = &get_default_function_table(); } @@ -339,7 +339,7 @@ class fixed_function fixed_function(const fixed_function& other) : call(other.call) { - other.storage.function_table->call_copy(eastl::addressof(storage), eastl::addressof(other.storage)); + other.storage.function_table_ptr->call_copy(eastl::addressof(storage), eastl::addressof(other.storage)); } template @@ -360,7 +360,7 @@ class fixed_function fixed_function& operator=(const fixed_function& other) EA_NOEXCEPT { call = other.call; - other.storage.function_table->call_copy(eastl::addressof(storage), eastl::addressof(other.storage)); + other.storage.function_table_ptr->call_copy(eastl::addressof(storage), eastl::addressof(other.storage)); return *this; } @@ -387,7 +387,7 @@ class fixed_function ~fixed_function() EA_NOEXCEPT { - storage.function_table->call_destroy(eastl::addressof(storage)); + storage.function_table_ptr->call_destroy(eastl::addressof(storage)); } Result operator()(Arguments... arguments) const @@ -398,9 +398,9 @@ class fixed_function void swap(fixed_function& other) EA_NOEXCEPT { total_storage_type_with_size temp_storage; - other.storage.function_table->call_move_and_destroy(eastl::addressof(temp_storage), eastl::addressof(other.storage)); - storage.function_table->call_move_and_destroy(eastl::addressof(other.storage), eastl::addressof(storage)); - temp_storage.function_table->call_move_and_destroy(eastl::addressof(storage), eastl::addressof(temp_storage)); + other.storage.function_table_ptr->call_move_and_destroy(eastl::addressof(temp_storage), eastl::addressof(other.storage)); + storage.function_table_ptr->call_move_and_destroy(eastl::addressof(other.storage), eastl::addressof(storage)); + temp_storage.function_table_ptr->call_move_and_destroy(eastl::addressof(storage), eastl::addressof(temp_storage)); eastl::swap(call, other.call); } @@ -408,19 +408,19 @@ class fixed_function #ifndef FUNC_NO_RTTI const std::type_info& target_type() const EA_NOEXCEPT { - return storage.function_table->call_type_id(); + return storage.function_table_ptr->call_type_id(); } template T* target() EA_NOEXCEPT { - return static_cast(storage.function_table->call_target(eastl::addressof(storage), typeid(T))); + return static_cast(storage.function_table_ptr->call_target(eastl::addressof(storage), typeid(T))); } template const T* target() const EA_NOEXCEPT { - return static_cast(storage.function_table->call_target(eastl::addressof(storage), typeid(T))); + return static_cast(storage.function_table_ptr->call_target(eastl::addressof(storage), typeid(T))); } #endif diff --git a/test/source/TestFunctional.cpp b/test/source/TestFunctional.cpp index 9ef4a0c3..a379f282 100644 --- a/test/source/TestFunctional.cpp +++ b/test/source/TestFunctional.cpp @@ -495,13 +495,19 @@ int TestFunctional() static_assert(eastl::is_same>::type, int &>::value, "incorrect type for invoke_result"); static_assert(eastl::is_invocable>::value, "incorrect value for is_invocable"); } + + #ifndef EA_COMPILER_GNUC { TestStruct a(42); EATEST_VERIFY(eastl::invoke(&TestStruct::GetValue, a) == 42); - static_assert(eastl::is_same::type, int>::value, "incorrect type for invoke_result"); - static_assert(eastl::is_invocable::value, "incorrect value for is_invocable"); + static_assert( + eastl::is_same::type, int>::value, + "incorrect type for invoke_result"); + + static_assert(eastl::is_invocable::value, "incorrect value for is_invocable"); } + #endif { TestFunctor f; eastl::invoke(f);