-
Notifications
You must be signed in to change notification settings - Fork 683
Fix system call related date builtin functions #873
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
Fix system call related date builtin functions #873
Conversation
57a217f
to
2723f18
Compare
@@ -384,3 +386,12 @@ fwrite (const void *ptr, /**< data to write */ | |||
return bytes_written / size; | |||
} /* fwrite */ | |||
|
|||
/** | |||
* This function can get the time as well as a timezone. | |||
*/ |
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.
return value description?
2723f18
to
cd38874
Compare
@zherczeg, I've updated the PR. |
cd38874
to
976707e
Compare
@@ -24,6 +24,8 @@ | |||
#include "fdlibm-math.h" | |||
#include "lit-char-helpers.h" | |||
|
|||
#include <time.h> | |||
|
|||
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN |
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 think the <time.h> include should be inside the ifndef. It is not needed otherwise.
976707e
to
1057970
Compare
@zherczeg, I've updated the PR. |
#define JERRY_LIBC_TIME_H | ||
|
||
#ifdef __cplusplus | ||
# define EXTERN_C "C" |
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 not this will be a symbol clash? I think there is a { } based solution for that.
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 worked fine for me. Could you be more specific? BTW, this is used in every jerry-libc header.
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 agree with @zherczeg here. It would be better to use the more traditional
#ifdef __cplusplus
extern "C" {
#endif
// header main content here
#ifdef __cplusplus
}
#endif
approach. The issue is that the #define EXTERN_C "C"
way is used all over the project. I'd love to see that change.
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.
Ok, I'll change it everywhere and add it in a separate commit, but part of this PR.
@akiss77, @zherczeg, I've updated the PR. |
LGTM |
6ccd84e
to
442add4
Compare
It's much better practice to have the
Something like that. Opinion? |
@akiss77, the suggested style is convenient for me. The biggest problem here is the vera++ checker. We have to modify the rule and currently not sure how. @zherczeg, @akiss77, do you mind if I raise an issue for this and do it in a separate PR? |
@LaszloLango OK with me |
442add4
to
17766ef
Compare
|
||
/** | ||
* @} | ||
*/ | ||
|
||
#endif /* !JERRY_API_H */ | ||
#ifdef __cplusplus | ||
} /* */ | ||
#endif /* !__cplusplus */ |
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.
The order seems to be mixed up here. JERRY_PORT_H starts, extern C starts, JERRY_PORT_H ends, extern C ends.
And, lo, wrong closing comment! this is not JERRY_API_H...
17766ef
to
415293f
Compare
A reverted the last commit, so this PR only contains the code related to the Date builtin, because the change of the EXTERN_C macro is not trivial at the moment. I raised an issue for that: #900 and pushed a new branch to my fork: https://github.com/LaszloLango/jerryscript/tree/refactor-extern-c-define @zherczeg, @akiss77 please check this PR again. Is this ready for merge? |
LGTM (FWIW) |
Related issues: jerryscript-project#213, jerryscript-project#691 * Fixed 'ecma_date_local_tza' and 'ecma_date_daylight_saving_ta' date builtin helper functions * Added syscall of gettimeofday function to get the current system time and timezone. * Fixed related regression test files. JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
415293f
to
684ed72
Compare
Related issues: #213, #691
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com