diff --git a/README.md b/README.md index 140fd00..cff0224 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,9 @@ - Ubuntu 16.04 or later - Environment created using dali_env script in dali-core repository - - GCC version 6 - -DALi requires a compiler supporting C++11 features. -Ubuntu 16.04 is the first version to offer this by default (GCC v5.4.0). + - GCC version 9 -GCC version 6 is recommended since it has fixes for issues in version 5 -e.g. it avoids spurious 'defined but not used' warnings in header files. +DALi requires a compiler supporting C++17 features. ### Building the Repository diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 82c7ab4..4c79f6d 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -1,4 +1,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(CMAKE_C_STANDARD 99) PROJECT(dali-demo C CXX) SET(dali-demo_VERSION_MAJOR 1) @@ -304,8 +306,10 @@ ENDIF(INTERNATIONALIZATION) IF( WIN32 ) ADD_COMPILE_OPTIONS( /FIdali-windows-dependencies.h ) # Adds missing definitions. ADD_COMPILE_OPTIONS( /vmg ) # Avoids a 'reinterpret_cast' compile error while compiling signals and callbacks. + ADD_COMPILE_OPTIONS( /std:c++17 ) # c++17 support ADD_COMPILE_OPTIONS( /wd4251 ) # Ignores warning C4251: "'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'" ELSE() + ADD_COMPILE_OPTIONS( -std=c++17 ) # c++17 support SET(DALI_DEMO_CFLAGS "${DALI_DEMO_CFLAGS} -Werror -Wall -fPIE") IF( NOT ${ENABLE_EXPORTALL} ) diff --git a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp index 1242d95..cd6c837 100644 --- a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp +++ b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp @@ -48,6 +48,8 @@ #include #include #include +#include // std::default_random_engine +#include // std::chrono::system_clock // INTERNAL INCLUDES #include "grid-flags.h" @@ -417,8 +419,10 @@ public: } } // Stir-up the list to get some nice irregularity in the generated field: - std::random_shuffle( configurations.begin(), configurations.end() ); - std::random_shuffle( configurations.begin(), configurations.end() ); + unsigned int seed = std::chrono::system_clock::now().time_since_epoch().count(); + std::shuffle( configurations.begin(), configurations.end(), std::default_random_engine(seed) ); + seed = std::chrono::system_clock::now().time_since_epoch().count(); + std::shuffle( configurations.begin(), configurations.end(), std::default_random_engine(seed) ); // Place the images in the grid: diff --git a/examples/sparkle/sparkle-effect-example.cpp b/examples/sparkle/sparkle-effect-example.cpp index 67af10f..a1444fa 100644 --- a/examples/sparkle/sparkle-effect-example.cpp +++ b/examples/sparkle/sparkle-effect-example.cpp @@ -21,6 +21,8 @@ #include #include #include +#include // std::default_random_engine +#include // std::chrono::system_clock #include "shared/utility.h" #include "sparkle-effect.h" @@ -126,7 +128,8 @@ private: { shuffleArray[i] = i; } - std::random_shuffle(&shuffleArray[0],&shuffleArray[NUM_PARTICLE]); + const unsigned int seed = std::chrono::system_clock::now().time_since_epoch().count(); + std::shuffle(&shuffleArray[0],&shuffleArray[NUM_PARTICLE], std::default_random_engine(seed)); // Create vertices