rtc_export.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef RTC_BASE_SYSTEM_RTC_EXPORT_H_
  11. #define RTC_BASE_SYSTEM_RTC_EXPORT_H_
  12. // RTC_EXPORT is used to mark symbols as exported or imported when WebRTC is
  13. // built or used as a shared library.
  14. // When WebRTC is built as a static library the RTC_EXPORT macro expands to
  15. // nothing.
  16. #ifdef WEBRTC_ENABLE_SYMBOL_EXPORT
  17. #ifdef WEBRTC_WIN
  18. #ifdef WEBRTC_LIBRARY_IMPL
  19. #define RTC_EXPORT __declspec(dllexport)
  20. #else
  21. #define RTC_EXPORT __declspec(dllimport)
  22. #endif
  23. #else // WEBRTC_WIN
  24. #if __has_attribute(visibility) && defined(WEBRTC_LIBRARY_IMPL)
  25. #define RTC_EXPORT __attribute__((visibility("default")))
  26. #endif
  27. #endif // WEBRTC_WIN
  28. #endif // WEBRTC_ENABLE_SYMBOL_EXPORT
  29. #ifndef RTC_EXPORT
  30. #define RTC_EXPORT
  31. #endif
  32. #endif // RTC_BASE_SYSTEM_RTC_EXPORT_H_