/* * Copyright © Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef MIR_FRONTEND_WAYLAND_TIMESPEC_H #define MIR_FRONTEND_WAYLAND_TIMESPEC_H #include namespace mir { namespace frontend { struct WaylandTimespec { WaylandTimespec(time::Timestamp time) : tv_sec_hi{static_cast(static_cast(std::chrono::duration_cast( time.time_since_epoch()).count()) >> 32)}, tv_sec_lo{static_cast(std::chrono::duration_cast( time.time_since_epoch()).count())}, tv_nsec{static_cast(std::chrono::duration_cast( time.time_since_epoch()).count() % 1000000000)} { } uint32_t tv_sec_hi, tv_sec_lo, tv_nsec; }; } } #endif // MIR_FRONTEND_WAYLAND_TIMESPEC_H