log4tango 4.0.3
PortabilityImpl.hh
Go to the documentation of this file.
00001 //
00002 // PortabilityImpl.hh
00003 //
00004 // Copyright (C) :  2000 - 2002
00005 //                                      LifeLine Networks BV (www.lifeline.nl). All rights reserved.
00006 //                                      Bastiaan Bakker. All rights reserved.   
00007 //                                      
00008 //                                      2004,2005,2006,2007,2008,2009,2010
00009 //                                      Synchrotron SOLEIL
00010 //                      L'Orme des Merisiers
00011 //                      Saint-Aubin - BP 48 - France
00012 //
00013 // This file is part of log4tango.
00014 //
00015 // Log4ango is free software: you can redistribute it and/or modify
00016 // it under the terms of the GNU Lesser General Public License as published by
00017 // the Free Software Foundation, either version 3 of the License, or
00018 // (at your option) any later version.
00019 // 
00020 // Log4tango is distributed in the hope that it will be useful,
00021 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 // GNU Lesser General Public License for more details.
00024 // 
00025 // You should have received a copy of the GNU Lesser General Public License
00026 // along with Log4Tango.  If not, see <http://www.gnu.org/licenses/>.
00027 
00028 #ifndef _LOG4TANGO_PORTABILITYIMPL_H
00029 #define _LOG4TANGO_PORTABILITYIMPL_H
00030 
00031 #include <log4tango/Portability.hh>
00032 
00033 #ifdef LOG4TANGO_CSTDLIB_NOT_IN_STD
00034 #include <cstdlib>
00035 namespace std {
00036   static inline char *getenv(const char *name) { return ::getenv(name); };
00037   static inline int atoi(const char *nptr) { return ::atoi(nptr); };
00038   static inline unsigned long int
00039       strtoul(const char *nptr, char **endptr, int base) { 
00040       return ::strtol(nptr, endptr, base); 
00041   };
00042 }
00043 #endif
00044     
00045 #ifdef LOG4TANGO_CSTRING_NOT_IN_STD
00046 #include <cstring>
00047 namespace std {
00048   static inline void *memmove(void *dest, const void *src, size_t n) {
00049       return ::memmove(dest, src, n);
00050   };
00051 }
00052 #endif
00053 
00054 #ifdef LOG4TANGO_CTIME_NOT_IN_STD
00055 #include <ctime>
00056 namespace std {
00057   static inline size_t strftime(char *strDest, size_t maxsize, const char *format, const struct tm *timeptr ) {
00058     return ::strftime(strDest,maxsize,format,timeptr);
00059   }
00060   static inline struct tm *localtime( const time_t *timer ) { return ::localtime(timer); }
00061   }
00062 #endif
00063 
00064 #ifdef LOG4TANGO_CMATH_NOT_IN_STD
00065 #include <cmath>
00066 namespace std {
00067   static inline int abs(int i) { return ::abs(i); }
00068 }
00069 #endif
00070 
00071 #endif // _LOG4TANGO_PORTABILITYIMPL_H