1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Don't define TINS_STATIC in config.h

This commit is contained in:
Matias Fontanini
2015-12-29 07:43:46 -08:00
parent df3bca099a
commit c4a2fed112
3 changed files with 13 additions and 18 deletions

View File

@@ -32,7 +32,7 @@ IF(LIBTINS_BUILD_SHARED)
ELSE(LIBTINS_BUILD_SHARED)
MESSAGE(STATUS "Build will generate a static library.")
SET(LIBTINS_TYPE STATIC)
SET(TINS_STATIC_BUILD ON)
ADD_DEFINITIONS("-DTINS_STATIC=1")
ENDIF(LIBTINS_BUILD_SHARED)
# The version number.

View File

@@ -13,7 +13,4 @@
/* Use pcap_sendpacket to send l2 packets */
#cmakedefine HAVE_PACKET_SENDER_PCAP_SENDPACKET
/* Indicate whether libtins was built statically */
#cmakedefine TINS_STATIC_BUILD
#endif // TINS_CONFIG_H

View File

@@ -46,18 +46,6 @@
#define TINS_NOEXCEPT
#define TINS_LIKELY(x) (x)
#define TINS_UNLIKELY(x) (x)
// If libtins was built into a shared library
#if !defined(TINS_STATIC_BUILD)
// Export/import symbols, depending on whether we're compiling or consuming the lib
#ifdef tins_EXPORTS
#define TINS_API __declspec(dllexport)
#else
#define TINS_API __declspec(dllimport)
#endif // tins_EXPORTS
#else // TINS_STATIC_BUILD
// Otherwise, default this to an empty macro
#define TINS_API
#endif // TINS_STATIC_BUILD
#else
// Not Vistual Studio. Assume this is gcc compatible
#define TINS_BEGIN_PACK
@@ -67,9 +55,19 @@
#define TINS_NOEXCEPT noexcept
#define TINS_LIKELY(x) __builtin_expect((x),1)
#define TINS_UNLIKELY(x) __builtin_expect((x),0)
#define TINS_API
#endif // _MSC_VER
// If libtins was built into a shared library
#if defined(_WIN32) && !defined(TINS_STATIC)
// Export/import symbols, depending on whether we're compiling or consuming the lib
#ifdef tins_EXPORTS
#define TINS_API __declspec(dllexport)
#else
#define TINS_API __declspec(dllimport)
#endif // tins_EXPORTS
#else
// Otherwise, default this to an empty macro
#define TINS_API
#endif // _WIN32 && !TINS_STATIC
#endif // TINS_MACROS_H