Skip to content

Commit d9613b7

Browse files
committed
Enable C++11
1 parent 96572b7 commit d9613b7

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ ELSE()
7777
ENDIF()
7878
PROJECT(${MYSQL_PROJECT_NAME})
7979

80+
IF(CMAKE_VERSION VERSION_LESS "3.1")
81+
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
82+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
83+
ENDIF()
84+
ELSE()
85+
SET(CMAKE_CXX_STANDARD 11)
86+
ENDIF()
87+
8088
SET(CPACK_PACKAGE_NAME "MariaDB")
8189
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB: a very fast and robust SQL database server")
8290
SET(CPACK_PACKAGE_URL "http://mariadb.org")

include/m_string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ extern char *strmake(char *dst,const char *src,size_t length);
9999
#define strmake_buf(D,S) strmake(D, S, sizeof(D) - 1)
100100
#else
101101
#define strmake_buf(D,S) ({ \
102-
typeof (D) __x __attribute__((unused)) = { 2 }; \
102+
__typeof__ (D) __x __attribute__((unused)) = { 2 }; \
103103
strmake(D, S, sizeof(D) - 1); \
104104
})
105105
#endif

sql/table.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "sql_cte.h"
4545
#include "ha_sequence.h"
4646
#include "sql_show.h"
47+
#include <atomic>
4748

4849
/* For MySQL 5.7 virtual fields */
4950
#define MYSQL57_GENERATED_FIELD 128
@@ -79,7 +80,7 @@ LEX_CSTRING MYSQL_PROC_NAME= {STRING_WITH_LEN("proc")};
7980
*/
8081
static LEX_CSTRING parse_vcol_keyword= { STRING_WITH_LEN("PARSE_VCOL_EXPR ") };
8182

82-
static int64 last_table_id;
83+
static std::atomic<ulong> last_table_id;
8384

8485
/* Functions defined in this file */
8586

@@ -343,8 +344,8 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name,
343344
*/
344345
do
345346
{
346-
share->table_map_id=(ulong) my_atomic_add64_explicit(&last_table_id, 1,
347-
MY_MEMORY_ORDER_RELAXED);
347+
share->table_map_id=
348+
last_table_id.fetch_add(1, std::memory_order_relaxed);
348349
} while (unlikely(share->table_map_id == ~0UL));
349350
}
350351
DBUG_RETURN(share);

storage/tokudb/PerconaFT/portability/toku_crash.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ run_gdb(pid_t parent_pid, const char *gdb_path) {
7070
"-ex", "thread apply all bt",
7171
"-ex", "thread apply all bt full",
7272
exe_buf, pid_buf,
73-
NULL);
73+
(char*) NULL);
7474
}
7575

7676
static void

0 commit comments

Comments
 (0)