Skip to content

target: tizenrt-artik05x: Add missing jerry_port.c #1786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2017
Merged

target: tizenrt-artik05x: Add missing jerry_port.c #1786

merged 1 commit into from
Apr 27, 2017

Conversation

glistening
Copy link
Contributor

Add missing jerry_port.c in previous initial port.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee [email protected]

#include <stdarg.h>

#include "jerryscript.h"
#include "jmem.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an internal header of jerry-core. It should not be used outside of the library (an does not seem to be used in this file anyway).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary for type jerry_log_level. I can remove it after #1749 is landed. But I found "jerryscript-port.h" is better header for 'jerry_log_level'.

I will remove 'jmem.h' immediately. It seems leftover.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, please use "jerryscript-port.h"

/**
* JerryScript log level
*/
static jerry_log_level_t jerry_log_level = JERRY_LOG_LEVEL_ERROR;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this static global needed? There is no support to set its value anywhere, so it might be easier to just use JERRY_LOG_LEVEL_ERROR directly in jerry_port_log.

Copy link
Contributor Author

@glistening glistening Apr 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to enable the setting jerry_log_level. But there is no jerry_log_level setting api in jerryscript-port.h. In fact, I defined the setting function internally and used it. But recently many changes happen in especially in porting and external functions. So I tried to put the minimals. Anyway, I will follow your suggestion temporarily. Thank you for your review.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is deliberately no common port API function for setting the log level, as jerry does not call anything like that. The port API contains such functions only, which are called from jerry-core. If a port needs log level setting, it has to define any variables needed for storing that value and any functions for accessing (R and/or W) that value.

Copy link
Contributor Author

@glistening glistening Apr 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before #1777 landed, jerry_port.c was linked in jerry library so application cannot access the jerry_log_level, defined in jerry library, without external API or making jerry_log_level public. But since for now, at least tizenrt port can follow your suggestion. And currently jerryscript-port-default defines void jerry_port_default_set_log_level (jerry_log_level_t level);. I may use the default style. Thank you.

Add missing jerry_port.c in previous initial port.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee [email protected]
Copy link
Member

@akosthekiss akosthekiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yichoi
Copy link
Contributor

yichoi commented Apr 27, 2017

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants