Add missing RTC_EXPORT for the component build.

Bug: webrtc:9419
Change-Id: I3225259fb4cc55e9820f590928795f4587f1e3cb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153884
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29479}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index 4eed48c..a472b3d 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -33,6 +33,9 @@
   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 c3d5b41..6051409 100644
--- a/api/call/call_factory_interface.h
+++ b/api/call/call_factory_interface.h
@@ -13,6 +13,8 @@
 
 #include <memory>
 
+#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 @@
   virtual Call* CreateCall(const CallConfig& config) = 0;
 };
 
-std::unique_ptr<CallFactoryInterface> CreateCallFactory();
+RTC_EXPORT std::unique_ptr<CallFactoryInterface> CreateCallFactory();
 
 }  // namespace webrtc
 
diff --git a/api/crypto/BUILD.gn b/api/crypto/BUILD.gn
index a9bd479..685dccd 100644
--- a/api/crypto/BUILD.gn
+++ b/api/crypto/BUILD.gn
@@ -24,6 +24,7 @@
   ]
   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 f0b91d0..91a585a 100644
--- a/api/crypto/crypto_options.h
+++ b/api/crypto/crypto_options.h
@@ -13,12 +13,14 @@
 
 #include <vector>
 
+#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 fc47dbb..ccf3ad7 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 @@
   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 1170e0f..8fd8cd1 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 @@
 
 // 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 3f7f12a..7b4934a 100644
--- a/api/jsep.h
+++ b/api/jsep.h
@@ -52,7 +52,7 @@
 // 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 6150350..5fb73c9 100644
--- a/api/media_stream_interface.h
+++ b/api/media_stream_interface.h
@@ -145,8 +145,9 @@
 // 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<VideoFrame> {
+class RTC_EXPORT VideoTrackInterface
+    : public MediaStreamTrackInterface,
+      public rtc::VideoSourceInterface<VideoFrame> {
  public:
   // Video track content hint, used to override the source is_screencast
   // property.
@@ -235,7 +236,7 @@
   ~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 12c5162..2b7da83 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -1253,7 +1253,7 @@
 // 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 @@
 // 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 @@
 // 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<PeerConnectionFactoryInterface>
+RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
 CreateModularPeerConnectionFactory(
     PeerConnectionFactoryDependencies dependencies);
 
diff --git a/api/proxy.h b/api/proxy.h
index 6627aac..3e76ee7 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 @@
 
 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 ffdcc0a..970507f 100644
--- a/api/rtc_error.h
+++ b/api/rtc_error.h
@@ -131,7 +131,7 @@
 //
 // 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 e420190..bd2570b 100644
--- a/api/rtc_event_log/BUILD.gn
+++ b/api/rtc_event_log/BUILD.gn
@@ -36,6 +36,7 @@
   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 0efb1e5..06cc074 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 fe2ec80..77db960 100644
--- a/api/rtp_parameters.h
+++ b/api/rtp_parameters.h
@@ -91,7 +91,7 @@
 
 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 @@
 // 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 @@
 };
 
 // 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 @@
 // 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<uint32_t> ssrc;
@@ -352,7 +352,7 @@
   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<uint32_t> ssrc;
@@ -502,7 +502,7 @@
   }
 };
 
-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 ffd7497..b01e07d 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 @@
   virtual ~RtpReceiverObserverInterface() {}
 };
 
-class RtpReceiverInterface : public rtc::RefCountInterface {
+class RTC_EXPORT RtpReceiverInterface : public rtc::RefCountInterface {
  public:
   virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0;
 
diff --git a/api/rtp_sender_interface.h b/api/rtp_sender_interface.h
index e6140db..5d6271f 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 4606632..2a60f98 100644
--- a/api/rtp_transceiver_interface.h
+++ b/api/rtp_transceiver_interface.h
@@ -65,7 +65,7 @@
 //
 // 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 71bf164..e10834c 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 0da9c6c..eda6d47 100644
--- a/api/video/BUILD.gn
+++ b/api/video/BUILD.gn
@@ -26,6 +26,7 @@
   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 91b4e17..a7ad86b 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 @@
 // 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 3b8db14..d87a423 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 @@
 // 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 @@
   ~PlanarYuv8Buffer() override {}
 };
 
-class I420BufferInterface : public PlanarYuv8Buffer {
+class RTC_EXPORT I420BufferInterface : public PlanarYuv8Buffer {
  public:
   Type type() const override;
 
@@ -127,7 +128,7 @@
   ~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 40dbb90..0bd2ad5 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 @@
 // 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<MediaEngineInterface> CreateMediaEngine(
+RTC_EXPORT std::unique_ptr<MediaEngineInterface> 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 6fc1057..e46deea 100644
--- a/modules/audio_processing/include/audio_processing.h
+++ b/modules/audio_processing/include/audio_processing.h
@@ -226,7 +226,7 @@
 // // 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 a5b67ec..3a18b78 100644
--- a/modules/desktop_capture/desktop_frame.h
+++ b/modules/desktop_capture/desktop_frame.h
@@ -174,7 +174,7 @@
 };
 
 // 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 ba846da..2e2d2f3 100644
--- a/modules/desktop_capture/shared_memory.h
+++ b/modules/desktop_capture/shared_memory.h
@@ -20,6 +20,7 @@
 #include <memory>
 
 #include "rtc_base/constructor_magic.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
@@ -29,7 +30,7 @@
 // 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 1b63f1d..7a0ff31 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -119,6 +119,7 @@
     "../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 9856cd6..f5e3635 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 @@
 // 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 17cf3f5..564989a 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -58,6 +58,7 @@
     "../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 @@
   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 @@
     ":checks",
     ":safe_conversions",
     ":stringutils",
+    "system:rtc_export",
   ]
   libs = []
   if (is_win) {
@@ -762,6 +765,7 @@
     "../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 3afff3b..50c07e2 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 @@
 
 // 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 @@
 
 // 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 0f5e989..0d0bb7c 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 4e81d31..17d32cb 100644
--- a/rtc_base/checks.h
+++ b/rtc_base/checks.h
@@ -46,6 +46,7 @@
 #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 @@
   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 ea4868f..68c6ad5 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 d290816..502a2f7 100644
--- a/rtc_base/data_rate_limiter.h
+++ b/rtc_base/data_rate_limiter.h
@@ -13,6 +13,8 @@
 
 #include <stddef.h>
 
+#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 @@
 // 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 29c4ab0..2fd2fc5 100644
--- a/rtc_base/helpers.h
+++ b/rtc_base/helpers.h
@@ -16,6 +16,8 @@
 
 #include <string>
 
+#include "rtc_base/system/rtc_export.h"
+
 namespace rtc {
 
 // For testing, we can return predictable data.
@@ -27,21 +29,21 @@
 
 // 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 @@
 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 2a52e1a..3f63a91 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 @@
 };
 
 // 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 @@
 
 // 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 @@
 };
 
 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 @@
 // 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 @@
 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 513bc26..7590642 100644
--- a/rtc_base/location.h
+++ b/rtc_base/location.h
@@ -14,6 +14,7 @@
 #include <string>
 
 #include "rtc_base/stringize_macros.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace rtc {
 
@@ -21,7 +22,7 @@
 // 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 015255e..9836594 100644
--- a/rtc_base/message_handler.h
+++ b/rtc_base/message_handler.h
@@ -14,6 +14,7 @@
 #include <utility>
 
 #include "rtc_base/constructor_magic.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace rtc {
 
@@ -21,7 +22,7 @@
 
 // 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 5a6bd0a..bb58ebc 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 @@
 
 // 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 @@
   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 6f75318..1e06940 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 d202f6e..a8608d9 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 @@
 // 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 @@
 //
 // 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<Network*> NetworkList;
 
@@ -157,7 +158,7 @@
 };
 
 // Base class for NetworkManager implementations.
-class NetworkManagerBase : public NetworkManager {
+class RTC_EXPORT NetworkManagerBase : public NetworkManager {
  public:
   NetworkManagerBase();
   ~NetworkManagerBase() override;
@@ -215,9 +216,9 @@
 
 // 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 @@
 };
 
 // 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 0fbdbb1..d396e8c 100644
--- a/rtc_base/network/BUILD.gn
+++ b/rtc_base/network/BUILD.gn
@@ -14,6 +14,7 @@
     "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 0cad31c..457fb96 100644
--- a/rtc_base/network/sent_packet.h
+++ b/rtc_base/network/sent_packet.h
@@ -15,6 +15,7 @@
 #include <stdint.h>
 
 #include "absl/types/optional.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace rtc {
 
@@ -35,7 +36,7 @@
   kTls,
 };
 
-struct PacketInfo {
+struct RTC_EXPORT PacketInfo {
   PacketInfo();
   PacketInfo(const PacketInfo& info);
   ~PacketInfo();
@@ -51,7 +52,7 @@
   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 b2dfb3f..e85b2b0 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 @@
 };
 
 // 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 0a744c4..102385e 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 @@
 // 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<RTCCertificate> Create(
diff --git a/rtc_base/rtc_certificate_generator.h b/rtc_base/rtc_certificate_generator.h
index 8cabca4..7c91163 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 @@
 // 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 342f5de..6ee3d37 100644
--- a/rtc_base/socket_address.h
+++ b/rtc_base/socket_address.h
@@ -16,6 +16,7 @@
 #include <ostream>  // 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 @@
 namespace rtc {
 
 // Records an IP address and port.
-class SocketAddress {
+class RTC_EXPORT SocketAddress {
  public:
   // Creates a nil address.
   SocketAddress();
@@ -193,8 +194,8 @@
   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 240899f..e0ed81e 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 @@
 
 // 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 fad1404..3b3f24f 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 @@
 // 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 @@
 // 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<SSLCertificate> single_cert);
   explicit SSLCertChain(std::vector<std::unique_ptr<SSLCertificate>> certs);
diff --git a/rtc_base/ssl_fingerprint.h b/rtc_base/ssl_fingerprint.h
index f4037f7..d65d665 100644
--- a/rtc_base/ssl_fingerprint.h
+++ b/rtc_base/ssl_fingerprint.h
@@ -16,6 +16,7 @@
 #include <string>
 
 #include "rtc_base/copy_on_write_buffer.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace rtc {
 
@@ -23,7 +24,7 @@
 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 c013a89..30e456b 100644
--- a/rtc_base/ssl_identity.h
+++ b/rtc_base/ssl_identity.h
@@ -17,6 +17,8 @@
 #include <ctime>
 #include <string>
 
+#include "rtc_base/system/rtc_export.h"
+
 namespace rtc {
 
 class SSLCertChain;
@@ -46,7 +48,7 @@
 
 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 @@
 // 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 505ec8e..9147dad 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 @@
   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 061d8a2..beee9b68 100644
--- a/rtc_base/synchronization/BUILD.gn
+++ b/rtc_base/synchronization/BUILD.gn
@@ -47,6 +47,7 @@
     "..: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 910c99d..fe644fa 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 @@
 //
 // 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 dca47e0..022f509 100644
--- a/rtc_base/third_party/base64/BUILD.gn
+++ b/rtc_base/third_party/base64/BUILD.gn
@@ -14,4 +14,7 @@
     "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 ba26329..7a936f2 100644
--- a/rtc_base/third_party/base64/base64.h
+++ b/rtc_base/third_party/base64/base64.h
@@ -15,6 +15,8 @@
 #include <string>
 #include <vector>
 
+#include "rtc_base/system/rtc_export.h"
+
 namespace rtc {
 
 class Base64 {
@@ -56,14 +58,14 @@
   // 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 58df2536..01a3917 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 @@
 
 }  // namespace rtc_thread_internal
 
-class ThreadManager {
+class RTC_EXPORT ThreadManager {
  public:
   static const int kForever = -1;
 
@@ -132,7 +133,7 @@
 
 // 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<SocketServer> ss);
diff --git a/rtc_base/time_utils.h b/rtc_base/time_utils.h
index 7862959..ef54c35 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 @@
 // 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 @@
 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 2146880..151bcdc 100644
--- a/rtc_base/timestamp_aligner.h
+++ b/rtc_base/timestamp_aligner.h
@@ -14,6 +14,7 @@
 #include <stdint.h>
 
 #include "rtc_base/constructor_magic.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace rtc {
 
@@ -28,7 +29,7 @@
 
 // This class is not thread safe, so all calls to it must be synchronized
 // externally.
-class TimestampAligner {
+class RTC_EXPORT TimestampAligner {
  public:
   TimestampAligner();
   ~TimestampAligner();