Commit 0504574f authored by Dominik Charousset's avatar Dominik Charousset

Merge pull request #767

parents b91102ed 744bbbc9
......@@ -57,10 +57,9 @@ if(APPLE AND NOT DEFINED CMAKE_MACOSX_RPATH)
set(CMAKE_MACOSX_RPATH true)
endif()
# Shared libs are currently not supported on Windows.
if(WIN32 AND NOT CAF_BUILD_STATIC_ONLY)
message(STATUS "CAF currently only supports static-only builds on Windows")
set(CAF_BUILD_STATIC_ONLY yes)
# Auto-export all symbols from Windows DLL
if(WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
if(CAF_BUILD_STATIC_RUNTIME)
......
......@@ -29,7 +29,7 @@
namespace caf {
/// Implements the deserializer interface with a binary serialization protocol.
class binary_deserializer final : public deserializer {
class CAF_API binary_deserializer final : public deserializer {
public:
// -- member types -----------------------------------------------------------
......
......@@ -261,3 +261,22 @@ struct IUnknown;
__FILE__, __LINE__, error); \
::abort(); \
} while (false)
// Explicit symbol visibility macros.
#ifdef CAF_MSVC
# define CAF_API_EXPORT __declspec(dllexport)
# define CAF_API_IMPORT __declspec(dllimport)
#elif defined(CAF_CLANG) || defined(CAF_GCC)
# define CAF_API_EXPORT __attribute__ ((visibility("default")))
# define CAF_API_IMPORT
#else
# define CAF_API_EXPORT
# define CAF_API_IMPORT
#endif
#ifdef libcaf_core_shared_EXPORTS
# define CAF_API CAF_API_EXPORT
#else
# define CAF_API CAF_API_IMPORT
#endif
......@@ -23,6 +23,7 @@
#include <string>
#include <vector>
#include "caf/config.hpp"
#include "caf/atom.hpp"
#include "caf/string_view.hpp"
#include "caf/timestamp.hpp"
......@@ -34,55 +35,55 @@ namespace defaults {
namespace stream {
extern const timespan desired_batch_complexity;
extern const timespan max_batch_delay;
extern const timespan credit_round_interval;
extern CAF_API const timespan desired_batch_complexity;
extern CAF_API const timespan max_batch_delay;
extern CAF_API const timespan credit_round_interval;
} // namespace streaming
namespace scheduler {
extern const atom_value policy;
extern string_view profiling_output_file;
extern const size_t max_threads;
extern const size_t max_throughput;
extern const timespan profiling_resolution;
extern CAF_API const atom_value policy;
extern CAF_API string_view profiling_output_file;
extern CAF_API const size_t max_threads;
extern CAF_API const size_t max_throughput;
extern CAF_API const timespan profiling_resolution;
} // namespace scheduler
namespace work_stealing {
extern const size_t aggressive_poll_attempts;
extern const size_t aggressive_steal_interval;
extern const size_t moderate_poll_attempts;
extern const size_t moderate_steal_interval;
extern const timespan moderate_sleep_duration;
extern const size_t relaxed_steal_interval;
extern const timespan relaxed_sleep_duration;
extern CAF_API const size_t aggressive_poll_attempts;
extern CAF_API const size_t aggressive_steal_interval;
extern CAF_API const size_t moderate_poll_attempts;
extern CAF_API const size_t moderate_steal_interval;
extern CAF_API const timespan moderate_sleep_duration;
extern CAF_API const size_t relaxed_steal_interval;
extern CAF_API const timespan relaxed_sleep_duration;
} // namespace work_stealing
namespace logger {
extern string_view component_filter;
extern const atom_value console;
extern string_view console_format;
extern const atom_value console_verbosity;
extern string_view file_format;
extern string_view file_name;
extern const atom_value file_verbosity;
extern CAF_API string_view component_filter;
extern CAF_API const atom_value console;
extern CAF_API string_view console_format;
extern CAF_API const atom_value console_verbosity;
extern CAF_API string_view file_format;
extern CAF_API string_view file_name;
extern CAF_API const atom_value file_verbosity;
} // namespace logger
namespace middleman {
extern std::vector<std::string> app_identifiers;
extern const atom_value network_backend;
extern const size_t max_consecutive_reads;
extern const size_t heartbeat_interval;
extern const size_t cached_udp_buffers;
extern const size_t max_pending_msgs;
extern const size_t workers;
extern CAF_API std::vector<std::string> app_identifiers;
extern CAF_API const atom_value network_backend;
extern CAF_API const size_t max_consecutive_reads;
extern CAF_API const size_t heartbeat_interval;
extern CAF_API const size_t cached_udp_buffers;
extern CAF_API const size_t max_pending_msgs;
extern CAF_API const size_t workers;
} // namespace middleman
......
......@@ -20,6 +20,8 @@
#include <cstring>
#include "caf/config.hpp"
namespace caf {
namespace detail {
namespace parser {
......@@ -44,15 +46,15 @@ inline bool in_whitelist(bool (*filter)(char), char ch) {
return filter(ch);
}
extern const char alphanumeric_chars[63];
CAF_API extern const char alphanumeric_chars[63];
extern const char alphabetic_chars[53];
CAF_API extern const char alphabetic_chars[53];
extern const char hexadecimal_chars[23];
CAF_API extern const char hexadecimal_chars[23];
extern const char decimal_chars[11];
CAF_API extern const char decimal_chars[11];
extern const char octal_chars[9];
CAF_API extern const char octal_chars[9];
} // namespace parser
} // namespace detail
......
......@@ -24,6 +24,7 @@
#include <vector>
#include <cstdint>
#include "caf/config.hpp"
#include "caf/atom.hpp"
#include "caf/fwd.hpp"
#include "caf/timespan.hpp"
......@@ -113,7 +114,7 @@ static constexpr size_t type_nrs = detail::tl_size<sorted_builtin_types>::value
+ 1;
/// List of all type names, indexed via `type_nr`.
extern const char* numbered_type_names[];
CAF_API extern const char* numbered_type_names[];
template <uint32_t R, uint16_t... Is>
struct type_token_helper;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment