From 3ad39e9878310e5317ee73c9b353c1e2c1c5c4ee Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sat, 11 Jul 2026 22:48:30 +0800 Subject: lib: establish Zircon libc++ and KTL foundation --- lib/libc/include/assert.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/libc/include/assert.h (limited to 'lib/libc/include/assert.h') diff --git a/lib/libc/include/assert.h b/lib/libc/include/assert.h new file mode 100644 index 0000000..8b6252e --- /dev/null +++ b/lib/libc/include/assert.h @@ -0,0 +1,20 @@ +// Copyright 2020 The Fuchsia Authors +// +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT + +#pragma once + +#include + +#ifdef NDEBUG +#define assert(expr) ((void)0) +#else +#define assert(expr) ZX_ASSERT(expr) +#endif + +// make sure static_assert() is defined, even in C +#if !defined(__cplusplus) && !defined(static_assert) +#define static_assert(e, msg) _Static_assert(e, msg) +#endif -- cgit v1.2.3