#ifndef SRC_DAWN_COMMON_PLATFORM_H_
#define SRC_DAWN_COMMON_PLATFORM_H_
#define DAWN_PLATFORM_IS(X) …
#if defined(_WIN32) || defined(_WIN64)
#include <winapifamily.h>
#define DAWN_PLATFORM_IS_WINDOWS …
#if WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
#define DAWN_PLATFORM_IS_WIN32 …
#elif WINAPI_FAMILY == WINAPI_FAMILY_PC_APP
#define DAWN_PLATFORM_IS_WINUWP …
#else
#error "Unsupported Windows platform."
#endif
#elif defined(__linux__)
#define DAWN_PLATFORM_IS_LINUX …
#define DAWN_PLATFORM_IS_POSIX …
#if defined(__ANDROID__)
#define DAWN_PLATFORM_IS_ANDROID …
#elif defined(DAWN_OS_CHROMEOS)
#define DAWN_PLATFORM_IS_CHROMEOS …
#else
#define DAWN_PLATFORM_IS_LINUX_DESKTOP …
#endif
#elif defined(__APPLE__)
#define DAWN_PLATFORM_IS_APPLE …
#define DAWN_PLATFORM_IS_POSIX …
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#define DAWN_PLATFORM_IS_IOS …
#elif TARGET_OS_MAC
#define DAWN_PLATFORM_IS_MACOS …
#else
#error "Unsupported Apple platform."
#endif
#elif defined(__Fuchsia__)
#define DAWN_PLATFORM_IS_FUCHSIA …
#define DAWN_PLATFORM_IS_POSIX …
#elif defined(__EMSCRIPTEN__)
#define DAWN_PLATFORM_IS_EMSCRIPTEN …
#define DAWN_PLATFORM_IS_POSIX …
#include <emscripten/emscripten.h>
#else
#error "Unsupported platform."
#endif
#if defined(__i386__) || defined(_M_IX86)
#define DAWN_PLATFORM_IS_X86 …
#define DAWN_PLATFORM_IS_I386 …
#elif defined(__x86_64__) || defined(_M_X64)
#define DAWN_PLATFORM_IS_X86 …
#define DAWN_PLATFORM_IS_X86_64 …
#elif defined(__arm__) || defined(_M_ARM)
#define DAWN_PLATFORM_IS_ARM …
#define DAWN_PLATFORM_IS_ARM32 …
#elif defined(__aarch64__) || defined(_M_ARM64)
#define DAWN_PLATFORM_IS_ARM …
#define DAWN_PLATFORM_IS_ARM64 …
#elif defined(__loongarch__)
#define DAWN_PLATFORM_IS_LOONGARCH …
#if __loongarch_grlen == 64
#define DAWN_PLATFORM_IS_LOONGARCH64 …
#else
#define DAWN_PLATFORM_IS_LOONGARCH32 …
#endif
#elif defined(__riscv)
#define DAWN_PLATFORM_IS_RISCV …
#if __riscv_xlen == 32
#define DAWN_PLATFORM_IS_RISCV32 …
#else
#define DAWN_PLATFORM_IS_RISCV64 …
#endif
#elif defined(__mips__)
#define DAWN_PLATFORM_IS_MIPS …
#if _MIPS_SIM == _ABIO32
#define DAWN_PLATFORM_IS_MIPS32 …
#else
#define DAWN_PLATFORM_IS_MIPS64 …
#endif
#elif defined(__s390__)
#define DAWN_PLATFORM_IS_S390 …
#elif defined(__s390x__)
#define DAWN_PLATFORM_IS_S390X …
#elif defined(__PPC__)
#define DAWN_PLATFORM_IS_PPC …
#elif defined(__PPC64__)
#define DAWN_PLATFORM_IS_PPC64 …
#elif defined(__wasm32__)
#define DAWN_PLATFORM_IS_WASM32 …
#elif defined(__wasm64__)
#define DAWN_PLATFORM_IS_WASM64 …
#else
#error "Unsupported platform."
#endif
#if defined(DAWN_PLATFORM_IS_X86_64) || defined(DAWN_PLATFORM_IS_ARM64) || \
defined(DAWN_PLATFORM_IS_RISCV64) || defined(DAWN_PLATFORM_IS_MIPS64) || \
defined(DAWN_PLATFORM_IS_S390X) || defined(DAWN_PLATFORM_IS_PPC64) || \
defined(DAWN_PLATFORM_IS_LOONGARCH64) || defined(DAWN_PLATFORM_IS_WASM64)
#define DAWN_PLATFORM_IS_64_BIT …
static_assert …;
#elif defined(DAWN_PLATFORM_IS_I386) || defined(DAWN_PLATFORM_IS_ARM32) || \
defined(DAWN_PLATFORM_IS_RISCV32) || defined(DAWN_PLATFORM_IS_MIPS32) || \
defined(DAWN_PLATFORM_IS_S390) || defined(DAWN_PLATFORM_IS_PPC32) || \
defined(DAWN_PLATFORM_IS_LOONGARCH32) || defined(DAWN_PLATFORM_IS_WASM32)
#define DAWN_PLATFORM_IS_32_BIT …
static_assert(sizeof(sizeof(char)) == 4, "Expect sizeof(size_t) == 4");
#else
#error "Unsupported platform"
#endif
#if !defined(DAWN_PLATFORM_IS_WINDOWS)
#define DAWN_PLATFORM_IS_WINDOWS …
#endif
#if !defined(DAWN_PLATFORM_IS_WIN32)
#define DAWN_PLATFORM_IS_WIN32 …
#endif
#if !defined(DAWN_PLATFORM_IS_WINUWP)
#define DAWN_PLATFORM_IS_WINUWP …
#endif
#if !defined(DAWN_PLATFORM_IS_POSIX)
#define DAWN_PLATFORM_IS_POSIX …
#endif
#if !defined(DAWN_PLATFORM_IS_LINUX)
#define DAWN_PLATFORM_IS_LINUX …
#endif
#if !defined(DAWN_PLATFORM_IS_ANDROID)
#define DAWN_PLATFORM_IS_ANDROID …
#endif
#if !defined(DAWN_PLATFORM_IS_CHROMEOS)
#define DAWN_PLATFORM_IS_CHROMEOS …
#endif
#if !defined(DAWN_PLATFORM_IS_LINUX_DESKTOP)
#define DAWN_PLATFORM_IS_LINUX_DESKTOP …
#endif
#if !defined(DAWN_PLATFORM_IS_APPLE)
#define DAWN_PLATFORM_IS_APPLE …
#endif
#if !defined(DAWN_PLATFORM_IS_IOS)
#define DAWN_PLATFORM_IS_IOS …
#endif
#if !defined(DAWN_PLATFORM_IS_MACOS)
#define DAWN_PLATFORM_IS_MACOS …
#endif
#if !defined(DAWN_PLATFORM_IS_FUCHSIA)
#define DAWN_PLATFORM_IS_FUCHSIA …
#endif
#if !defined(DAWN_PLATFORM_IS_EMSCRIPTEN)
#define DAWN_PLATFORM_IS_EMSCRIPTEN …
#endif
#if !defined(DAWN_PLATFORM_IS_X86)
#define DAWN_PLATFORM_IS_X86 …
#endif
#if !defined(DAWN_PLATFORM_IS_I386)
#define DAWN_PLATFORM_IS_I386 …
#endif
#if !defined(DAWN_PLATFORM_IS_X86_64)
#define DAWN_PLATFORM_IS_X86_64 …
#endif
#if !defined(DAWN_PLATFORM_IS_ARM)
#define DAWN_PLATFORM_IS_ARM …
#endif
#if !defined(DAWN_PLATFORM_IS_ARM32)
#define DAWN_PLATFORM_IS_ARM32 …
#endif
#if !defined(DAWN_PLATFORM_IS_ARM64)
#define DAWN_PLATFORM_IS_ARM64 …
#endif
#if !defined(DAWN_PLATFORM_IS_LOONGARCH)
#define DAWN_PLATFORM_IS_LOONGARCH …
#endif
#if !defined(DAWN_PLATFORM_IS_LOONGARCH32)
#define DAWN_PLATFORM_IS_LOONGARCH32 …
#endif
#if !defined(DAWN_PLATFORM_IS_LOONGARCH64)
#define DAWN_PLATFORM_IS_LOONGARCH64 …
#endif
#if !defined(DAWN_PLATFORM_IS_RISCV)
#define DAWN_PLATFORM_IS_RISCV …
#endif
#if !defined(DAWN_PLATFORM_IS_RISCV32)
#define DAWN_PLATFORM_IS_RISCV32 …
#endif
#if !defined(DAWN_PLATFORM_IS_RISCV64)
#define DAWN_PLATFORM_IS_RISCV64 …
#endif
#if !defined(DAWN_PLATFORM_IS_MIPS)
#define DAWN_PLATFORM_IS_MIPS …
#endif
#if !defined(DAWN_PLATFORM_IS_MIPS32)
#define DAWN_PLATFORM_IS_MIPS32 …
#endif
#if !defined(DAWN_PLATFORM_IS_MIPS64)
#define DAWN_PLATFORM_IS_MIPS64 …
#endif
#if !defined(DAWN_PLATFORM_IS_S390)
#define DAWN_PLATFORM_IS_S390 …
#endif
#if !defined(DAWN_PLATFORM_IS_S390X)
#define DAWN_PLATFORM_IS_S390X …
#endif
#if !defined(DAWN_PLATFORM_IS_PPC)
#define DAWN_PLATFORM_IS_PPC …
#endif
#if !defined(DAWN_PLATFORM_IS_PPC64)
#define DAWN_PLATFORM_IS_PPC64 …
#endif
#if !defined(DAWN_PLATFORM_IS_WASM32)
#define DAWN_PLATFORM_IS_WASM32 …
#endif
#if !defined(DAWN_PLATFORM_IS_WASM64)
#define DAWN_PLATFORM_IS_WASM64 …
#endif
#if !defined(DAWN_PLATFORM_IS_64_BIT)
#define DAWN_PLATFORM_IS_64_BIT …
#endif
#if !defined(DAWN_PLATFORM_IS_32_BIT)
#define DAWN_PLATFORM_IS_32_BIT …
#endif
#endif