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:
+2
-6
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user