summaryrefslogtreecommitdiff
path: root/legacy/evil/src/lib/evil_time.c
blob: 279ba1c7b57aefaadeb22783a056d21677de7892 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif /* HAVE_CONFIG_H */

#include "Evil.h"
#include "evil_private.h"


struct tm *
localtime_r(const time_t *timep, struct tm *result)
{
#ifndef _MSC_VER
   struct tm *tmp;
#endif /* ! _MSC_VER */

   if (!timep || !result)
     return NULL;

#ifdef _MSC_VER
   if (localtime_s(result, timep) != 0)
     return NULL;
#else
   tmp = localtime(timep);
   if (!tmp)
     return NULL;

   memcpy(result, tmp, sizeof(struct tm));

#endif /* ! _MSC_VER */

   return result;
}

#ifdef UNDER_CE

void
tzset(void)
{
   /* does nothing... */
}

#endif /* UNDER_CE */