Unify asserts in jerry-ext (#4488)

Some components of the jerry-ext library re-declared their own
assert and/or static assert macros. No need to re-invent the wheel
all the time. This patch makes all components use the assert macros
defined in jext-common.h. This also makes maintenance easier.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2021-01-17 15:21:46 +01:00
committed by GitHub
parent 11894a6032
commit 9bc0f2fd3f
5 changed files with 8 additions and 29 deletions
+2 -6
View File
@@ -13,18 +13,14 @@
* limitations under the License.
*/
#include "arg-internal.h"
#include "jerryscript-ext/arg.h"
#include "jerryscript.h"
#define JERRYX_STATIC_ASSERT(x, msg) \
enum { static_assertion_failed_ ## msg = 1 / (!!(x)) }
#include "arg-internal.h"
#include "jext-common.h"
JERRYX_STATIC_ASSERT (sizeof (jerryx_arg_int_option_t) <= sizeof (((jerryx_arg_t *) 0)->extra_info),
jerryx_arg_number_options_t_must_fit_into_extra_info);
#undef JERRYX_STATIC_ASSERT
/**
* Validate the JS arguments and assign them to the native arguments.
*