log4cpp 1.1.6
Loading...
Searching...
No Matches
Portability.hh
Go to the documentation of this file.
1/*
2 * Portability.hh
3 *
4 * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5 * Copyright 2001, Bastiaan Bakker. All rights reserved.
6 *
7 * See the COPYING file for the terms of usage and distribution.
8 */
9
10#ifndef _LOG4CPP_PORTABILITY_HH
11#define _LOG4CPP_PORTABILITY_HH
12
13// <log4cpp/config.h> is auto-generated by autotools or CMake during build.
14// All other <log4cpp/config-*.h> are legacy manually edited copies and are kept for backward compatibility.
15#if defined(_MSC_VER) || defined(__BORLANDC__)
16#if defined(LOG4CPP_STLPORT_AND_BOOST_BUILD)
17#include <log4cpp/config-win32-stlport-boost.h>
18#else
19#include <log4cpp/config-win32.h>
20#endif
21
22#ifdef MSVC_MEMORY_LEAK_CHECK
23#define _CRTDBG_MAP_ALLOC
24
25#include <crtdbg.h>
26#include <stdlib.h>
27
28#ifdef _DEBUG
29#ifndef DBG_NEW
30#define DBG_NEW new (_NORMAL_BLOCK, __FILE__, __LINE__)
31#define new DBG_NEW
32#endif
33#endif // _DEBUG
34#endif // MSVC_MEMORY_LEAK_CHECK
35
36#else
37#if defined(__OPENVMS__)
38#include <log4cpp/config-openvms.h>
39#else
40#if defined(__MINGW32__)
41#include <log4cpp/config-MinGW32.h>
42#else
43#include <log4cpp/config.h>
44#endif
45#endif
46#endif
47
48#include <log4cpp/Export.hh>
49
50#if defined(_MSC_VER)
51#pragma warning(disable : 4786) // 255 char debug symbol limit
52#pragma warning(disable : 4290) // throw specifier not implemented
53#pragma warning(disable : 4251) // "class XXX should be exported"
54#endif
55
56#ifdef __APPLE__
57#include <sstream>
58#else
59#ifndef LOG4CPP_HAVE_SSTREAM
60#include <strstream>
61namespace std {
62 class LOG4CPP_EXPORT ostringstream : public ostrstream {
63 public:
64 std::string str();
65 };
66}; // namespace std
67#endif // LOG4CPP_HAVE_SSTREAM
68#endif // _APPLE_
69
70// Support both modern and deprecated compilers, supplying different c++language constructs via macros
71#if defined(__cplusplus) && (__cplusplus >= 201103L)
72#define LOG4CPP_UNIQUE_PTR unique_ptr
73#define LOG4CPP_UNIQUE_PTR_MOVE(ptr) std::move(ptr)
74#else
75#define LOG4CPP_UNIQUE_PTR auto_ptr
76#define LOG4CPP_UNIQUE_PTR_MOVE(ptr) ptr
77#endif //__cplusplus
78
79#if defined(__cplusplus) && (__cplusplus >= 201703L)
80#define LOG4CPP_NOTHROW noexcept
81#else
82#define LOG4CPP_NOTHROW throw()
83#endif //__cplusplus
84
85#endif //_LOG4CPP_PORTABILITY_HH
#define LOG4CPP_EXPORT
Definition Export.hh:26
Definition Portability.hh:62
std::string str()
Definition PortabilityImpl.cpp:19
Definition Portability.hh:61