mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 02:30:06 +01:00
MDEV-35837 Move to c++17
Move from c++11 to c++17.
This commit is contained in:
parent
3761a7fec8
commit
941daa6b52
9 changed files with 11 additions and 21 deletions
|
@ -85,7 +85,7 @@ IF(CMAKE_VERSION VERSION_LESS "3.1")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CMAKE_C_STANDARD 99)
|
SET(CMAKE_C_STANDARD 99)
|
||||||
SET(CMAKE_CXX_STANDARD 11)
|
SET(CMAKE_CXX_STANDARD 17)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Lower case package names from PROJECT are used if not explictly upper case.
|
# Lower case package names from PROJECT are used if not explictly upper case.
|
||||||
|
|
|
@ -175,7 +175,7 @@ struct dbcontext : public dbcontext_i, private noncopyable {
|
||||||
THD *thd;
|
THD *thd;
|
||||||
MYSQL_LOCK *lock;
|
MYSQL_LOCK *lock;
|
||||||
bool lock_failed;
|
bool lock_failed;
|
||||||
std::auto_ptr<expr_user_lock> user_lock;
|
std::unique_ptr<expr_user_lock> user_lock;
|
||||||
int user_level_lock_timeout;
|
int user_level_lock_timeout;
|
||||||
bool user_level_lock_locked;
|
bool user_level_lock_locked;
|
||||||
bool commit_error;
|
bool commit_error;
|
||||||
|
|
|
@ -9,11 +9,6 @@
|
||||||
#ifndef DENA_DATABASE_HPP
|
#ifndef DENA_DATABASE_HPP
|
||||||
#define DENA_DATABASE_HPP
|
#define DENA_DATABASE_HPP
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
/* auto_ptr is deprecated */
|
|
||||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -26,10 +21,10 @@
|
||||||
namespace dena {
|
namespace dena {
|
||||||
|
|
||||||
struct database_i;
|
struct database_i;
|
||||||
typedef std::auto_ptr<volatile database_i> database_ptr;
|
typedef std::unique_ptr<volatile database_i> database_ptr;
|
||||||
|
|
||||||
struct dbcontext_i;
|
struct dbcontext_i;
|
||||||
typedef std::auto_ptr<dbcontext_i> dbcontext_ptr;
|
typedef std::unique_ptr<dbcontext_i> dbcontext_ptr;
|
||||||
|
|
||||||
struct database_i {
|
struct database_i {
|
||||||
virtual ~database_i() = default;
|
virtual ~database_i() = default;
|
||||||
|
|
|
@ -76,7 +76,7 @@ daemon_handlersocket_init(void *p)
|
||||||
conf["readsize"] = to_stdstring(handlersocket_readsize);
|
conf["readsize"] = to_stdstring(handlersocket_readsize);
|
||||||
conf["accept_balance"] = to_stdstring(handlersocket_accept_balance);
|
conf["accept_balance"] = to_stdstring(handlersocket_accept_balance);
|
||||||
conf["wrlock_timeout"] = to_stdstring(handlersocket_wrlock_timeout);
|
conf["wrlock_timeout"] = to_stdstring(handlersocket_wrlock_timeout);
|
||||||
std::auto_ptr<daemon_handlersocket_data> ap(new daemon_handlersocket_data);
|
std::unique_ptr<daemon_handlersocket_data> ap(new daemon_handlersocket_data);
|
||||||
if (handlersocket_port != 0 && handlersocket_port_wr != handlersocket_port) {
|
if (handlersocket_port != 0 && handlersocket_port_wr != handlersocket_port) {
|
||||||
conf["port"] = handlersocket_port;
|
conf["port"] = handlersocket_port;
|
||||||
if (handlersocket_plain_secret) {
|
if (handlersocket_plain_secret) {
|
||||||
|
|
|
@ -115,7 +115,7 @@ hstcpsvr::start_listen()
|
||||||
arg.cshared = &cshared;
|
arg.cshared = &cshared;
|
||||||
arg.vshared = &vshared;
|
arg.vshared = &vshared;
|
||||||
arg.worker_id = i;
|
arg.worker_id = i;
|
||||||
std::auto_ptr< thread<worker_throbj> > thr(
|
std::unique_ptr< thread<worker_throbj> > thr(
|
||||||
new thread<worker_throbj>(arg, stack_size));
|
new thread<worker_throbj>(arg, stack_size));
|
||||||
threads.push_back_ptr(thr);
|
threads.push_back_ptr(thr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ struct hstcpsvr_shared_v : public mutex {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hstcpsvr_i;
|
struct hstcpsvr_i;
|
||||||
typedef std::auto_ptr<hstcpsvr_i> hstcpsvr_ptr;
|
typedef std::unique_ptr<hstcpsvr_i> hstcpsvr_ptr;
|
||||||
|
|
||||||
struct hstcpsvr_i {
|
struct hstcpsvr_i {
|
||||||
virtual ~hstcpsvr_i() = default;
|
virtual ~hstcpsvr_i() = default;
|
||||||
|
|
|
@ -451,7 +451,7 @@ hstcpsvr_worker::run_one_nb()
|
||||||
{
|
{
|
||||||
pollfd& pfd = pfds[nfds - 1];
|
pollfd& pfd = pfds[nfds - 1];
|
||||||
if ((pfd.revents & mask_in) != 0) {
|
if ((pfd.revents & mask_in) != 0) {
|
||||||
std::auto_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
std::unique_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
||||||
c->nonblocking = true;
|
c->nonblocking = true;
|
||||||
c->readsize = cshared.readsize;
|
c->readsize = cshared.readsize;
|
||||||
c->accept(cshared);
|
c->accept(cshared);
|
||||||
|
@ -498,7 +498,7 @@ hstcpsvr_worker::run_one_ep()
|
||||||
/* listener */
|
/* listener */
|
||||||
++accept_count;
|
++accept_count;
|
||||||
DBG_EP(fprintf(stderr, "IN listener\n"));
|
DBG_EP(fprintf(stderr, "IN listener\n"));
|
||||||
std::auto_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
std::unique_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
|
||||||
c->nonblocking = true;
|
c->nonblocking = true;
|
||||||
c->readsize = cshared.readsize;
|
c->readsize = cshared.readsize;
|
||||||
c->accept(cshared);
|
c->accept(cshared);
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
namespace dena {
|
namespace dena {
|
||||||
|
|
||||||
struct hstcpsvr_worker_i;
|
struct hstcpsvr_worker_i;
|
||||||
typedef std::auto_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr;
|
typedef std::unique_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr;
|
||||||
|
|
||||||
struct hstcpsvr_worker_arg {
|
struct hstcpsvr_worker_arg {
|
||||||
const hstcpsvr_shared_c *cshared;
|
const hstcpsvr_shared_c *cshared;
|
||||||
|
|
|
@ -19,11 +19,6 @@
|
||||||
#include "string_ref.hpp"
|
#include "string_ref.hpp"
|
||||||
#include "string_buffer.hpp"
|
#include "string_buffer.hpp"
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
/* auto_ptr is deprecated */
|
|
||||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace dena {
|
namespace dena {
|
||||||
|
|
||||||
struct hstcpcli_filter {
|
struct hstcpcli_filter {
|
||||||
|
@ -35,7 +30,7 @@ struct hstcpcli_filter {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hstcpcli_i;
|
struct hstcpcli_i;
|
||||||
typedef std::auto_ptr<hstcpcli_i> hstcpcli_ptr;
|
typedef std::unique_ptr<hstcpcli_i> hstcpcli_ptr;
|
||||||
|
|
||||||
struct hstcpcli_i {
|
struct hstcpcli_i {
|
||||||
virtual ~hstcpcli_i() = default;
|
virtual ~hstcpcli_i() = default;
|
||||||
|
|
Loading…
Add table
Reference in a new issue