Fix layering violation in applications

Apps that use jerry should not (must not!) include and rely on its
internal headers. Typical issue is the use of "jrt/jrt.h". Fixing
`main-{unix,mcu}.c`, and speculatively the apps under the `targets`
directory as well.

(Note: a fix can be either including "jerry-port.h" and using
functions declared there, e.g., `jerry_port_errormsg`, or simply
using standard libc function like `printf`. Both approaches occur
in this patch.)

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2016-04-15 07:01:41 +02:00
parent 40e4d2638b
commit bb665336d4
4 changed files with 48 additions and 49 deletions
+1 -2
View File
@@ -17,7 +17,6 @@
#include <stdio.h>
#include "jerry-core/jerry.h"
#include "jerry-core/jrt/jrt.h" /* for JERRY_ERROR_MSG */
#include "jerry_extapi.h"
#include "native_esp8266.h"
@@ -52,7 +51,7 @@ DELCARE_HANDLER(assert) {
printf (">> Jerry assert true\r\n");
return true;
}
JERRY_ERROR_MSG ("Script assertion failed\n");
printf ("Script assertion failed\n");
exit (JERRY_STANDALONE_EXIT_CODE_FAIL);
return false;
}