eris 1.4.0
A WorldForge client library.
iround.h
1// This file may be redistributed and modified only under the terms of
2// the GNU General Public License (See COPYING for details).
3// Copyright (C) 2003 Alistair Riddoch
4
5#ifndef ERIS_IROUND_H
6#define ERIS_IROUND_H
7
8// std::lround is missing on Android: https://code.google.com/p/android/issues/detail?id=54418
9#ifdef __ANDROID__
10#include <cmath>
11#define I_ROUND(_x) (lroundf(_x))
12#define L_ROUND(_x) (llround(_x))
13#else
14#include <cmath>
15#define I_ROUND(_x) (std::lround(_x))
16#define L_ROUND(_x) (std::llround(_x))
17#endif
18
19#endif // ERIS_IROUND_H