Skip to content

Commit

Permalink
use WINDOWS_EXPORT_ALL_SYMBOLS instead of __declspec(dllexport)
Browse files Browse the repository at this point in the history
  • Loading branch information
Be-ing committed Jan 15, 2021
1 parent 925bba3 commit 6e4058c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ if(APPLE)
elseif(WIN32)
target_sources(hss1394 PRIVATE src/1394API_VHPD1394.cpp)
target_compile_definitions(hss1394 PRIVATE "_WIN32_")
if(BUILD_SHARED_LIBS)
target_compile_definitions(hss1394 PRIVATE "HSS1394_EXPORT_DLL")
endif()

# Add header-only library dependency ST1394_ASIO
target_include_directories(hss1394 SYSTEM PRIVATE lib/ST1394_ASIO)
Expand All @@ -55,8 +52,12 @@ elseif(WIN32)
)
target_include_directories(vhpd1394 SYSTEM PUBLIC lib/VHPD1394)
target_link_libraries(hss1394 PRIVATE vhpd1394)

set_target_properties(hss1394 PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
)
else()
message(FATAL_ERROR "Operating system not supported")
message(FATAL_ERROR "Operating system not supported")
endif()

#
Expand Down
25 changes: 4 additions & 21 deletions include/HSS1394.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,6 @@
#ifndef _HSS1394_
#define _HSS1394_


#if defined(_WIN32)
#if defined(HSS1394_EXPORT_DLL)
#define HSS1394_CLASS_CONVENTION __declspec(dllexport)
#elif defined(HSS1394_IMPORT_DLL)
#define HSS1394_CLASS_CONVENTION __declspec(dllimport)
#else
#define HSS1394_CLASS_CONVENTION // static import
#endif

#else // _WIN32

#define HSS1394_CLASS_CONVENTION // static import

#endif // _WIN32


//*** Includes
//*****************************************************************************
#include <string> // STL string class
Expand Down Expand Up @@ -85,7 +68,7 @@ namespace hss1394 {
//! HSS1394 interface changes - ie. connections appear or disappear on the
//! network.
//-----------------------------------------------------------------------------
class HSS1394_CLASS_CONVENTION Listener {
class Listener {
public:
//! ::Do method is called when the nodes in the HSS1394 network have changed.
virtual void Do(void) = 0;
Expand All @@ -95,7 +78,7 @@ namespace hss1394 {
// ChannelListener::
//! Callback object for an incomming data channel.
//-----------------------------------------------------------------------------
class HSS1394_CLASS_CONVENTION ChannelListener {
class ChannelListener {
public:
// :: Process is called when data has arrived. The arguments present
//! the data. On completion of this call, pBuffer is no longer valid.
Expand All @@ -117,7 +100,7 @@ namespace hss1394 {
//! Abstraction of a channel endpoint at the host communicating with a
//! remote HSS1394 node.
//-----------------------------------------------------------------------------
class HSS1394_CLASS_CONVENTION Channel {
class Channel {
public:
//! Stop data transmission/reception. After this call all send and
//! receive calls will fail with a zero return.
Expand Down Expand Up @@ -177,7 +160,7 @@ namespace hss1394 {
// Node::
//! Singleton High-speed serial over 1394 host node interface.
//-----------------------------------------------------------------------------
class HSS1394_CLASS_CONVENTION Node {
class Node {
protected:
static Node *mspInstance; //!< Singleton instance of class

Expand Down

0 comments on commit 6e4058c

Please sign in to comment.