0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Compat.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 3
9  * of the License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
28 #ifndef HYPERTABLE_COMPAT_H
29 #define HYPERTABLE_COMPAT_H
30 
35 // The same stuff for C code
36 #include "compat-c.h"
37 
38 #include <cstddef> // for std::size_t and std::ptrdiff_t
39 #include <memory>
40 
41 // C++ specific stuff
42 #ifndef BOOST_SPIRIT_THREADSAFE
43 # define BOOST_SPIRIT_THREADSAFE
44 #endif
45 
46 #define BOOST_IOSTREAMS_USE_DEPRECATED
47 #define BOOST_FILESYSTEM_VERSION 3
48 #define BOOST_FILESYSTEM_DEPRECATED 1
49 
50 #define HT_UNUSED(x) static_cast<void>(x)
51 
52 template<typename T, typename... Ts>
53 std::unique_ptr<T> make_unique(Ts&&... params) {
54  return std::unique_ptr<T>(new T(std::forward<Ts>(params)...));
55 }
56 
57 #if defined(__APPLE__) || !defined(_GLIBCXX_HAVE_QUICK_EXIT)
58 namespace std {
59  inline void quick_exit(int status) { _exit(status); }
60 }
61 #endif
62 
65 #endif // HYPERTABLE_COMPAT_H
STL namespace.
bool status(ContextPtr &context, Timer &timer, Status &status)
Runs a status check on the master.
Definition: Utility.cc:408
std::unique_ptr< T > make_unique(Ts &&...params)
Definition: Compat.h:53
Required portability definitions for all .cc files.