~ubuntu-branches/ubuntu/wily/log4cpp/wily-proposed

« back to all changes in this revision

Viewing changes to src/Localtime.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-04-06 09:45:37 UTC
  • mfrom: (2.1.6 hardy)
  • Revision ID: james.westby@ubuntu.com-20080406094537-cyhmgbqybwqn82nl
Tags: 1.0-4
* Add patch to fix FTBFS with gcc 4.3. Thanks to Barry deFreeze.
  (Closes: #455336)
* Add patch to remove log4cpp_cflags from pkgconfig file. (Closes: #472289)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <log4cpp/Portability.hh>
 
2
#include "Localtime.hh"
 
3
#include <time.h>
 
4
#include <memory.h>
 
5
 
 
6
namespace log4cpp         
 
7
{
 
8
 
 
9
#if defined(_MSC_VER) && defined(LOG4CPP_HAVE_LOCALTIME_R)
 
10
   void localtime(const ::time_t* time, ::tm* t)
 
11
   {
 
12
      localtime_s(t, time);  
 
13
   }
 
14
#endif
 
15
 
 
16
#if !defined(_MSC_VER) && defined(LOG4CPP_HAVE_LOCALTIME_R)
 
17
   void localtime(const ::time_t* time, ::tm* t)
 
18
   {
 
19
      localtime_r(time, t);
 
20
   }
 
21
#endif
 
22
 
 
23
#if !defined(LOG4CPP_HAVE_LOCALTIME_R)
 
24
   void localtime(const ::time_t* time, ::tm* t)
 
25
   {
 
26
      ::tm* tmp = ::localtime(time);
 
27
      memcpy(t, tmp, sizeof(::tm));
 
28
   }
 
29
#endif
 
30
 
 
31
}