common.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /**
  2. * Copyright (c) 2019 Paul-Louis Ageneau
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef RTC_COMMON_H
  19. #define RTC_COMMON_H
  20. #ifndef RTC_ENABLE_WEBSOCKET
  21. #define RTC_ENABLE_WEBSOCKET 1
  22. #endif
  23. #ifndef RTC_ENABLE_MEDIA
  24. #define RTC_ENABLE_MEDIA 1
  25. #endif
  26. #ifdef _WIN32
  27. #define RTC_CPP_EXPORT __declspec(dllexport)
  28. #ifndef _WIN32_WINNT
  29. #define _WIN32_WINNT 0x0602 // Windows 8
  30. #endif
  31. #ifdef _MSC_VER
  32. #pragma warning(disable : 4251) // disable "X needs to have dll-interface..."
  33. #endif
  34. #else
  35. #define RTC_CPP_EXPORT
  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 binary_ptr = shared_ptr<binary>;
  60. using message_variant = variant<binary, string>;
  61. using std::int16_t;
  62. using std::int32_t;
  63. using std::int64_t;
  64. using std::int8_t;
  65. using std::ptrdiff_t;
  66. using std::size_t;
  67. using std::uint16_t;
  68. using std::uint32_t;
  69. using std::uint64_t;
  70. using std::uint8_t;
  71. } // namespace rtc
  72. #endif