mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-05-09 04:39:50 -05:00
Fix missing inline attributes for mysql connector
Changed mysql usage tests to be linked into one executable. This provokes multiple definition errors for non-inlined free functions.
This commit is contained in:
@@ -71,7 +71,7 @@ namespace sqlpp
|
||||
const auto date_digits = std::vector<char>{1, 1, 1, 1, 0, 1, 1, 0, 1, 1}; // 2015-10-28
|
||||
const auto time_digits = std::vector<char>{0, 1, 1, 0, 1, 1, 0, 1, 1}; // T23:00:12
|
||||
|
||||
auto check_digits(const char* text, const std::vector<char>& digitFlags) -> bool
|
||||
inline auto check_digits(const char* text, const std::vector<char>& digitFlags) -> bool
|
||||
{
|
||||
for (const auto digitFlag : digitFlags)
|
||||
{
|
||||
|
||||
@@ -63,12 +63,12 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
|
||||
void thread_init()
|
||||
inline void thread_init()
|
||||
{
|
||||
thread_local MySqlThreadInitializer threadInitializer;
|
||||
}
|
||||
|
||||
void connect(MYSQL* mysql, const connection_config& config)
|
||||
inline void connect(MYSQL* mysql, const connection_config& config)
|
||||
{
|
||||
if (!mysql_real_connect(mysql, config.host.empty() ? nullptr : config.host.c_str(),
|
||||
config.user.empty() ? nullptr : config.user.c_str(),
|
||||
@@ -89,7 +89,7 @@ namespace sqlpp
|
||||
}
|
||||
}
|
||||
|
||||
void handle_cleanup(MYSQL* mysql)
|
||||
inline void handle_cleanup(MYSQL* mysql)
|
||||
{
|
||||
mysql_close(mysql);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
|
||||
void execute_statement(detail::connection_handle_t& handle, const std::string& statement)
|
||||
inline void execute_statement(detail::connection_handle_t& handle, const std::string& statement)
|
||||
{
|
||||
thread_init();
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace sqlpp
|
||||
}
|
||||
}
|
||||
|
||||
void execute_prepared_statement(detail::prepared_statement_handle_t& prepared_statement)
|
||||
inline void execute_prepared_statement(detail::prepared_statement_handle_t& prepared_statement)
|
||||
{
|
||||
thread_init();
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace sqlpp
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<detail::prepared_statement_handle_t> prepare_statement(detail::connection_handle_t& handle,
|
||||
inline std::shared_ptr<detail::prepared_statement_handle_t> prepare_statement(detail::connection_handle_t& handle,
|
||||
const std::string& statement,
|
||||
size_t no_of_parameters,
|
||||
size_t no_of_columns)
|
||||
@@ -213,7 +213,7 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
// This will also cleanup when the program shuts down
|
||||
void global_library_init(int argc = 0, char** argv = nullptr, char** groups = nullptr)
|
||||
inline void global_library_init(int argc = 0, char** argv = nullptr, char** groups = nullptr)
|
||||
{
|
||||
static const auto global_init_and_end = scoped_library_initializer_t(argc, argv, groups);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user