Libecoli  0.11.3
Extensible COmmand LIne library
assert.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2016, Olivier MATZ <zer0@droids-corp.org>
3  */
4 
17 #pragma once
18 
19 #include <stdbool.h>
20 
34 #define ec_assert_print(expr, args...) __ec_assert_print(expr, #expr, args)
35 
41 void __ec_assert_print(bool expr, const char *expr_str, const char *format, ...);
42 
58 #define EC_CHECK_ARG(cond, ret, err) \
59  do { \
60  if (!(cond)) { \
61  errno = err; \
62  return ret; \
63  } \
64  } while (0)
65