-
Notifications
You must be signed in to change notification settings - Fork 683
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
Conversation
#include <stdarg.h> | ||
|
||
#include "jerryscript.h" | ||
#include "jmem.h" |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
Add missing jerry_port.c in previous initial port.
JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee [email protected]