[Git][pulseaudio/webrtc-audio-processing][master] Bring arch.h in line with upstream webrtc

Arun Raghavan (@arun) gitlab at gitlab.freedesktop.org
Tue Dec 12 15:46:35 UTC 2023



Arun Raghavan pushed to branch master at PulseAudio / webrtc-audio-processing


Commits:
f89958d8 by Ben Brown at 2023-11-29T16:59:12+00:00
Bring arch.h in line with upstream webrtc

Largely to bring in preprocessor support for additional architectures as
based on 6215ba804eb500f3e28b39088c73af3c4f4cd10a by
Timothy Gu <timothygu99 at gmail.com>:

Add preprocessor support for additional architectures

- _M_ARM is used by Microsoft [1]
- __riscv and __riscv_xlen are defined by [2]
- __sparc and __sparc__ are documented at [3]
- __MIPSEB__, __PPC__, __PPC64__ are documented at [3] and used in
  Chromium's build/build_config.h [4]
  Note: Chromium assumes that all PowerPC architectures are 64-bit. This
  is in fact not true.

[1]: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-160
[2]: https://github.com/riscv/riscv-toolchain-conventions/tree/feca4793566811993f67e008a449d794cfc48953#cc-preprocessor-definitions
[3]: https://sourceforge.net/p/predef/wiki/Architectures/
[4]: https://source.chromium.org/chromium/chromium/src/+/master:build/build_config.h;drc=e12bf2e5ff1eacb9aca3e9a26bdeebdbdad5965a

- - - - -


1 changed file:

- webrtc/rtc_base/system/arch.h


Changes:

=====================================
webrtc/rtc_base/system/arch.h
=====================================
@@ -15,8 +15,9 @@
 #define RTC_BASE_SYSTEM_ARCH_H_
 
 // Processor architecture detection.  For more info on what's defined, see:
-//   http://msdn.microsoft.com/en-us/library/b0084kay.aspx
-//   http://www.agner.org/optimize/calling_conventions.pdf
+//   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
@@ -27,29 +28,50 @@
 #define WEBRTC_ARCH_ARM_FAMILY
 #define WEBRTC_ARCH_64_BITS
 #define WEBRTC_ARCH_LITTLE_ENDIAN
-#elif defined(__riscv) || defined(__riscv__)
-#define WEBRTC_ARCH_LITTLE_ENDIAN
-#if __riscv_xlen == 64
-#define WEBRTC_ARCH_64_BITS
-#else
-#define WEBRTC_ARCH_32_BITS
-#endif
 #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(__ARMEL__)
+#elif defined(_M_ARM) || defined(__ARMEL__)
 #define WEBRTC_ARCH_ARM_FAMILY
 #define WEBRTC_ARCH_32_BITS
 #define WEBRTC_ARCH_LITTLE_ENDIAN
-#elif defined(__MIPSEL__)
+#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(__pnacl__)
 #define WEBRTC_ARCH_32_BITS



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/commit/f89958d82420cc02c7d80cf8f365e6ed57546c92

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/commit/f89958d82420cc02c7d80cf8f365e6ed57546c92
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20231212/14800121/attachment-0001.htm>


More information about the pulseaudio-commits mailing list