diff --git a/api/BUILD.gn b/api/BUILD.gn index 4eed48c8e8..a472b3d24f 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -33,6 +33,9 @@ rtc_source_set("callfactory_api") { sources = [ "call/call_factory_interface.h", ] + deps = [ + "../rtc_base/system:rtc_export", + ] } if (!build_with_chromium) { diff --git a/api/call/call_factory_interface.h b/api/call/call_factory_interface.h index c3d5b41a9c..6051409cc3 100644 --- a/api/call/call_factory_interface.h +++ b/api/call/call_factory_interface.h @@ -13,6 +13,8 @@ #include +#include "rtc_base/system/rtc_export.h" + namespace webrtc { // These classes are not part of the API, and are treated as opaque pointers. @@ -29,7 +31,7 @@ class CallFactoryInterface { virtual Call* CreateCall(const CallConfig& config) = 0; }; -std::unique_ptr CreateCallFactory(); +RTC_EXPORT std::unique_ptr CreateCallFactory(); } // namespace webrtc diff --git a/api/crypto/BUILD.gn b/api/crypto/BUILD.gn index a9bd479b6e..685dccd414 100644 --- a/api/crypto/BUILD.gn +++ b/api/crypto/BUILD.gn @@ -24,6 +24,7 @@ rtc_source_set("options") { ] deps = [ "../../rtc_base:rtc_base", + "../../rtc_base/system:rtc_export", ] } diff --git a/api/crypto/crypto_options.h b/api/crypto/crypto_options.h index f0b91d0774..91a585a6c6 100644 --- a/api/crypto/crypto_options.h +++ b/api/crypto/crypto_options.h @@ -13,12 +13,14 @@ #include +#include "rtc_base/system/rtc_export.h" + namespace webrtc { // CryptoOptions defines advanced cryptographic settings for native WebRTC. // These settings must be passed into PeerConnectionFactoryInterface::Options // and are only applicable to native use cases of WebRTC. -struct CryptoOptions { +struct RTC_EXPORT CryptoOptions { CryptoOptions(); CryptoOptions(const CryptoOptions& other); ~CryptoOptions(); diff --git a/api/data_channel_interface.h b/api/data_channel_interface.h index fc47dbbd0d..ccf3ad7122 100644 --- a/api/data_channel_interface.h +++ b/api/data_channel_interface.h @@ -23,6 +23,7 @@ #include "rtc_base/checks.h" #include "rtc_base/copy_on_write_buffer.h" #include "rtc_base/ref_count.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -96,7 +97,7 @@ class DataChannelObserver { virtual ~DataChannelObserver() = default; }; -class DataChannelInterface : public rtc::RefCountInterface { +class RTC_EXPORT DataChannelInterface : public rtc::RefCountInterface { public: // C++ version of: https://www.w3.org/TR/webrtc/#idl-def-rtcdatachannelstate // Unlikely to change, but keep in sync with DataChannel.java:State and diff --git a/api/dtls_transport_interface.h b/api/dtls_transport_interface.h index 1170e0fef9..8fd8cd11d8 100644 --- a/api/dtls_transport_interface.h +++ b/api/dtls_transport_interface.h @@ -20,6 +20,7 @@ #include "api/scoped_refptr.h" #include "rtc_base/ref_count.h" #include "rtc_base/ssl_certificate.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -37,7 +38,7 @@ enum class DtlsTransportState { // This object gives snapshot information about the changeable state of a // DTLSTransport. -class DtlsTransportInformation { +class RTC_EXPORT DtlsTransportInformation { public: DtlsTransportInformation(); explicit DtlsTransportInformation(DtlsTransportState state); diff --git a/api/jsep.h b/api/jsep.h index 3f7f12a45d..7b4934aa66 100644 --- a/api/jsep.h +++ b/api/jsep.h @@ -52,7 +52,7 @@ struct SdpParseError { // a time and is therefore not expected to be thread safe. // // An instance can be created by CreateIceCandidate. -class IceCandidateInterface { +class RTC_EXPORT IceCandidateInterface { public: virtual ~IceCandidateInterface() {} // If present, this is the value of the "a=mid" attribute of the candidate's diff --git a/api/media_stream_interface.h b/api/media_stream_interface.h index 61503509c1..5fb73c94a4 100644 --- a/api/media_stream_interface.h +++ b/api/media_stream_interface.h @@ -145,8 +145,9 @@ class VideoTrackSourceInterface : public MediaSourceInterface, // PeerConnectionFactory::CreateVideoTrack can be used for creating a VideoTrack // that ensures thread safety and that all methods are called on the right // thread. -class VideoTrackInterface : public MediaStreamTrackInterface, - public rtc::VideoSourceInterface { +class RTC_EXPORT VideoTrackInterface + : public MediaStreamTrackInterface, + public rtc::VideoSourceInterface { public: // Video track content hint, used to override the source is_screencast // property. @@ -235,7 +236,7 @@ class AudioProcessorInterface : public rtc::RefCountInterface { ~AudioProcessorInterface() override = default; }; -class AudioTrackInterface : public MediaStreamTrackInterface { +class RTC_EXPORT AudioTrackInterface : public MediaStreamTrackInterface { public: // TODO(deadbeef): Figure out if the following interface should be const or // not. diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h index 12c51626e9..2b7da8369d 100644 --- a/api/peer_connection_interface.h +++ b/api/peer_connection_interface.h @@ -1253,7 +1253,7 @@ class PeerConnectionObserver { // All new dependencies should be added as a unique_ptr to allow the // PeerConnection object to be the definitive owner of the dependencies // lifetime making injection safer. -struct PeerConnectionDependencies final { +struct RTC_EXPORT PeerConnectionDependencies final { explicit PeerConnectionDependencies(PeerConnectionObserver* observer_in); // This object is not copyable or assignable. PeerConnectionDependencies(const PeerConnectionDependencies&) = delete; @@ -1284,7 +1284,7 @@ struct PeerConnectionDependencies final { // clear which are mandatory and optional. If possible please allow the peer // connection factory to take ownership of the dependency by adding a unique_ptr // to this structure. -struct PeerConnectionFactoryDependencies final { +struct RTC_EXPORT PeerConnectionFactoryDependencies final { PeerConnectionFactoryDependencies(); // This object is not copyable or assignable. PeerConnectionFactoryDependencies(const PeerConnectionFactoryDependencies&) = @@ -1457,7 +1457,7 @@ class PeerConnectionFactoryInterface : public rtc::RefCountInterface { // will create the necessary thread internally. If |signaling_thread| is null, // the PeerConnectionFactory will use the thread on which this method is called // as the signaling thread, wrapping it in an rtc::Thread object if needed. -rtc::scoped_refptr +RTC_EXPORT rtc::scoped_refptr CreateModularPeerConnectionFactory( PeerConnectionFactoryDependencies dependencies); diff --git a/api/proxy.h b/api/proxy.h index 6627aac7d4..3e76ee7c5e 100644 --- a/api/proxy.h +++ b/api/proxy.h @@ -61,6 +61,7 @@ #include "rtc_base/message_handler.h" #include "rtc_base/message_queue.h" #include "rtc_base/ref_counted_object.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/thread.h" namespace rtc { @@ -140,8 +141,8 @@ class ReturnType { namespace internal { -class SynchronousMethodCall : public rtc::MessageData, - public rtc::MessageHandler { +class RTC_EXPORT SynchronousMethodCall : public rtc::MessageData, + public rtc::MessageHandler { public: explicit SynchronousMethodCall(rtc::MessageHandler* proxy); ~SynchronousMethodCall() override; diff --git a/api/rtc_error.h b/api/rtc_error.h index ffdcc0a258..970507f3c2 100644 --- a/api/rtc_error.h +++ b/api/rtc_error.h @@ -131,7 +131,7 @@ class RTC_EXPORT RTCError { // // Only intended to be used for logging/diagnostics. The returned char* points // to literal string that lives for the whole duration of the program. -const char* ToString(RTCErrorType error); +RTC_EXPORT const char* ToString(RTCErrorType error); #ifdef UNIT_TEST inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982) diff --git a/api/rtc_event_log/BUILD.gn b/api/rtc_event_log/BUILD.gn index e420190d95..bd2570b43d 100644 --- a/api/rtc_event_log/BUILD.gn +++ b/api/rtc_event_log/BUILD.gn @@ -36,6 +36,7 @@ rtc_source_set("rtc_event_log_factory") { deps = [ ":rtc_event_log", "../../rtc_base:checks", + "../../rtc_base/system:rtc_export", "../task_queue", ] diff --git a/api/rtc_event_log/rtc_event_log_factory.h b/api/rtc_event_log/rtc_event_log_factory.h index 0efb1e5bb2..06cc074d20 100644 --- a/api/rtc_event_log/rtc_event_log_factory.h +++ b/api/rtc_event_log/rtc_event_log_factory.h @@ -16,10 +16,11 @@ #include "api/rtc_event_log/rtc_event_log.h" #include "api/rtc_event_log/rtc_event_log_factory_interface.h" #include "api/task_queue/task_queue_factory.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { -class RtcEventLogFactory : public RtcEventLogFactoryInterface { +class RTC_EXPORT RtcEventLogFactory : public RtcEventLogFactoryInterface { public: explicit RtcEventLogFactory(TaskQueueFactory* task_queue_factory); ~RtcEventLogFactory() override {} diff --git a/api/rtp_parameters.h b/api/rtp_parameters.h index fe2ec80a8d..77db960c4c 100644 --- a/api/rtp_parameters.h +++ b/api/rtp_parameters.h @@ -91,7 +91,7 @@ enum class DegradationPreference { RTC_EXPORT extern const double kDefaultBitratePriority; -struct RtcpFeedback { +struct RTC_EXPORT RtcpFeedback { RtcpFeedbackType type = RtcpFeedbackType::CCM; // Equivalent to ORTC "parameter" field with slight differences: @@ -116,7 +116,7 @@ struct RtcpFeedback { // RtpCodecCapability is to RtpCodecParameters as RtpCapabilities is to // RtpParameters. This represents the static capabilities of an endpoint's // implementation of a codec. -struct RtpCodecCapability { +struct RTC_EXPORT RtpCodecCapability { RtpCodecCapability(); ~RtpCodecCapability(); @@ -230,7 +230,7 @@ struct RtpHeaderExtensionCapability { }; // RTP header extension, see RFC8285. -struct RtpExtension { +struct RTC_EXPORT RtpExtension { RtpExtension(); RtpExtension(const std::string& uri, int id); RtpExtension(const std::string& uri, int id, bool encrypt); @@ -332,7 +332,7 @@ struct RtpExtension { // TODO(deadbeef): This is missing the "encrypt" flag, which is unimplemented. typedef RtpExtension RtpHeaderExtensionParameters; -struct RtpFecParameters { +struct RTC_EXPORT RtpFecParameters { // If unset, a value is chosen by the implementation. // Works just like RtpEncodingParameters::ssrc. absl::optional ssrc; @@ -352,7 +352,7 @@ struct RtpFecParameters { bool operator!=(const RtpFecParameters& o) const { return !(*this == o); } }; -struct RtpRtxParameters { +struct RTC_EXPORT RtpRtxParameters { // If unset, a value is chosen by the implementation. // Works just like RtpEncodingParameters::ssrc. absl::optional ssrc; @@ -502,7 +502,7 @@ struct RTC_EXPORT RtpEncodingParameters { } }; -struct RtpCodecParameters { +struct RTC_EXPORT RtpCodecParameters { RtpCodecParameters(); RtpCodecParameters(const RtpCodecParameters&); ~RtpCodecParameters(); diff --git a/api/rtp_receiver_interface.h b/api/rtp_receiver_interface.h index ffd7497a1b..b01e07daaa 100644 --- a/api/rtp_receiver_interface.h +++ b/api/rtp_receiver_interface.h @@ -27,6 +27,7 @@ #include "api/transport/rtp/rtp_source.h" #include "rtc_base/deprecation.h" #include "rtc_base/ref_count.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -44,7 +45,7 @@ class RtpReceiverObserverInterface { virtual ~RtpReceiverObserverInterface() {} }; -class RtpReceiverInterface : public rtc::RefCountInterface { +class RTC_EXPORT RtpReceiverInterface : public rtc::RefCountInterface { public: virtual rtc::scoped_refptr track() const = 0; diff --git a/api/rtp_sender_interface.h b/api/rtp_sender_interface.h index e6140dbe2c..5d6271f5d3 100644 --- a/api/rtp_sender_interface.h +++ b/api/rtp_sender_interface.h @@ -27,10 +27,11 @@ #include "api/rtp_parameters.h" #include "api/scoped_refptr.h" #include "rtc_base/ref_count.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { -class RtpSenderInterface : public rtc::RefCountInterface { +class RTC_EXPORT RtpSenderInterface : public rtc::RefCountInterface { public: // Returns true if successful in setting the track. // Fails if an audio track is set on a video RtpSender, or vice-versa. diff --git a/api/rtp_transceiver_interface.h b/api/rtp_transceiver_interface.h index 4606632808..2a60f98be6 100644 --- a/api/rtp_transceiver_interface.h +++ b/api/rtp_transceiver_interface.h @@ -65,7 +65,7 @@ struct RTC_EXPORT RtpTransceiverInit final { // // WebRTC specification for RTCRtpTransceiver, the JavaScript analog: // https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver -class RtpTransceiverInterface : public rtc::RefCountInterface { +class RTC_EXPORT RtpTransceiverInterface : public rtc::RefCountInterface { public: // Media type of the transceiver. Any sender(s)/receiver(s) will have this // type as well. diff --git a/api/stats_types.h b/api/stats_types.h index 71bf164a89..e10834cd5e 100644 --- a/api/stats_types.h +++ b/api/stats_types.h @@ -24,11 +24,12 @@ #include "rtc_base/constructor_magic.h" #include "rtc_base/ref_count.h" #include "rtc_base/string_encode.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/thread_checker.h" namespace webrtc { -class StatsReport { +class RTC_EXPORT StatsReport { public: // Indicates whether a track is for sending or receiving. // Used in reports for audio/video tracks. diff --git a/api/video/BUILD.gn b/api/video/BUILD.gn index 0da9c6c86b..eda6d47d3f 100644 --- a/api/video/BUILD.gn +++ b/api/video/BUILD.gn @@ -26,6 +26,7 @@ rtc_source_set("video_rtp_headers") { deps = [ "..:array_view", "../../rtc_base:rtc_base_approved", + "../../rtc_base/system:rtc_export", "//third_party/abseil-cpp/absl/types:optional", ] } diff --git a/api/video/color_space.h b/api/video/color_space.h index 91b4e17025..a7ad86b016 100644 --- a/api/video/color_space.h +++ b/api/video/color_space.h @@ -15,6 +15,7 @@ #include "absl/types/optional.h" #include "api/video/hdr_metadata.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -31,7 +32,7 @@ namespace webrtc { // E.2.1, "VUI parameters semantics", available from // https://www.itu.int/rec/T-REC-H.264. -class ColorSpace { +class RTC_EXPORT ColorSpace { public: enum class PrimaryID : uint8_t { // The indices are equal to the values specified in T-REC H.273 Table 2. diff --git a/api/video/video_frame_buffer.h b/api/video/video_frame_buffer.h index 3b8db14bf9..d87a4230a4 100644 --- a/api/video/video_frame_buffer.h +++ b/api/video/video_frame_buffer.h @@ -15,6 +15,7 @@ #include "api/scoped_refptr.h" #include "rtc_base/ref_count.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -38,7 +39,7 @@ class I010BufferInterface; // performance by providing an optimized path without intermediate conversions. // Frame metadata such as rotation and timestamp are stored in // webrtc::VideoFrame, and not here. -class VideoFrameBuffer : public rtc::RefCountInterface { +class RTC_EXPORT VideoFrameBuffer : public rtc::RefCountInterface { public: // New frame buffer types will be added conservatively when there is an // opportunity to optimize the path between some pair of video source and @@ -113,7 +114,7 @@ class PlanarYuv8Buffer : public PlanarYuvBuffer { ~PlanarYuv8Buffer() override {} }; -class I420BufferInterface : public PlanarYuv8Buffer { +class RTC_EXPORT I420BufferInterface : public PlanarYuv8Buffer { public: Type type() const override; @@ -127,7 +128,7 @@ class I420BufferInterface : public PlanarYuv8Buffer { ~I420BufferInterface() override {} }; -class I420ABufferInterface : public I420BufferInterface { +class RTC_EXPORT I420ABufferInterface : public I420BufferInterface { public: Type type() const final; virtual const uint8_t* DataA() const = 0; diff --git a/media/engine/webrtc_media_engine.h b/media/engine/webrtc_media_engine.h index 40dbb90df8..0bd2ad5ac2 100644 --- a/media/engine/webrtc_media_engine.h +++ b/media/engine/webrtc_media_engine.h @@ -27,6 +27,7 @@ #include "media/base/media_engine.h" #include "modules/audio_device/include/audio_device.h" #include "modules/audio_processing/include/audio_processing.h" +#include "rtc_base/system/rtc_export.h" namespace cricket { @@ -52,7 +53,7 @@ struct MediaEngineDependencies { // CreateMediaEngine may be called on any thread, though the engine is // only expected to be used on one thread, internally called the "worker // thread". This is the thread Init must be called on. -std::unique_ptr CreateMediaEngine( +RTC_EXPORT std::unique_ptr CreateMediaEngine( MediaEngineDependencies dependencies); // Verify that extension IDs are within 1-byte extension range and are not diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h index 6fc1057361..e46deeaef9 100644 --- a/modules/audio_processing/include/audio_processing.h +++ b/modules/audio_processing/include/audio_processing.h @@ -226,7 +226,7 @@ struct ExperimentalNs { // // Close the application... // delete apm; // -class AudioProcessing : public rtc::RefCountInterface { +class RTC_EXPORT AudioProcessing : public rtc::RefCountInterface { public: // The struct below constitutes the new parameter scheme for the audio // processing. It is being introduced gradually and until it is fully diff --git a/modules/desktop_capture/desktop_frame.h b/modules/desktop_capture/desktop_frame.h index a5b67ecc6f..3a18b7852d 100644 --- a/modules/desktop_capture/desktop_frame.h +++ b/modules/desktop_capture/desktop_frame.h @@ -174,7 +174,7 @@ class RTC_EXPORT BasicDesktopFrame : public DesktopFrame { }; // A DesktopFrame that stores data in shared memory. -class SharedMemoryDesktopFrame : public DesktopFrame { +class RTC_EXPORT SharedMemoryDesktopFrame : public DesktopFrame { public: // May return nullptr if |shared_memory_factory| failed to create a // SharedMemory instance. diff --git a/modules/desktop_capture/shared_memory.h b/modules/desktop_capture/shared_memory.h index ba846da4c8..2e2d2f3388 100644 --- a/modules/desktop_capture/shared_memory.h +++ b/modules/desktop_capture/shared_memory.h @@ -20,6 +20,7 @@ #include #include "rtc_base/constructor_magic.h" +#include "rtc_base/system/rtc_export.h" namespace webrtc { @@ -29,7 +30,7 @@ namespace webrtc { // for video frames must extend this class with creation and destruction logic // specific for the target platform and then call // DesktopCapturer::SetSharedMemoryFactory(). -class SharedMemory { +class RTC_EXPORT SharedMemory { public: #if defined(WEBRTC_WIN) typedef HANDLE Handle; diff --git a/pc/BUILD.gn b/pc/BUILD.gn index 1b63f1dfe9..7a0ff3188d 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -119,6 +119,7 @@ rtc_static_library("rtc_pc_base") { "../rtc_base:rtc_task_queue", "../rtc_base:stringutils", "../rtc_base/system:file_wrapper", + "../rtc_base/system:rtc_export", "../rtc_base/third_party/base64", "../rtc_base/third_party/sigslot", "../system_wrappers:field_trial", diff --git a/pc/session_description.h b/pc/session_description.h index 9856cd6534..f5e3635eaf 100644 --- a/pc/session_description.h +++ b/pc/session_description.h @@ -33,6 +33,7 @@ #include "pc/simulcast_description.h" #include "rtc_base/deprecation.h" #include "rtc_base/socket_address.h" +#include "rtc_base/system/rtc_export.h" namespace cricket { @@ -420,7 +421,7 @@ constexpr MediaProtocolType NS_JINGLE_DRAFT_SCTP = MediaProtocolType::kSctp; // Represents a session description section. Most information about the section // is stored in the description, which is a subclass of MediaContentDescription. // Owns the description. -class ContentInfo { +class RTC_EXPORT ContentInfo { public: explicit ContentInfo(MediaProtocolType type) : type(type) {} ~ContentInfo(); diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index 17cf3f51b5..564989ab36 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -58,6 +58,7 @@ rtc_source_set("rtc_base_approved") { "../api:array_view", "../api:scoped_refptr", "system:arch", + "system:rtc_export", "system:unused", "third_party/base64", "//third_party/abseil-cpp/absl/types:optional", @@ -311,6 +312,7 @@ rtc_source_set("checks") { deps = [ ":safe_compare", "system:inline", + "system:rtc_export", "//third_party/abseil-cpp/absl/meta:type_traits", "//third_party/abseil-cpp/absl/strings", ] @@ -390,6 +392,7 @@ rtc_source_set("timeutils") { ":checks", ":safe_conversions", ":stringutils", + "system:rtc_export", ] libs = [] if (is_win) { @@ -762,6 +765,7 @@ rtc_static_library("rtc_base") { "../api:scoped_refptr", "network:sent_packet", "system:file_wrapper", + "system:rtc_export", "third_party/base64", "third_party/sigslot", "//third_party/abseil-cpp/absl/algorithm:container", diff --git a/rtc_base/async_packet_socket.h b/rtc_base/async_packet_socket.h index 3afff3bf87..50c07e2056 100644 --- a/rtc_base/async_packet_socket.h +++ b/rtc_base/async_packet_socket.h @@ -15,6 +15,7 @@ #include "rtc_base/dscp.h" #include "rtc_base/network/sent_packet.h" #include "rtc_base/socket.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/third_party/sigslot/sigslot.h" #include "rtc_base/time_utils.h" @@ -36,7 +37,7 @@ struct PacketTimeUpdateParams { // This structure holds meta information for the packet which is about to send // over network. -struct PacketOptions { +struct RTC_EXPORT PacketOptions { PacketOptions(); explicit PacketOptions(DiffServCodePoint dscp); PacketOptions(const PacketOptions& other); @@ -53,7 +54,7 @@ struct PacketOptions { // Provides the ability to receive packets asynchronously. Sends are not // buffered since it is acceptable to drop packets under high load. -class AsyncPacketSocket : public sigslot::has_slots<> { +class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> { public: enum State { STATE_CLOSED, diff --git a/rtc_base/async_resolver_interface.h b/rtc_base/async_resolver_interface.h index 0f5e989a13..0d0bb7ce95 100644 --- a/rtc_base/async_resolver_interface.h +++ b/rtc_base/async_resolver_interface.h @@ -12,12 +12,13 @@ #define RTC_BASE_ASYNC_RESOLVER_INTERFACE_H_ #include "rtc_base/socket_address.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/third_party/sigslot/sigslot.h" namespace rtc { // This interface defines the methods to resolve the address asynchronously. -class AsyncResolverInterface { +class RTC_EXPORT AsyncResolverInterface { public: AsyncResolverInterface(); virtual ~AsyncResolverInterface(); diff --git a/rtc_base/checks.h b/rtc_base/checks.h index 4e81d315b0..17d32cb19a 100644 --- a/rtc_base/checks.h +++ b/rtc_base/checks.h @@ -46,6 +46,7 @@ RTC_NORETURN void rtc_FatalMessage(const char* file, int line, const char* msg); #include "absl/strings/string_view.h" #include "rtc_base/numerics/safe_compare.h" #include "rtc_base/system/inline.h" +#include "rtc_base/system/rtc_export.h" // The macros here print a message to stderr and abort under various // conditions. All will accept additional stream messages. For example: @@ -108,11 +109,11 @@ enum class CheckArgType : int8_t { kCheckOp, }; -RTC_NORETURN void FatalLog(const char* file, - int line, - const char* message, - const CheckArgType* fmt, - ...); +RTC_NORETURN RTC_EXPORT void FatalLog(const char* file, + int line, + const char* message, + const CheckArgType* fmt, + ...); // Wrapper for log arguments. Only ever make values of this type with the // MakeVal() functions. diff --git a/rtc_base/copy_on_write_buffer.h b/rtc_base/copy_on_write_buffer.h index ea4868fc14..68c6ad53d6 100644 --- a/rtc_base/copy_on_write_buffer.h +++ b/rtc_base/copy_on_write_buffer.h @@ -23,10 +23,11 @@ #include "rtc_base/buffer.h" #include "rtc_base/checks.h" #include "rtc_base/ref_counted_object.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { -class CopyOnWriteBuffer { +class RTC_EXPORT CopyOnWriteBuffer { public: // An empty buffer. CopyOnWriteBuffer(); diff --git a/rtc_base/data_rate_limiter.h b/rtc_base/data_rate_limiter.h index d290816a2c..502a2f74b2 100644 --- a/rtc_base/data_rate_limiter.h +++ b/rtc_base/data_rate_limiter.h @@ -13,6 +13,8 @@ #include +#include "rtc_base/system/rtc_export.h" + namespace rtc { // Limits the rate of use to a certain maximum quantity per period of @@ -21,7 +23,7 @@ namespace rtc { // It's implemented like a diet plan: You have so many calories per // day. If you hit the limit, you can't eat any more until the next // day. -class DataRateLimiter { +class RTC_EXPORT DataRateLimiter { public: // For example, 100kb per second. DataRateLimiter(size_t max, double period) diff --git a/rtc_base/helpers.h b/rtc_base/helpers.h index 29c4ab06a6..2fd2fc5218 100644 --- a/rtc_base/helpers.h +++ b/rtc_base/helpers.h @@ -16,6 +16,8 @@ #include +#include "rtc_base/system/rtc_export.h" + namespace rtc { // For testing, we can return predictable data. @@ -27,21 +29,21 @@ bool InitRandom(const char* seed, size_t len); // Generates a (cryptographically) random string of the given length. // We generate base64 values so that they will be printable. -std::string CreateRandomString(size_t length); +RTC_EXPORT std::string CreateRandomString(size_t length); // Generates a (cryptographically) random string of the given length. // We generate base64 values so that they will be printable. // Return false if the random number generator failed. -bool CreateRandomString(size_t length, std::string* str); +RTC_EXPORT bool CreateRandomString(size_t length, std::string* str); // Generates a (cryptographically) random string of the given length, // with characters from the given table. Return false if the random // number generator failed. // For ease of implementation, the function requires that the table // size evenly divide 256; otherwise, it returns false. -bool CreateRandomString(size_t length, - const std::string& table, - std::string* str); +RTC_EXPORT bool CreateRandomString(size_t length, + const std::string& table, + std::string* str); // Generates (cryptographically) random data of the given length. // Return false if the random number generator failed. @@ -54,7 +56,7 @@ std::string CreateRandomUuid(); uint32_t CreateRandomId(); // Generates a 64 bit random id. -uint64_t CreateRandomId64(); +RTC_EXPORT uint64_t CreateRandomId64(); // Generates a random id > 0. uint32_t CreateRandomNonZeroId(); diff --git a/rtc_base/ip_address.h b/rtc_base/ip_address.h index 2a52e1ad1c..3f63a91b42 100644 --- a/rtc_base/ip_address.h +++ b/rtc_base/ip_address.h @@ -29,6 +29,7 @@ #if defined(WEBRTC_WIN) #include "rtc_base/win32.h" #endif +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -46,7 +47,7 @@ enum IPv6AddressFlag { }; // Version-agnostic IP address class, wraps a union of in_addr and in6_addr. -class IPAddress { +class RTC_EXPORT IPAddress { public: IPAddress() : family_(AF_UNSPEC) { ::memset(&u_, 0, sizeof(u_)); } @@ -123,7 +124,7 @@ class IPAddress { // IP class which could represent IPv6 address flags which is only // meaningful in IPv6 case. -class InterfaceAddress : public IPAddress { +class RTC_EXPORT InterfaceAddress : public IPAddress { public: InterfaceAddress() : ipv6_flags_(IPV6_ADDRESS_FLAG_NONE) {} @@ -150,8 +151,10 @@ class InterfaceAddress : public IPAddress { }; bool IPFromAddrInfo(struct addrinfo* info, IPAddress* out); -bool IPFromString(const std::string& str, IPAddress* out); -bool IPFromString(const std::string& str, int flags, InterfaceAddress* out); +RTC_EXPORT bool IPFromString(const std::string& str, IPAddress* out); +RTC_EXPORT bool IPFromString(const std::string& str, + int flags, + InterfaceAddress* out); bool IPIsAny(const IPAddress& ip); bool IPIsLoopback(const IPAddress& ip); bool IPIsLinkLocal(const IPAddress& ip); @@ -164,14 +167,14 @@ bool IPIsSharedNetwork(const IPAddress& ip); // Identify if an IP is "private", that is a loopback // or an address belonging to a link-local, a private network or a shared // network. -bool IPIsPrivate(const IPAddress& ip); +RTC_EXPORT bool IPIsPrivate(const IPAddress& ip); bool IPIsUnspec(const IPAddress& ip); size_t HashIP(const IPAddress& ip); // These are only really applicable for IPv6 addresses. bool IPIs6Bone(const IPAddress& ip); bool IPIs6To4(const IPAddress& ip); -bool IPIsMacBased(const IPAddress& ip); +RTC_EXPORT bool IPIsMacBased(const IPAddress& ip); bool IPIsSiteLocal(const IPAddress& ip); bool IPIsTeredo(const IPAddress& ip); bool IPIsULA(const IPAddress& ip); @@ -182,7 +185,7 @@ bool IPIsV4Mapped(const IPAddress& ip); int IPAddressPrecedence(const IPAddress& ip); // Returns 'ip' truncated to be 'length' bits long. -IPAddress TruncateIP(const IPAddress& ip, int length); +RTC_EXPORT IPAddress TruncateIP(const IPAddress& ip, int length); IPAddress GetLoopbackIP(int family); IPAddress GetAnyIP(int family); diff --git a/rtc_base/location.h b/rtc_base/location.h index 513bc26365..7590642c30 100644 --- a/rtc_base/location.h +++ b/rtc_base/location.h @@ -14,6 +14,7 @@ #include #include "rtc_base/stringize_macros.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -21,7 +22,7 @@ namespace rtc { // significantly brought to life. // This is a stripped down version of: // https://code.google.com/p/chromium/codesearch#chromium/src/base/location.h -class Location { +class RTC_EXPORT Location { public: // Constructor should be called with a long-lived char*, such as __FILE__. // It assumes the provided value will persist as a global constant, and it diff --git a/rtc_base/message_handler.h b/rtc_base/message_handler.h index 015255e4dc..983659484e 100644 --- a/rtc_base/message_handler.h +++ b/rtc_base/message_handler.h @@ -14,6 +14,7 @@ #include #include "rtc_base/constructor_magic.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -21,7 +22,7 @@ struct Message; // Messages get dispatched to a MessageHandler -class MessageHandler { +class RTC_EXPORT MessageHandler { public: virtual ~MessageHandler(); virtual void OnMessage(Message* msg) = 0; diff --git a/rtc_base/message_queue.h b/rtc_base/message_queue.h index 5a6bd0a842..bb58ebccac 100644 --- a/rtc_base/message_queue.h +++ b/rtc_base/message_queue.h @@ -25,6 +25,7 @@ #include "rtc_base/location.h" #include "rtc_base/message_handler.h" #include "rtc_base/socket_server.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/third_party/sigslot/sigslot.h" #include "rtc_base/thread_annotations.h" @@ -35,7 +36,7 @@ class MessageQueue; // MessageQueueManager does cleanup of of message queues -class MessageQueueManager { +class RTC_EXPORT MessageQueueManager { public: static void Add(MessageQueue* message_queue); static void Remove(MessageQueue* message_queue); @@ -188,7 +189,7 @@ class DelayedMessage { Message msg_; }; -class MessageQueue { +class RTC_EXPORT MessageQueue { public: static const int kForever = -1; diff --git a/rtc_base/net_helpers.h b/rtc_base/net_helpers.h index 6f753180fd..1e06940be7 100644 --- a/rtc_base/net_helpers.h +++ b/rtc_base/net_helpers.h @@ -23,12 +23,14 @@ #include "rtc_base/ip_address.h" #include "rtc_base/signal_thread.h" #include "rtc_base/socket_address.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { // AsyncResolver will perform async DNS resolution, signaling the result on // the SignalDone from AsyncResolverInterface when the operation completes. -class AsyncResolver : public SignalThread, public AsyncResolverInterface { +class RTC_EXPORT AsyncResolver : public SignalThread, + public AsyncResolverInterface { public: AsyncResolver(); ~AsyncResolver() override; diff --git a/rtc_base/network.h b/rtc_base/network.h index d202f6eb6c..a8608d936a 100644 --- a/rtc_base/network.h +++ b/rtc_base/network.h @@ -23,6 +23,7 @@ #include "rtc_base/mdns_responder_interface.h" #include "rtc_base/message_handler.h" #include "rtc_base/network_monitor.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/third_party/sigslot/sigslot.h" #if defined(WEBRTC_POSIX) @@ -52,7 +53,7 @@ std::string MakeNetworkKey(const std::string& name, // Utility function that attempts to determine an adapter type by an interface // name (e.g., "wlan0"). Can be used by NetworkManager subclasses when other // mechanisms fail to determine the type. -AdapterType GetAdapterTypeFromName(const char* network_name); +RTC_EXPORT AdapterType GetAdapterTypeFromName(const char* network_name); class DefaultLocalAddressProvider { public: @@ -84,8 +85,8 @@ class MdnsResponderProvider { // // This allows constructing a NetworkManager subclass on one thread and // passing it into an object that uses it on a different thread. -class NetworkManager : public DefaultLocalAddressProvider, - public MdnsResponderProvider { +class RTC_EXPORT NetworkManager : public DefaultLocalAddressProvider, + public MdnsResponderProvider { public: typedef std::vector NetworkList; @@ -157,7 +158,7 @@ class NetworkManager : public DefaultLocalAddressProvider, }; // Base class for NetworkManager implementations. -class NetworkManagerBase : public NetworkManager { +class RTC_EXPORT NetworkManagerBase : public NetworkManager { public: NetworkManagerBase(); ~NetworkManagerBase() override; @@ -215,9 +216,9 @@ class NetworkManagerBase : public NetworkManager { // Basic implementation of the NetworkManager interface that gets list // of networks using OS APIs. -class BasicNetworkManager : public NetworkManagerBase, - public MessageHandler, - public sigslot::has_slots<> { +class RTC_EXPORT BasicNetworkManager : public NetworkManagerBase, + public MessageHandler, + public sigslot::has_slots<> { public: BasicNetworkManager(); ~BasicNetworkManager() override; @@ -290,7 +291,7 @@ class BasicNetworkManager : public NetworkManagerBase, }; // Represents a Unix-type network interface, with a name and single address. -class Network { +class RTC_EXPORT Network { public: Network(const std::string& name, const std::string& description, diff --git a/rtc_base/network/BUILD.gn b/rtc_base/network/BUILD.gn index 0fbdbb1edb..d396e8cc52 100644 --- a/rtc_base/network/BUILD.gn +++ b/rtc_base/network/BUILD.gn @@ -14,6 +14,7 @@ rtc_source_set("sent_packet") { "sent_packet.h", ] deps = [ + "../system:rtc_export", "//third_party/abseil-cpp/absl/types:optional", ] } diff --git a/rtc_base/network/sent_packet.h b/rtc_base/network/sent_packet.h index 0cad31ca91..457fb969cf 100644 --- a/rtc_base/network/sent_packet.h +++ b/rtc_base/network/sent_packet.h @@ -15,6 +15,7 @@ #include #include "absl/types/optional.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -35,7 +36,7 @@ enum class PacketInfoProtocolType { kTls, }; -struct PacketInfo { +struct RTC_EXPORT PacketInfo { PacketInfo(); PacketInfo(const PacketInfo& info); ~PacketInfo(); @@ -51,7 +52,7 @@ struct PacketInfo { size_t ip_overhead_bytes = 0; }; -struct SentPacket { +struct RTC_EXPORT SentPacket { SentPacket(); SentPacket(int64_t packet_id, int64_t send_time_ms); SentPacket(int64_t packet_id, diff --git a/rtc_base/physical_socket_server.h b/rtc_base/physical_socket_server.h index b2dfb3ff86..e85b2b0f1e 100644 --- a/rtc_base/physical_socket_server.h +++ b/rtc_base/physical_socket_server.h @@ -23,6 +23,7 @@ #include "rtc_base/critical_section.h" #include "rtc_base/net_helpers.h" #include "rtc_base/socket_server.h" +#include "rtc_base/system/rtc_export.h" #if defined(WEBRTC_POSIX) typedef int SOCKET; @@ -61,7 +62,7 @@ class Dispatcher { }; // A socket server that provides the real sockets of the underlying OS. -class PhysicalSocketServer : public SocketServer { +class RTC_EXPORT PhysicalSocketServer : public SocketServer { public: PhysicalSocketServer(); ~PhysicalSocketServer() override; diff --git a/rtc_base/rtc_certificate.h b/rtc_base/rtc_certificate.h index 0a744c4111..102385e5a2 100644 --- a/rtc_base/rtc_certificate.h +++ b/rtc_base/rtc_certificate.h @@ -18,6 +18,7 @@ #include "api/scoped_refptr.h" #include "rtc_base/ref_count.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -48,7 +49,7 @@ class RTCCertificatePEM { // A thin abstraction layer between "lower level crypto stuff" like // SSLCertificate and WebRTC usage. Takes ownership of some lower level objects, // reference counting protects these from premature destruction. -class RTCCertificate : public RefCountInterface { +class RTC_EXPORT RTCCertificate : public RefCountInterface { public: // Takes ownership of |identity|. static scoped_refptr Create( diff --git a/rtc_base/rtc_certificate_generator.h b/rtc_base/rtc_certificate_generator.h index 8cabca4641..7c91163312 100644 --- a/rtc_base/rtc_certificate_generator.h +++ b/rtc_base/rtc_certificate_generator.h @@ -18,6 +18,7 @@ #include "rtc_base/ref_count.h" #include "rtc_base/rtc_certificate.h" #include "rtc_base/ssl_identity.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/thread.h" namespace rtc { @@ -53,7 +54,8 @@ class RTCCertificateGeneratorInterface { // The static function |GenerateCertificate| generates a certificate on the // current thread. The |RTCCertificateGenerator| instance generates certificates // asynchronously on the worker thread with |GenerateCertificateAsync|. -class RTCCertificateGenerator : public RTCCertificateGeneratorInterface { +class RTC_EXPORT RTCCertificateGenerator + : public RTCCertificateGeneratorInterface { public: // Generates a certificate on the current thread. Returns null on failure. // If |expires_ms| is specified, the certificate will expire in approximately diff --git a/rtc_base/socket_address.h b/rtc_base/socket_address.h index 342f5de2aa..6ee3d37bce 100644 --- a/rtc_base/socket_address.h +++ b/rtc_base/socket_address.h @@ -16,6 +16,7 @@ #include // no-presubmit-check TODO(webrtc:8982) #endif // UNIT_TEST #include "rtc_base/ip_address.h" +#include "rtc_base/system/rtc_export.h" #undef SetPort @@ -25,7 +26,7 @@ struct sockaddr_storage; namespace rtc { // Records an IP address and port. -class SocketAddress { +class RTC_EXPORT SocketAddress { public: // Creates a nil address. SocketAddress(); @@ -193,8 +194,8 @@ class SocketAddress { bool literal_; // Indicates that 'hostname_' contains a literal IP string. }; -bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr, - SocketAddress* out); +RTC_EXPORT bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr, + SocketAddress* out); SocketAddress EmptySocketAddressWithFamily(int family); } // namespace rtc diff --git a/rtc_base/ssl_adapter.h b/rtc_base/ssl_adapter.h index 240899f551..e0ed81eaf3 100644 --- a/rtc_base/ssl_adapter.h +++ b/rtc_base/ssl_adapter.h @@ -18,6 +18,7 @@ #include "rtc_base/ssl_certificate.h" #include "rtc_base/ssl_identity.h" #include "rtc_base/ssl_stream_adapter.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -96,10 +97,10 @@ class SSLAdapter : public AsyncSocketAdapter { // Call this on the main thread, before using SSL. // Call CleanupSSL when finished with SSL. -bool InitializeSSL(); +RTC_EXPORT bool InitializeSSL(); // Call to cleanup additional threads, and also the main thread. -bool CleanupSSL(); +RTC_EXPORT bool CleanupSSL(); } // namespace rtc diff --git a/rtc_base/ssl_certificate.h b/rtc_base/ssl_certificate.h index fad1404a8f..3b3f24fb91 100644 --- a/rtc_base/ssl_certificate.h +++ b/rtc_base/ssl_certificate.h @@ -23,10 +23,11 @@ #include "rtc_base/buffer.h" #include "rtc_base/constructor_magic.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { -struct SSLCertificateStats { +struct RTC_EXPORT SSLCertificateStats { SSLCertificateStats(std::string&& fingerprint, std::string&& fingerprint_algorithm, std::string&& base64_certificate, @@ -46,7 +47,7 @@ struct SSLCertificateStats { // The SSLCertificate object is pretty much immutable once created. // (The OpenSSL implementation only does reference counting and // possibly caching of intermediate results.) -class SSLCertificate { +class RTC_EXPORT SSLCertificate { public: // Parses and builds a certificate from a PEM encoded string. // Returns null on failure. @@ -90,7 +91,7 @@ class SSLCertificate { // SSLCertChain is a simple wrapper for a vector of SSLCertificates. It serves // primarily to ensure proper memory management (especially deletion) of the // SSLCertificate pointers. -class SSLCertChain final { +class RTC_EXPORT SSLCertChain final { public: explicit SSLCertChain(std::unique_ptr single_cert); explicit SSLCertChain(std::vector> certs); diff --git a/rtc_base/ssl_fingerprint.h b/rtc_base/ssl_fingerprint.h index f4037f78b0..d65d665d83 100644 --- a/rtc_base/ssl_fingerprint.h +++ b/rtc_base/ssl_fingerprint.h @@ -16,6 +16,7 @@ #include #include "rtc_base/copy_on_write_buffer.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -23,7 +24,7 @@ class RTCCertificate; class SSLCertificate; class SSLIdentity; -struct SSLFingerprint { +struct RTC_EXPORT SSLFingerprint { // TODO(steveanton): Remove once downstream projects have moved off of this. static SSLFingerprint* Create(const std::string& algorithm, const rtc::SSLIdentity* identity); diff --git a/rtc_base/ssl_identity.h b/rtc_base/ssl_identity.h index c013a89917..30e456b24e 100644 --- a/rtc_base/ssl_identity.h +++ b/rtc_base/ssl_identity.h @@ -17,6 +17,8 @@ #include #include +#include "rtc_base/system/rtc_export.h" + namespace rtc { class SSLCertChain; @@ -46,7 +48,7 @@ struct RSAParams { enum ECCurve { EC_NIST_P256, /* EC_FANCY, */ EC_LAST }; -class KeyParams { +class RTC_EXPORT KeyParams { public: // Generate a KeyParams object from a simple KeyType, using default params. explicit KeyParams(KeyType key_type = KT_DEFAULT); @@ -95,7 +97,7 @@ struct SSLIdentityParams { // Our identity in an SSL negotiation: a keypair and certificate (both // with the same public key). // This too is pretty much immutable once created. -class SSLIdentity { +class RTC_EXPORT SSLIdentity { public: // Generates an identity (keypair and self-signed certificate). If // |common_name| is non-empty, it will be used for the certificate's subject diff --git a/rtc_base/stream.h b/rtc_base/stream.h index 505ec8e1f9..9147dadd0c 100644 --- a/rtc_base/stream.h +++ b/rtc_base/stream.h @@ -18,6 +18,7 @@ #include "rtc_base/critical_section.h" #include "rtc_base/message_handler.h" #include "rtc_base/message_queue.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/third_party/sigslot/sigslot.h" namespace rtc { @@ -55,7 +56,7 @@ struct StreamEventData : public MessageData { StreamEventData(int ev, int er) : events(ev), error(er) {} }; -class StreamInterface : public MessageHandler { +class RTC_EXPORT StreamInterface : public MessageHandler { public: enum { MSG_POST_EVENT = 0xF1F1, MSG_MAX = MSG_POST_EVENT }; diff --git a/rtc_base/synchronization/BUILD.gn b/rtc_base/synchronization/BUILD.gn index 061d8a2b62..beee9b681f 100644 --- a/rtc_base/synchronization/BUILD.gn +++ b/rtc_base/synchronization/BUILD.gn @@ -47,6 +47,7 @@ rtc_source_set("sequence_checker") { "..:macromagic", "..:platform_thread_types", "../../api/task_queue", + "../system:rtc_export", ] } diff --git a/rtc_base/synchronization/sequence_checker.h b/rtc_base/synchronization/sequence_checker.h index 910c99d239..fe644fa14e 100644 --- a/rtc_base/synchronization/sequence_checker.h +++ b/rtc_base/synchronization/sequence_checker.h @@ -13,6 +13,7 @@ #include "api/task_queue/task_queue_base.h" #include "rtc_base/critical_section.h" #include "rtc_base/platform_thread_types.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/thread_annotations.h" namespace webrtc { @@ -22,7 +23,7 @@ namespace webrtc { // // Note: You should almost always use the SequenceChecker class to get the // right version for your build configuration. -class SequenceCheckerImpl { +class RTC_EXPORT SequenceCheckerImpl { public: SequenceCheckerImpl(); ~SequenceCheckerImpl(); diff --git a/rtc_base/third_party/base64/BUILD.gn b/rtc_base/third_party/base64/BUILD.gn index dca47e02b7..022f5095c5 100644 --- a/rtc_base/third_party/base64/BUILD.gn +++ b/rtc_base/third_party/base64/BUILD.gn @@ -14,4 +14,7 @@ rtc_source_set("base64") { "base64.cc", "base64.h", ] + deps = [ + "../../system:rtc_export", + ] } diff --git a/rtc_base/third_party/base64/base64.h b/rtc_base/third_party/base64/base64.h index ba26329528..7a936f23e7 100644 --- a/rtc_base/third_party/base64/base64.h +++ b/rtc_base/third_party/base64/base64.h @@ -15,6 +15,8 @@ #include #include +#include "rtc_base/system/rtc_export.h" + namespace rtc { class Base64 { @@ -56,14 +58,14 @@ class Base64 { // encoded characters. static bool IsBase64Encoded(const std::string& str); - static void EncodeFromArray(const void* data, - size_t len, - std::string* result); - static bool DecodeFromArray(const char* data, - size_t len, - DecodeFlags flags, - std::string* result, - size_t* data_used); + RTC_EXPORT static void EncodeFromArray(const void* data, + size_t len, + std::string* result); + RTC_EXPORT static bool DecodeFromArray(const char* data, + size_t len, + DecodeFlags flags, + std::string* result, + size_t* data_used); static bool DecodeFromArray(const char* data, size_t len, DecodeFlags flags, diff --git a/rtc_base/thread.h b/rtc_base/thread.h index 58df2536b1..01a3917155 100644 --- a/rtc_base/thread.h +++ b/rtc_base/thread.h @@ -27,6 +27,7 @@ #include "rtc_base/message_queue.h" #include "rtc_base/platform_thread_types.h" #include "rtc_base/socket_server.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/thread_annotations.h" #if defined(WEBRTC_WIN) @@ -77,7 +78,7 @@ class MessageHandlerWithTask final : public MessageHandler { } // namespace rtc_thread_internal -class ThreadManager { +class RTC_EXPORT ThreadManager { public: static const int kForever = -1; @@ -132,7 +133,7 @@ struct _SendMessage { // WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). -class RTC_LOCKABLE Thread : public MessageQueue { +class RTC_EXPORT RTC_LOCKABLE Thread : public MessageQueue { public: explicit Thread(SocketServer* ss); explicit Thread(std::unique_ptr ss); diff --git a/rtc_base/time_utils.h b/rtc_base/time_utils.h index 7862959507..ef54c35893 100644 --- a/rtc_base/time_utils.h +++ b/rtc_base/time_utils.h @@ -18,6 +18,7 @@ #include "rtc_base/checks.h" #include "rtc_base/strings/string_builder.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -54,10 +55,10 @@ class ClockInterface { // TODO(deadbeef): Instead of having functions that access this global // ClockInterface, we may want to pass the ClockInterface into everything // that uses it, eliminating the need for a global variable and this function. -ClockInterface* SetClockForTesting(ClockInterface* clock); +RTC_EXPORT ClockInterface* SetClockForTesting(ClockInterface* clock); // Returns previously set clock, or nullptr if no custom clock is being used. -ClockInterface* GetClockForTesting(); +RTC_EXPORT ClockInterface* GetClockForTesting(); #if defined(WINUWP) // Synchronizes the current clock based upon an NTP server's epoch in @@ -74,17 +75,17 @@ int64_t SystemTimeMillis(); uint32_t Time32(); // Returns the current time in milliseconds in 64 bits. -int64_t TimeMillis(); +RTC_EXPORT int64_t TimeMillis(); // Deprecated. Do not use this in any new code. inline int64_t Time() { return TimeMillis(); } // Returns the current time in microseconds. -int64_t TimeMicros(); +RTC_EXPORT int64_t TimeMicros(); // Returns the current time in nanoseconds. -int64_t TimeNanos(); +RTC_EXPORT int64_t TimeNanos(); // Returns a future timestamp, 'elapsed' milliseconds from now. int64_t TimeAfter(int64_t elapsed); diff --git a/rtc_base/timestamp_aligner.h b/rtc_base/timestamp_aligner.h index 2146880b04..151bcdccb1 100644 --- a/rtc_base/timestamp_aligner.h +++ b/rtc_base/timestamp_aligner.h @@ -14,6 +14,7 @@ #include #include "rtc_base/constructor_magic.h" +#include "rtc_base/system/rtc_export.h" namespace rtc { @@ -28,7 +29,7 @@ namespace rtc { // This class is not thread safe, so all calls to it must be synchronized // externally. -class TimestampAligner { +class RTC_EXPORT TimestampAligner { public: TimestampAligner(); ~TimestampAligner();