update code.
This commit is contained in:
100
VocieProcess/rtc_base/system/arch.h
Normal file
100
VocieProcess/rtc_base/system/arch.h
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
// This file contains platform-specific typedefs and defines.
|
||||
// Much of it is derived from Chromium's build/build_config.h.
|
||||
|
||||
#ifndef RTC_BASE_SYSTEM_ARCH_H_
|
||||
#define RTC_BASE_SYSTEM_ARCH_H_
|
||||
|
||||
// Processor architecture detection. For more info on what's defined, see:
|
||||
// https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
|
||||
// https://www.agner.org/optimize/calling_conventions.pdf
|
||||
// https://sourceforge.net/p/predef/wiki/Architectures/
|
||||
// or with gcc, run: "echo | gcc -E -dM -"
|
||||
#if defined(_M_X64) || defined(__x86_64__)
|
||||
#define WEBRTC_ARCH_X86_FAMILY
|
||||
#define WEBRTC_ARCH_X86_64
|
||||
#define WEBRTC_ARCH_64_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(_M_ARM64) || defined(__aarch64__)
|
||||
#define WEBRTC_ARCH_ARM_FAMILY
|
||||
#define WEBRTC_ARCH_64_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(_M_IX86) || defined(__i386__)
|
||||
#define WEBRTC_ARCH_X86_FAMILY
|
||||
#define WEBRTC_ARCH_X86
|
||||
#define WEBRTC_ARCH_32_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(_M_ARM) || defined(__ARMEL__)
|
||||
#define WEBRTC_ARCH_ARM_FAMILY
|
||||
#define WEBRTC_ARCH_32_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(__MIPSEL__) || defined(__MIPSEB__)
|
||||
#define WEBRTC_ARCH_MIPS_FAMILY
|
||||
#if defined(__LP64__)
|
||||
#define WEBRTC_ARCH_64_BITS
|
||||
#else
|
||||
#define WEBRTC_ARCH_32_BITS
|
||||
#endif
|
||||
#if defined(__MIPSEL__)
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#else
|
||||
#define WEBRTC_ARCH_BIG_ENDIAN
|
||||
#endif
|
||||
#elif defined(__PPC__)
|
||||
#if defined(__PPC64__)
|
||||
#define WEBRTC_ARCH_64_BITS
|
||||
#else
|
||||
#define WEBRTC_ARCH_32_BITS
|
||||
#endif
|
||||
#if defined(__LITTLE_ENDIAN__)
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#else
|
||||
#define WEBRTC_ARCH_BIG_ENDIAN
|
||||
#endif
|
||||
#elif defined(__sparc) || defined(__sparc__)
|
||||
#if __SIZEOF_LONG__ == 8
|
||||
#define WEBRTC_ARCH_64_BITS
|
||||
#else
|
||||
#define WEBRTC_ARCH_32_BITS
|
||||
#endif
|
||||
#define WEBRTC_ARCH_BIG_ENDIAN
|
||||
#elif defined(__riscv) && __riscv_xlen == 64
|
||||
#define WEBRTC_ARCH_64_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(__riscv) && __riscv_xlen == 32
|
||||
#define WEBRTC_ARCH_32_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(__loongarch32)
|
||||
#define WEBRTC_ARCH_LOONG_FAMILY
|
||||
#define WEBRTC_ARCH_LOONG32
|
||||
#define WEBRTC_ARCH_32_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(__loongarch64)
|
||||
#define WEBRTC_ARCH_LOONG_FAMILY
|
||||
#define WEBRTC_ARCH_LOONG64
|
||||
#define WEBRTC_ARCH_64_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(__pnacl__)
|
||||
#define WEBRTC_ARCH_32_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
#define WEBRTC_ARCH_32_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#else
|
||||
#error Please add support for your architecture in rtc_base/system/arch.h
|
||||
#endif
|
||||
|
||||
#if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN))
|
||||
#error Define either WEBRTC_ARCH_LITTLE_ENDIAN or WEBRTC_ARCH_BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
#endif // RTC_BASE_SYSTEM_ARCH_H_
|
31
VocieProcess/rtc_base/system/inline.h
Normal file
31
VocieProcess/rtc_base/system/inline.h
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef RTC_BASE_SYSTEM_INLINE_H_
|
||||
#define RTC_BASE_SYSTEM_INLINE_H_
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
#define RTC_FORCE_INLINE __forceinline
|
||||
#define RTC_NO_INLINE __declspec(noinline)
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
#define RTC_FORCE_INLINE __attribute__((__always_inline__))
|
||||
#define RTC_NO_INLINE __attribute__((__noinline__))
|
||||
|
||||
#else
|
||||
|
||||
#define RTC_FORCE_INLINE
|
||||
#define RTC_NO_INLINE
|
||||
|
||||
#endif
|
||||
|
||||
#endif // RTC_BASE_SYSTEM_INLINE_H_
|
37
VocieProcess/rtc_base/system/no_unique_address.h
Normal file
37
VocieProcess/rtc_base/system/no_unique_address.h
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef RTC_BASE_SYSTEM_NO_UNIQUE_ADDRESS_H_
|
||||
#define RTC_BASE_SYSTEM_NO_UNIQUE_ADDRESS_H_
|
||||
|
||||
// RTC_NO_UNIQUE_ADDRESS is a portable annotation to tell the compiler that
|
||||
// a data member need not have an address distinct from all other non-static
|
||||
// data members of its class.
|
||||
// It allows empty types to actually occupy zero bytes as class members,
|
||||
// instead of occupying at least one byte just so that they get their own
|
||||
// address. There is almost never any reason not to use it on class members
|
||||
// that could possibly be empty.
|
||||
// The macro expands to [[no_unique_address]] if the compiler supports the
|
||||
// attribute, it expands to nothing otherwise.
|
||||
// Clang should supports this attribute since C++11, while other compilers
|
||||
// should add support for it starting from C++20. Among clang compilers,
|
||||
// clang-cl doesn't support it yet and support is unclear also when the target
|
||||
// platform is iOS.
|
||||
#ifndef __has_cpp_attribute
|
||||
#define __has_cpp_attribute(x) 0
|
||||
#endif
|
||||
#if __has_cpp_attribute(no_unique_address)
|
||||
// NOLINTNEXTLINE(whitespace/braces)
|
||||
#define RTC_NO_UNIQUE_ADDRESS [[no_unique_address]]
|
||||
#else
|
||||
#define RTC_NO_UNIQUE_ADDRESS
|
||||
#endif
|
||||
|
||||
#endif // RTC_BASE_SYSTEM_NO_UNIQUE_ADDRESS_H_
|
43
VocieProcess/rtc_base/system/rtc_export.h
Normal file
43
VocieProcess/rtc_base/system/rtc_export.h
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef RTC_BASE_SYSTEM_RTC_EXPORT_H_
|
||||
#define RTC_BASE_SYSTEM_RTC_EXPORT_H_
|
||||
|
||||
// RTC_EXPORT is used to mark symbols as exported or imported when WebRTC is
|
||||
// built or used as a shared library.
|
||||
// When WebRTC is built as a static library the RTC_EXPORT macro expands to
|
||||
// nothing.
|
||||
|
||||
#ifdef WEBRTC_ENABLE_SYMBOL_EXPORT
|
||||
|
||||
#ifdef WEBRTC_WIN
|
||||
|
||||
#ifdef WEBRTC_LIBRARY_IMPL
|
||||
#define RTC_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define RTC_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#else // WEBRTC_WIN
|
||||
|
||||
#if __has_attribute(visibility) && defined(WEBRTC_LIBRARY_IMPL)
|
||||
#define RTC_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
#endif // WEBRTC_WIN
|
||||
|
||||
#endif // WEBRTC_ENABLE_SYMBOL_EXPORT
|
||||
|
||||
#ifndef RTC_EXPORT
|
||||
#define RTC_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // RTC_BASE_SYSTEM_RTC_EXPORT_H_
|
Reference in New Issue
Block a user