[OpenWrt-Devel] [PATCH v2 libubox 05/10] add assert.h component

Michael Jones mike at meshplusplus.com
Wed Nov 20 19:12:14 EST 2019


You may need #include_next, to avoid recursion.

On Wed, Nov 20, 2019, 15:45 Petr Štetiar <ynezz at true.cz> wrote:

> In order to allow seamless assert() usage in release builds without the
> need for fiddling with CMake C flags as CMake adds -DNDEBUG switch in
> release builds which disable assert().
>
> Signed-off-by: Petr Štetiar <ynezz at true.cz>
> ---
>  assert.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
>  create mode 100644 assert.h
>
> diff --git a/assert.h b/assert.h
> new file mode 100644
> index 000000000000..84f54718366a
> --- /dev/null
> +++ b/assert.h
> @@ -0,0 +1,9 @@
> +#pragma once
> +
> +#ifdef NDEBUG
> +#undef NDEBUG
> +#include <assert.h>
> +#define NDEBUG
> +#else
> +#include <assert.h>
> +#endif
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20191120/65c05369/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list