log4tango 5.0.2
PortabilityImpl.hh
Go to the documentation of this file.
1//
2// PortabilityImpl.hh
3//
4// Copyright (C) : 2000 - 2002
5// LifeLine Networks BV (www.lifeline.nl). All rights reserved.
6// Bastiaan Bakker. All rights reserved.
7//
8// 2004,2005,2006,2007,2008,2009,2010,2011,2012
9// Synchrotron SOLEIL
10// L'Orme des Merisiers
11// Saint-Aubin - BP 48 - France
12//
13// This file is part of log4tango.
14//
15// Log4ango is free software: you can redistribute it and/or modify
16// it under the terms of the GNU Lesser General Public License as published by
17// the Free Software Foundation, either version 3 of the License, or
18// (at your option) any later version.
19//
20// Log4tango is distributed in the hope that it will be useful,
21// but WITHOUT ANY WARRANTY; without even the implied warranty of
22// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23// GNU Lesser General Public License for more details.
24//
25// You should have received a copy of the GNU Lesser General Public License
26// along with Log4Tango. If not, see <http://www.gnu.org/licenses/>.
27
28#ifndef _LOG4TANGO_PORTABILITYIMPL_H
29#define _LOG4TANGO_PORTABILITYIMPL_H
30
32
33#ifdef LOG4TANGO_CSTDLIB_NOT_IN_STD
34#include <cstdlib>
35namespace std {
36 static inline char *getenv(const char *name) { return ::getenv(name); };
37 static inline int atoi(const char *nptr) { return ::atoi(nptr); };
38 static inline unsigned long int
39 strtoul(const char *nptr, char **endptr, int base) {
40 return ::strtol(nptr, endptr, base);
41 };
42}
43#endif
44
45#ifdef LOG4TANGO_CSTRING_NOT_IN_STD
46#include <cstring>
47namespace std {
48 static inline void *memmove(void *dest, const void *src, size_t n) {
49 return ::memmove(dest, src, n);
50 };
51}
52#endif
53
54#ifdef LOG4TANGO_CTIME_NOT_IN_STD
55#include <ctime>
56namespace std {
57 static inline size_t strftime(char *strDest, size_t maxsize, const char *format, const struct tm *timeptr ) {
58 return ::strftime(strDest,maxsize,format,timeptr);
59 }
60 static inline struct tm *localtime( const time_t *timer ) { return ::localtime(timer); }
61 }
62#endif
63
64#ifdef LOG4TANGO_CMATH_NOT_IN_STD
65#include <cmath>
66namespace std {
67 static inline int abs(int i) { return ::abs(i); }
68}
69#endif
70
71#endif // _LOG4TANGO_PORTABILITYIMPL_H
Definition: LoggerStream.hh:178