log4cpp
1.1.4
Toggle main menu visibility
Loading...
Searching...
No Matches
PortabilityImpl.hh
Go to the documentation of this file.
1
/*
2
* PortabilityImpl.hh
3
*
4
* Copyright 2002, Log4cpp Project. All rights reserved.
5
*
6
* See the COPYING file for the terms of usage and distribution.
7
*/
8
9
#ifndef _LOG4CPP_PORTABILITYIMPL_HH
10
#define _LOG4CPP_PORTABILITYIMPL_HH
11
12
#include <
log4cpp/Portability.hh
>
13
14
#ifdef LOG4CPP_CSTDLIB_NOT_IN_STD
15
#include <cstdlib>
16
namespace
std
{
17
static
inline
char
*getenv(
const
char
*name) { return ::getenv(name); };
18
static
inline
int
atoi(
const
char
*nptr) { return ::atoi(nptr); };
19
static
inline
unsigned
long
int
20
strtoul(
const
char
*nptr,
char
**endptr,
int
base) {
21
return ::strtol(nptr, endptr, base);
22
};
23
static
inline
void
abort(
void
) { ::abort(); };
24
25
}
26
#endif
27
28
#ifdef LOG4CPP_CSTRING_NOT_IN_STD
29
#include <cstring>
30
namespace
std
{
31
static
inline
void
*memmove(
void
*dest,
const
void
*src,
size_t
n) {
32
return ::memmove(dest, src, n);
33
};
34
}
35
#endif
36
37
#ifdef LOG4CPP_CTIME_NOT_IN_STD
38
#include <ctime>
39
namespace
std
{
40
static
inline
size_t
strftime(
char
*strDest,
size_t
maxsize,
const
char
*format,
const
struct
tm *timeptr ) {
41
return ::strftime(strDest,maxsize,format,timeptr);
42
}
43
static
inline
struct
tm *
localtime
(
const
time_t *timer ) { return ::localtime(timer); }
44
using
::clock;
45
using
::tm;
46
using
::time_t;
47
}
48
#endif
49
50
#ifdef LOG4CPP_CMATH_NOT_IN_STD
51
#include <cmath>
52
namespace
std
{
53
static
inline
int
abs(
int
i) { return ::abs(i); }
54
}
55
#endif
56
57
namespace
log4cpp
58
{
59
template
<
typename
T>
const
T&
min
(
const
T& a,
const
T& b)
60
{
61
return
a < b ? a : b;
62
}
63
64
template
<
typename
T>
const
T&
max
(
const
T& a,
const
T& b)
65
{
66
return
a > b ? a : b;
67
}
68
}
69
70
#endif
// _LOG4CPP_PORTABILITYIMPL_HH
Portability.hh
log4cpp
The top level namespace for all 'Log for C++' types and classes.
Definition
AbortAppender.hh:16
log4cpp::localtime
void localtime(const ::time_t *time, ::tm *t)
Definition
Localtime.cpp:30
log4cpp::max
const T & max(const T &a, const T &b)
Definition
PortabilityImpl.hh:64
log4cpp::min
const T & min(const T &a, const T &b)
Definition
PortabilityImpl.hh:59
std
Definition
Portability.hh:59
src
PortabilityImpl.hh
Generated by
1.17.0