File tree 8 files changed +52
-0
lines changed
8 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ jerry_return (const jerry_value_t value) /**< return value */
166
166
void
167
167
jerry_init (jerry_init_flag_t flags ) /**< combination of Jerry flags */
168
168
{
169
+ jerry_port_init ();
169
170
#if JERRY_EXTERNAL_CONTEXT
170
171
size_t total_size = jerry_port_context_alloc (sizeof (jerry_context_t ));
171
172
JERRY_UNUSED (total_size );
Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ typedef enum
49
49
JERRY_FATAL_FAILED_ASSERTION = 120 /**< Assertion failed */
50
50
} jerry_fatal_code_t ;
51
51
52
+ /**
53
+ * Init the program
54
+ */
55
+ void jerry_port_init (void );
56
+
52
57
/**
53
58
* Signal the port that the process experienced a fatal failure from which it cannot
54
59
* recover.
Original file line number Diff line number Diff line change 25
25
26
26
#include <unistd.h>
27
27
28
+ void
29
+ jerry_port_init (void )
30
+ {
31
+ } /* jerry_port_init */
32
+
28
33
/**
29
34
* Default implementation of jerry_port_sleep, uses 'usleep'.
30
35
*/
Original file line number Diff line number Diff line change 18
18
19
19
#include <windows.h>
20
20
21
+ #include <crtdbg.h>
22
+
23
+ void
24
+ jerry_port_init (void )
25
+ {
26
+ if (!IsDebuggerPresent ())
27
+ {
28
+ /* Disable all of the possible ways Windows conspires to make automated
29
+ testing impossible. */
30
+ #if defined(_MSC_VER )
31
+ _set_error_mode (_OUT_TO_STDERR );
32
+ _CrtSetReportMode (_CRT_WARN , _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG );
33
+ _CrtSetReportFile (_CRT_WARN , _CRTDBG_FILE_STDERR );
34
+ _CrtSetReportMode (_CRT_ERROR , _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG );
35
+ _CrtSetReportFile (_CRT_ERROR , _CRTDBG_FILE_STDERR );
36
+ _CrtSetReportMode (_CRT_ASSERT , _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG );
37
+ _CrtSetReportFile (_CRT_ASSERT , _CRTDBG_FILE_STDERR );
38
+ #endif /* _MSC_VER */
39
+ }
40
+ } /* jerry_port_init */
41
+
21
42
/**
22
43
* Default implementation of jerry_port_sleep, uses 'Sleep'.
23
44
*/
Original file line number Diff line number Diff line change 20
20
21
21
#include " mbed.h"
22
22
23
+ void
24
+ jerry_port_init (void )
25
+ {
26
+ } /* jerry_port_init */
27
+
23
28
/* *
24
29
* Aborts the program.
25
30
*/
Original file line number Diff line number Diff line change 19
19
20
20
#include "jerryscript-port.h"
21
21
22
+ void
23
+ jerry_port_init (void )
24
+ {
25
+ } /* jerry_port_init */
26
+
22
27
/**
23
28
* Default implementation of jerry_port_log. Prints log messages to stderr.
24
29
*/
Original file line number Diff line number Diff line change 18
18
19
19
#include "jerryscript-port.h"
20
20
21
+ void
22
+ jerry_port_init (void )
23
+ {
24
+ } /* jerry_port_init */
25
+
21
26
/**
22
27
* Dummy function to get the time zone adjustment.
23
28
*
Original file line number Diff line number Diff line change 22
22
23
23
#include "getline-zephyr.h"
24
24
25
+ void
26
+ jerry_port_init (void )
27
+ {
28
+ } /* jerry_port_init */
29
+
25
30
/**
26
31
* Aborts the program.
27
32
*/
You can’t perform that action at this time.
0 commit comments