Skip to content

Commit

Permalink
Fix windows compilation by setting right visibility attributes (#550)
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Co-authored-by: Michael Carroll <[email protected]>
Co-authored-by: Addisu Z. Taddese <[email protected]>
Co-authored-by: Steve Peters <[email protected]>
Co-authored-by: Michael Carroll <[email protected]>
  • Loading branch information
5 people authored Nov 10, 2023
1 parent 09491f5 commit 75277ae
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 19 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ configure_file("${PROJECT_SOURCE_DIR}/cppcheck.suppress.in"
${PROJECT_BINARY_DIR}/cppcheck.suppress)

gz_configure_build(QUIT_IF_BUILD_ERRORS
HIDE_SYMBOLS_BY_DEFAULT
COMPONENTS av events geospatial graphics io profiler testing)

#============================================================================
Expand Down
2 changes: 2 additions & 0 deletions profiler/src/RemoteryProfilerImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#include "gz/common/config.hh"
#include <gz/common/profiler/Export.hh>

#include "RemoteryProfilerImpl.hh"
#include "gz/common/Console.hh"
Expand All @@ -24,6 +25,7 @@
using namespace gz;
using namespace common;

GZ_COMMON_PROFILER_VISIBLE
std::string rmtErrorToString(rmtError error) {
switch (error) {
case RMT_ERROR_NONE:
Expand Down
2 changes: 1 addition & 1 deletion src/SignalHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace gz;
using namespace common;

// A wrapper for the sigaction sa_handler.
std::map<int, std::function<void(int)>> gOnSignalWrappers;
GZ_COMMON_VISIBLE std::map<int, std::function<void(int)>> gOnSignalWrappers;
std::mutex gWrapperMutex;

/////////////////////////////////////////////////
Expand Down
16 changes: 8 additions & 8 deletions testing/include/gz/common/testing/CMakeTestPaths.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ namespace gz::common::testing
///
/// It is not intended that users will directly construct this, but rather
/// utilize the TestPathFactory.
class CMakeTestPaths: public TestPaths
class GZ_COMMON_TESTING_VISIBLE CMakeTestPaths: public TestPaths
{
/// \brief Constructor from TestPaths
public: using TestPaths::TestPaths;
/// \brief Constructor
/// \param[in] _projectSourcePath Path to the root of the project source
public: explicit CMakeTestPaths(
const std::string &_projectSourcePath = kTestingProjectSourceDir);

/// \brief Destructor
public: GZ_COMMON_TESTING_VISIBLE ~CMakeTestPaths() override;
public: ~CMakeTestPaths() override;

/// Documentation inherited
public: bool GZ_COMMON_TESTING_VISIBLE
ProjectSourcePath(std::string &_sourceDir) override;
public: bool ProjectSourcePath(std::string &_sourceDir) override;

/// Documentation inherited
public: bool GZ_COMMON_TESTING_VISIBLE
TestTmpPath(std::string &_tmpDir) override;
public: bool TestTmpPath(std::string &_tmpDir) override;
};
} // namespace gz::common::testing
#endif // GZ_COMMON_TESTING_CMAKETESTPATHS_HH_
20 changes: 10 additions & 10 deletions testing/include/gz/common/testing/TestPaths.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#include "gz/common/testing/Export.hh"

#include <gz/utils/SuppressWarning.hh>

#ifndef TESTING_PROJECT_SOURCE_DIR
#define TESTING_PROJECT_SOURCE_DIR ""
#endif
Expand Down Expand Up @@ -59,32 +61,30 @@ enum class GZ_COMMON_TESTING_VISIBLE BuildType
///
/// It is intended that there is an implementation of this interface for
/// each relevant buildsystem.
class TestPaths
class GZ_COMMON_TESTING_VISIBLE TestPaths
{
/// \brief Constructor
/// \param[in] _projectSourcePath Path to the root of the project source
public: GZ_COMMON_TESTING_VISIBLE
explicit TestPaths(const std::string &_projectSourcePath =
kTestingProjectSourceDir);
public: explicit TestPaths(
const std::string &_projectSourcePath = kTestingProjectSourceDir);

/// \brief Destructor
public: GZ_COMMON_TESTING_VISIBLE
virtual ~TestPaths() = 0;
public: virtual ~TestPaths();

/// brief Populate the path to the root project source directory
/// \param[out] _sourceDir path to the root project source directory
/// \return True if path successfully found and set, false otherwise
public: virtual bool GZ_COMMON_TESTING_VISIBLE
ProjectSourcePath(std::string &_sourceDir) = 0;
public: virtual bool ProjectSourcePath(std::string &_sourceDir) = 0;

/// \brief Populate the path to a temporary directory
/// \param[out] _tmpDir path to the root temporary directory
/// \return True if path successfully found and set, false otherwise
public: virtual bool GZ_COMMON_TESTING_VISIBLE
TestTmpPath(std::string &_tmpDir) = 0;
public: virtual bool TestTmpPath(std::string &_tmpDir) = 0;

GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
/// \brief Path to the root of the project source
protected: std::string projectSourcePath;
GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
};

//////////////////////////////////////////////////
Expand Down
6 changes: 6 additions & 0 deletions testing/src/CMakeTestPaths.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
namespace gz::common::testing
{

//////////////////////////////////////////////////
CMakeTestPaths::CMakeTestPaths(const std::string &_projectSourcePath)
: TestPaths(_projectSourcePath)
{
}

//////////////////////////////////////////////////
CMakeTestPaths::~CMakeTestPaths() = default;

Expand Down

0 comments on commit 75277ae

Please sign in to comment.