Don't use VLA's in unit tests and API examples (#3002)

MSVC doesn't support C99 VLA (variable-length array).
Use fixed size arrays in API examples and use JERRY_VLA macro
in unit tests to make these tests buildable on Windows too.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
This commit is contained in:
Csaba Osztrogonác
2019-08-06 13:01:01 +02:00
committed by Robert Fancsik
parent 051febfed7
commit 9c7511221f
10 changed files with 53 additions and 40 deletions
+1 -1
View File
@@ -836,7 +836,7 @@ test_utf8_string (void)
jerry_value_t str = jerry_create_string ((jerry_char_t *) "\x73\x74\x72\x3a \xed\xa0\x81\xed\xb0\x80");
char expect_utf8_buf[] = "\x73\x74\x72\x3a \xf0\x90\x90\x80";
size_t buf_len = sizeof (expect_utf8_buf) - 1;
char buf[buf_len+1];
JERRY_VLA (char, buf, buf_len + 1);
jerryx_arg_t mapping[] =
{