[Commits] b88e98df9da: C++11 experiment: check if all builders support it
revision-id: b88e98df9daa586bd6ed1f5908ededaa65a6e464 (mariadb-10.3.6-16-gb88e98df9da) parent(s): 9988a423d229730b252942b7fa066d1591b7eca9 author: Sergey Vojtovich committer: Sergey Vojtovich timestamp: 2018-06-04 12:41:18 +0400 message: C++11 experiment: check if all builders support it --- CMakeLists.txt | 8 ++++++++ include/m_string.h | 2 +- sql/table.cc | 7 ++++--- storage/tokudb/PerconaFT/portability/toku_crash.cc | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76b0817f8c7..efeae3d1ca5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,14 @@ ELSE() ENDIF() PROJECT(${MYSQL_PROJECT_NAME}) +IF(CMAKE_VERSION VERSION_LESS "3.1") + IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") + ENDIF() +ELSE() + SET(CMAKE_CXX_STANDARD 11) +ENDIF() + SET(CPACK_PACKAGE_NAME "MariaDB") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB: a very fast and robust SQL database server") SET(CPACK_PACKAGE_URL "http://mariadb.org") diff --git a/include/m_string.h b/include/m_string.h index d50da8770c3..c8b5774b08c 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -99,7 +99,7 @@ extern char *strmake(char *dst,const char *src,size_t length); #define strmake_buf(D,S) strmake(D, S, sizeof(D) - 1) #else #define strmake_buf(D,S) ({ \ - typeof (D) __x __attribute__((unused)) = { 2 }; \ + __typeof__ (D) __x __attribute__((unused)) = { 2 }; \ strmake(D, S, sizeof(D) - 1); \ }) #endif diff --git a/sql/table.cc b/sql/table.cc index 11e1b9f3b7a..0a2b7155c48 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -44,6 +44,7 @@ #include "sql_cte.h" #include "ha_sequence.h" #include "sql_show.h" +#include <atomic> /* For MySQL 5.7 virtual fields */ #define MYSQL57_GENERATED_FIELD 128 @@ -79,7 +80,7 @@ LEX_CSTRING MYSQL_PROC_NAME= {STRING_WITH_LEN("proc")}; */ static LEX_CSTRING parse_vcol_keyword= { STRING_WITH_LEN("PARSE_VCOL_EXPR ") }; -static int64 last_table_id; +static std::atomic<ulong> last_table_id; /* Functions defined in this file */ @@ -343,8 +344,8 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name, */ do { - share->table_map_id=(ulong) my_atomic_add64_explicit(&last_table_id, 1, - MY_MEMORY_ORDER_RELAXED); + share->table_map_id= + last_table_id.fetch_add(1, std::memory_order_relaxed); } while (unlikely(share->table_map_id == ~0UL)); } DBUG_RETURN(share); diff --git a/storage/tokudb/PerconaFT/portability/toku_crash.cc b/storage/tokudb/PerconaFT/portability/toku_crash.cc index 0af85342a99..297cc29d9ca 100644 --- a/storage/tokudb/PerconaFT/portability/toku_crash.cc +++ b/storage/tokudb/PerconaFT/portability/toku_crash.cc @@ -70,7 +70,7 @@ run_gdb(pid_t parent_pid, const char *gdb_path) { "-ex", "thread apply all bt", "-ex", "thread apply all bt full", exe_buf, pid_buf, - NULL); + (char*) NULL); } static void
participants (1)
-
serg@mariadb.org