1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef WGPU_h 8 #define WGPU_h 9 10 // Prelude of types necessary before including wgpu_ffi_generated.h 11 namespace mozilla { 12 namespace ipc { 13 class ByteBuf; 14 } // namespace ipc 15 namespace webgpu { 16 namespace ffi { 17 18 #define WGPU_INLINE 19 #define WGPU_FUNC 20 21 extern "C" { 22 #include "wgpu_ffi_generated.h" 23 } 24 25 #undef WGPU_INLINE 26 #undef WGPU_FUNC 27 28 } // namespace ffi 29 ToFFI(ipc::ByteBuf * x)30inline ffi::WGPUByteBuf* ToFFI(ipc::ByteBuf* x) { 31 return reinterpret_cast<ffi::WGPUByteBuf*>(x); 32 } ToFFI(const ipc::ByteBuf * x)33inline const ffi::WGPUByteBuf* ToFFI(const ipc::ByteBuf* x) { 34 return reinterpret_cast<const ffi::WGPUByteBuf*>(x); 35 } 36 37 } // namespace webgpu 38 } // namespace mozilla 39 40 #endif // WGPU_h 41