[fix] fix compile error on MacOSX

This commit is contained in:
dijunkun
2025-02-10 15:46:22 +08:00
parent 1f3c93c77a
commit 2c48ce12c5
11 changed files with 23 additions and 24 deletions

View File

@@ -38,7 +38,7 @@ class CopyOnWriteBuffer {
private:
void EnsureUnique() {
if (!buffer_.unique()) {
if (buffer_.use_count() != 1) {
buffer_ = std::make_shared<std::vector<uint8_t>>(*buffer_);
}
}

View File

@@ -12,7 +12,7 @@
#include <atomic>
#include "ref_count.h"
#include "api/ref_count.h"
namespace webrtc {
namespace webrtc_impl {

View File

@@ -18,10 +18,10 @@
#if defined(__POSIX__)
#include <sys/time.h>
#endif
#if defined(__APPLE__)
#include <mach/mach_time.h>
#endif
#endif
#if defined(_WIN32)
// clang-format off

View File

@@ -15,13 +15,12 @@
#endif
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/system_time.h"
#include "rtc_base/time_utils.h"
#include "system_time.h"
#if defined(_WIN32)
#include "rtc_base/win32.h"
#endif
#if defined(_WIN32)
#include <minwinbase.h>
#include "rtc_base/win32.h"
#endif
namespace rtc {
@@ -228,6 +227,7 @@ int64_t TimeUTCMicros() {
return (li.QuadPart - kFileTimeToUnixTimeEpochOffset) /
kFileTimeToMicroSeconds;
#endif
return 0;
}
int64_t TimeUTCMillis() { return TimeUTCMicros() / kNumMicrosecsPerMillisec; }

View File

@@ -14,7 +14,7 @@
#include <stdint.h>
#include <time.h>
#include "system_time.h"
#include "rtc_base/system_time.h"
namespace rtc {