-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLocaltime.cpp
More file actions
37 lines (31 loc) · 752 Bytes
/
Localtime.cpp
File metadata and controls
37 lines (31 loc) · 752 Bytes
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
/*
* Copyright 2002, Log4cpp Project. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#include <log4cpp/Portability.hh>
#include "Localtime.hh"
#include <time.h>
#include <memory.h>
namespace log4cpp
{
#if defined(_MSC_VER) && defined(LOG4CPP_HAVE_LOCALTIME_R)
void localtime(const ::time_t* time, ::tm* t)
{
localtime_s(t, time);
}
#endif
#if !defined(_MSC_VER) && defined(LOG4CPP_HAVE_LOCALTIME_R)
void localtime(const ::time_t* time, ::tm* t)
{
localtime_r(time, t);
}
#endif
#if !defined(LOG4CPP_HAVE_LOCALTIME_R)
void localtime(const ::time_t* time, ::tm* t)
{
::tm* tmp = ::localtime(time);
memcpy(t, tmp, sizeof(::tm));
}
#endif
}