Commit 99677cc5 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: move safe_str*() from sql_acl.cc to m_string.h

parent 9bd5d54c
......@@ -239,4 +239,15 @@ static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
lex_str->length= strlen(c_str);
}
#ifdef __cplusplus
static inline char *safe_str(char *str)
{ return str ? str : const_cast<char*>(""); }
#endif
static inline const char *safe_str(const char *str)
{ return str ? str : ""; }
static inline size_t safe_strlen(const char *str)
{ return str ? strlen(str) : 0; }
#endif
......@@ -19,9 +19,6 @@
#ifndef _maria_h
#define _maria_h
#ifdef __cplusplus
extern "C" {
#endif
#include <my_base.h>
#include <my_sys.h>
#include <m_ctype.h>
......@@ -30,6 +27,10 @@ extern "C" {
#include <myisamchk.h>
#include <mysql/plugin.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MARIA_CANNOT_ROLLBACK
/*
......
......@@ -205,17 +205,6 @@ static plugin_ref old_password_plugin;
#endif
static plugin_ref native_password_plugin;
static char *safe_str(char *str)
{ return str ? str : const_cast<char*>(""); }
static const char *safe_str(const char *str)
{ return str ? str : ""; }
#ifndef NO_EMBEDDED_ACCESS_CHECKS
static size_t safe_strlen(const char *str)
{ return str ? strlen(str) : 0; }
#endif
/* Classes */
struct acl_host_and_ip
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment