Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
export mock-server plugin symbols properly
Browse files Browse the repository at this point in the history
  • Loading branch information
weigon committed Jun 14, 2018
1 parent a48037d commit 8f0881d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 19 deletions.
3 changes: 2 additions & 1 deletion src/mock_server/include/mysqlrouter/mock_server_component.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@

#include <memory>

#include "mysqlrouter/mock_server_export.h"
#include "mysqlrouter/mock_server_global_scope.h"

namespace server_mock {
class MySQLServerMock;
}

class MockServerComponent {
class MOCK_SERVER_EXPORT MockServerComponent {
// disable copy, as we are a single-instance
MockServerComponent(MockServerComponent const &) = delete;
void operator=(MockServerComponent const &) = delete;
Expand Down
42 changes: 42 additions & 0 deletions src/mock_server/include/mysqlrouter/mock_server_export.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef MYSQLROUTER_MOCK_SERVER_EXPORT_INCLUDED
#define MYSQLROUTER_MOCK_SERVER_EXPORT_INCLUDED

#ifdef _WIN32
# ifdef mock_server_DEFINE_STATIC
# define MOCK_SERVER_EXPORT
# else
# ifdef mock_server_EXPORTS
# define MOCK_SERVER_EXPORT __declspec(dllexport)
# else
# define MOCK_SERVER_EXPORT __declspec(dllimport)
# endif
# endif
#else
# define MOCK_SERVER_EXPORT
#endif

#endif
2 changes: 1 addition & 1 deletion src/mock_server/src/mock_server_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static void start(mysql_harness::PluginFuncEnv* env) {
}

extern "C" {
mysql_harness::Plugin MOCK_SERVER_API harness_plugin_mock_server = {
mysql_harness::Plugin MOCK_SERVER_EXPORT harness_plugin_mock_server = {
mysql_harness::PLUGIN_ABI_VERSION,
mysql_harness::ARCHITECTURE_DESCRIPTOR,
"Routing MySQL connections between MySQL clients/connectors and servers",
Expand Down
19 changes: 2 additions & 17 deletions src/mock_server/src/mock_server_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,11 @@
#define MOCK_SERVER_PLUGIN_INCLUDED

#include "mysql/harness/plugin.h"


#ifdef _WIN32
# ifdef mock_server_DEFINE_STATIC
# define MOCK_SERVER_API
# else
# ifdef mock_server_EXPORTS
# define MOCK_SERVER_API __declspec(dllexport)
# else
# define MOCK_SERVER_API __declspec(dllimport)
# endif
# endif
#else
# define MOCK_SERVER_API
#endif

#include "mysqlrouter/mock_server_export.h"

extern "C"
{
extern mysql_harness::Plugin MOCK_SERVER_API harness_plugin_mock_server;
extern mysql_harness::Plugin MOCK_SERVER_EXPORT harness_plugin_mock_server;
}

#endif

0 comments on commit 8f0881d

Please sign in to comment.