2
0

common.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /**
  2. * Copyright (c) 2019 Paul-Louis Ageneau
  3. *
  4. * This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  7. */
  8. #ifndef RTC_COMMON_H
  9. #define RTC_COMMON_H
  10. #ifdef RTC_STATIC
  11. #define RTC_CPP_EXPORT
  12. #else // dynamic library
  13. #ifdef _WIN32
  14. #ifdef RTC_EXPORTS
  15. #define RTC_CPP_EXPORT __declspec(dllexport) // building the library
  16. #else
  17. #define RTC_CPP_EXPORT __declspec(dllimport) // using the library
  18. #endif
  19. #else // not WIN32
  20. #define RTC_CPP_EXPORT
  21. #endif
  22. #endif
  23. #ifdef _WIN32
  24. #ifndef _WIN32_WINNT
  25. #define _WIN32_WINNT 0x0602 // Windows 8
  26. #endif
  27. #ifdef _MSC_VER
  28. #pragma warning(disable : 4251) // disable "X needs to have dll-interface..."
  29. #endif
  30. #endif
  31. #ifndef RTC_ENABLE_WEBSOCKET
  32. #define RTC_ENABLE_WEBSOCKET 1
  33. #endif
  34. #ifndef RTC_ENABLE_MEDIA
  35. #define RTC_ENABLE_MEDIA 1
  36. #endif
  37. #include "rtc.h" // for C API defines
  38. #include "utils.hpp"
  39. #include <cstddef>
  40. #include <functional>
  41. #include <memory>
  42. #include <mutex>
  43. #include <optional>
  44. #include <string>
  45. #include <string_view>
  46. #include <variant>
  47. #include <vector>
  48. namespace rtc {
  49. using std::byte;
  50. using std::nullopt;
  51. using std::optional;
  52. using std::shared_ptr;
  53. using std::string;
  54. using std::string_view;
  55. using std::unique_ptr;
  56. using std::variant;
  57. using std::weak_ptr;
  58. using binary = std::vector<byte>;
  59. using message_variant = variant<binary, string>;
  60. using std::int16_t;
  61. using std::int32_t;
  62. using std::int64_t;
  63. using std::int8_t;
  64. using std::ptrdiff_t;
  65. using std::size_t;
  66. using std::uint16_t;
  67. using std::uint32_t;
  68. using std::uint64_t;
  69. using std::uint8_t;
  70. } // namespace rtc
  71. #endif