Build fix

Fix build error on darwin and build with default libc.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-02-19 15:24:59 +01:00
parent 9d7978074f
commit 76b37f34d0
6 changed files with 22 additions and 20 deletions
@@ -26,7 +26,16 @@
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN
#include <time.h>
#include <sys/time.h>
/**
* Timezone structure
*/
struct timezone
{
int tz_minuteswest; /**< minutes west of Greenwich */
int tz_dsttime; /**< type of DST correction */
};
/** \addtogroup ecma ECMA
* @{
@@ -447,9 +456,10 @@ ecma_date_week_day (ecma_number_t time) /**< time value */
ecma_number_t __attr_always_inline___
ecma_date_local_tza ()
{
struct timeval tv;
struct timezone tz;
if (gettimeofday (NULL, &tz) != 0)
if (gettimeofday (&tv, &tz) != 0)
{
return ecma_raise_type_error ("gettimeofday failed");
}
@@ -473,9 +483,10 @@ ecma_date_daylight_saving_ta (ecma_number_t time) /**< time value */
return time; /* time is NaN */
}
struct timeval tv;
struct timezone tz;
if (gettimeofday (NULL, &tz) != 0)
if (gettimeofday (&tv, &tz) != 0)
{
return ecma_raise_type_error ("gettimeofday failed");
}