These changes are designed to enable the TI compilers to compile (#1505)
Jerryscript. The changes include: CMakeLists.txt: we added conditionals around GCC-specific flags, added support for TI flags, and removed the always-on debugging flag (-g) /toolchain_mcu_tim4f.cmake: new toolchain file uses TI-specific parameters jerry-api.h: the sys/types.h file was #include'd but never used, so we removed it jrt-types.h: ditto jerry-port-default-date.c: the TI toolchain doesn't include sys/time.h, so we guarded uses of the package ecma-objects-general.c: added initialization that Travis (the auto-checking tool) required JerryScript-DCO-1.0-Signed-off-by: Timothy Harvey t-harvey@ti.com
This commit is contained in:
committed by
Tilmann Scheller
parent
94b6aae52c
commit
f88d1a4863
@@ -13,7 +13,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifdef __GNUC__
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "jerry-port.h"
|
||||
#include "jerry-port-default.h"
|
||||
@@ -23,6 +25,7 @@
|
||||
*/
|
||||
bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
|
||||
@@ -39,6 +42,9 @@ bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
|
||||
tz_p->daylight_saving_time = tz.tz_dsttime > 0 ? 1 : 0;
|
||||
|
||||
return true;
|
||||
#else /* !__GNUC__ */
|
||||
return false;
|
||||
#endif /* __GNUC__ */
|
||||
} /* jerry_port_get_time_zone */
|
||||
|
||||
/**
|
||||
@@ -46,12 +52,16 @@ bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
|
||||
*/
|
||||
double jerry_port_get_current_time ()
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
struct timeval tv;
|
||||
|
||||
if (gettimeofday (&tv, NULL) != 0)
|
||||
{
|
||||
return 0;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
return ((double) tv.tv_sec) * 1000.0 + ((double) tv.tv_usec) / 1000.0;
|
||||
#else /* __!GNUC__ */
|
||||
return 0.0;
|
||||
#endif /* __GNUC__ */
|
||||
} /* jerry_port_get_current_time */
|
||||
|
||||
Reference in New Issue
Block a user