1 /* 2 * Copyright (C) 2019 Codership Oy <info@codership.com> 3 * 4 * This file is part of wsrep-lib. 5 * 6 * Wsrep-lib is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * Wsrep-lib 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 wsrep-lib. If not, see <https://www.gnu.org/licenses/>. 18 */ 19 20 /** @file chrono.hpp 21 * 22 * Type definitions to work around GCC 4.4 incompatibilities with 23 * C++11 chrono. 24 */ 25 26 #ifndef WSREP_CHRONO_HPP 27 #define WSREP_CHRONO_HPP 28 29 #include <chrono> 30 31 namespace wsrep 32 { 33 /* wsrep::clock - clock type compatible with std::chrono::steady_clock. */ 34 #if defined(__GNUG__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4) 35 typedef std::chrono::monotonic_clock clock; 36 #else 37 using clock = std::chrono::steady_clock; 38 #endif // defined(__GNUG__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4) 39 40 } 41 42 #endif // WSREP_CHRONO_HPP 43