Skip to content

Commit cacaaeb

Browse files
MDEV-35837 Move to c++17
Move from c++11 to c++17.
1 parent 2563839 commit cacaaeb

File tree

13 files changed

+13
-36
lines changed

13 files changed

+13
-36
lines changed

CMakeLists.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,9 @@ ENDIF()
7878
# This is used by TokuDB only
7979
SET(MYSQL_PROJECT_NAME_DOCSTRING "MySQL project name")
8080

81-
IF(CMAKE_VERSION VERSION_LESS "3.1")
82-
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
83-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
84-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
85-
ENDIF()
86-
ELSE()
87-
SET(CMAKE_C_STANDARD 99)
88-
SET(CMAKE_CXX_STANDARD 11)
89-
ENDIF()
81+
# C and C++ standards (e.g. -std=c++17)
82+
SET(CMAKE_C_STANDARD 99)
83+
SET(CMAKE_CXX_STANDARD 17)
9084

9185
# Lower case package names from PROJECT are used if not explictly upper case.
9286
SET(CPACK_PACKAGE_NAME "MariaDB")

cmake/cpack_rpm.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ MESSAGE(STATUS "CPackRPM building with RPM configuration: ${RPM}")
55
SET(CPACK_GENERATOR "RPM")
66
SET(CPACK_RPM_PACKAGE_DEBUG 1)
77
SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
8-
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
98

109
SET(CPACK_RPM_COMPONENT_INSTALL ON)
1110

plugin/handler_socket/handlersocket/database.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ struct dbcontext : public dbcontext_i, private noncopyable {
175175
THD *thd;
176176
MYSQL_LOCK *lock;
177177
bool lock_failed;
178-
std::auto_ptr<expr_user_lock> user_lock;
178+
std::unique_ptr<expr_user_lock> user_lock;
179179
int user_level_lock_timeout;
180180
bool user_level_lock_locked;
181181
bool commit_error;

plugin/handler_socket/handlersocket/database.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
#ifndef DENA_DATABASE_HPP
1010
#define DENA_DATABASE_HPP
1111

12-
#ifdef __GNUC__
13-
/* auto_ptr is deprecated */
14-
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
15-
#endif
16-
1712
#include <string>
1813
#include <memory>
1914
#include <vector>
@@ -26,10 +21,10 @@
2621
namespace dena {
2722

2823
struct database_i;
29-
typedef std::auto_ptr<volatile database_i> database_ptr;
24+
typedef std::unique_ptr<volatile database_i> database_ptr;
3025

3126
struct dbcontext_i;
32-
typedef std::auto_ptr<dbcontext_i> dbcontext_ptr;
27+
typedef std::unique_ptr<dbcontext_i> dbcontext_ptr;
3328

3429
struct database_i {
3530
virtual ~database_i() = default;

plugin/handler_socket/handlersocket/handlersocket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ daemon_handlersocket_init(void *p)
7676
conf["readsize"] = to_stdstring(handlersocket_readsize);
7777
conf["accept_balance"] = to_stdstring(handlersocket_accept_balance);
7878
conf["wrlock_timeout"] = to_stdstring(handlersocket_wrlock_timeout);
79-
std::auto_ptr<daemon_handlersocket_data> ap(new daemon_handlersocket_data);
79+
std::unique_ptr<daemon_handlersocket_data> ap(new daemon_handlersocket_data);
8080
if (handlersocket_port != 0 && handlersocket_port_wr != handlersocket_port) {
8181
conf["port"] = handlersocket_port;
8282
if (handlersocket_plain_secret) {

plugin/handler_socket/handlersocket/hstcpsvr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ hstcpsvr::start_listen()
115115
arg.cshared = &cshared;
116116
arg.vshared = &vshared;
117117
arg.worker_id = i;
118-
std::auto_ptr< thread<worker_throbj> > thr(
118+
std::unique_ptr< thread<worker_throbj> > thr(
119119
new thread<worker_throbj>(arg, stack_size));
120120
threads.push_back_ptr(thr);
121121
}

plugin/handler_socket/handlersocket/hstcpsvr.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct hstcpsvr_shared_v : public mutex {
4444
};
4545

4646
struct hstcpsvr_i;
47-
typedef std::auto_ptr<hstcpsvr_i> hstcpsvr_ptr;
47+
typedef std::unique_ptr<hstcpsvr_i> hstcpsvr_ptr;
4848

4949
struct hstcpsvr_i {
5050
virtual ~hstcpsvr_i() = default;

plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ hstcpsvr_worker::run_one_nb()
451451
{
452452
pollfd& pfd = pfds[nfds - 1];
453453
if ((pfd.revents & mask_in) != 0) {
454-
std::auto_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
454+
std::unique_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
455455
c->nonblocking = true;
456456
c->readsize = cshared.readsize;
457457
c->accept(cshared);
@@ -498,7 +498,7 @@ hstcpsvr_worker::run_one_ep()
498498
/* listener */
499499
++accept_count;
500500
DBG_EP(fprintf(stderr, "IN listener\n"));
501-
std::auto_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
501+
std::unique_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
502502
c->nonblocking = true;
503503
c->readsize = cshared.readsize;
504504
c->accept(cshared);

plugin/handler_socket/handlersocket/hstcpsvr_worker.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace dena {
1515

1616
struct hstcpsvr_worker_i;
17-
typedef std::auto_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr;
17+
typedef std::unique_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr;
1818

1919
struct hstcpsvr_worker_arg {
2020
const hstcpsvr_shared_c *cshared;

plugin/handler_socket/libhsclient/hstcpcli.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
#include "string_ref.hpp"
2020
#include "string_buffer.hpp"
2121

22-
#ifdef __GNUC__
23-
/* auto_ptr is deprecated */
24-
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
25-
#endif
26-
2722
namespace dena {
2823

2924
struct hstcpcli_filter {
@@ -35,7 +30,7 @@ struct hstcpcli_filter {
3530
};
3631

3732
struct hstcpcli_i;
38-
typedef std::auto_ptr<hstcpcli_i> hstcpcli_ptr;
33+
typedef std::unique_ptr<hstcpcli_i> hstcpcli_ptr;
3934

4035
struct hstcpcli_i {
4136
virtual ~hstcpcli_i() = default;

0 commit comments

Comments
 (0)