@@ -30,25 +30,18 @@ void jerry_port_watchdog_set_period(uint32_t milliseconds)
3030/* *
3131 * Provide log message implementation for the engine.
3232 */
33- void jerry_port_log (jerry_log_level_t level, /* *< log level */
34- const char * format, /* *< format string */
35- ...) /* *< parameters */
33+ void jerry_port_log (const char * msg)
3634{
37- (void )level; /* ignore log level */
38-
39- va_list args;
40- va_start (args, format);
41- m_vprintf (format, args);
42- va_end (args);
35+ m_puts (msg);
4336}
4437
4538/* *
46- * Default implementation of jerry_port_get_current_time .
39+ * Default implementation of jerry_port_current_time .
4740 */
48- double jerry_port_get_current_time ()
41+ double jerry_port_current_time ()
4942{
5043 return RTC .getRtcNanoseconds () / 1e9 ;
51- } /* jerry_port_get_current_time */
44+ }
5245
5346/* *
5447 * Default implementation of jerry_port_get_local_time_zone_adjustment. Uses the 'tm_gmtoff' field
@@ -61,9 +54,24 @@ double jerry_port_get_current_time()
6154double jerry_port_get_local_time_zone_adjustment (double unix_ms, /* *< ms since unix epoch */
6255 bool is_utc) /* *< is the time above in UTC? */
6356{
57+ // TODO
6458 return 0.0 ;
6559}
6660
61+ /* *
62+ * Get the current system time in UTC.
63+ *
64+ * This port function is called by jerry-core when JERRY_BUILTIN_DATE is enabled.
65+ * It can also be used in the implementing application to initialize the random number generator.
66+ *
67+ * @return milliseconds since Unix epoch
68+ */
69+ int32_t jerry_port_local_tza (double unix_ms)
70+ {
71+ // TODO
72+ return 0 ;
73+ }
74+
6775/* *
6876 * Default implementation of jerry_port_fatal.
6977 */
@@ -97,3 +105,10 @@ jerry_context_t* jerry_port_get_current_context(void)
97105{
98106 return Jerryscript::Context::getCurrent ();
99107}
108+
109+ /* *
110+ * Init the program
111+ */
112+ void jerry_port_init (void )
113+ {
114+ }
0 commit comments