mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-23 23:21:46 +00:00
029fa2496e
Also try to avoid redefinition warnings from MSVC.
38 lines
737 B
C
38 lines
737 B
C
// Copyright 2020, Collabora, Ltd.
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
/*!
|
|
* @file
|
|
* @brief Wrapper header for <math.h> to ensure pi-related math constants are
|
|
* defined.
|
|
*
|
|
* Use this instead of directly including <math.H> in headers and when
|
|
* you need M_PI and its friends.
|
|
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
|
|
*
|
|
* @ingroup aux_math
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#define _USE_MATH_DEFINES // for M_PI // NOLINT
|
|
#ifdef __cplusplus
|
|
#include <cmath>
|
|
#endif
|
|
|
|
#include <math.h>
|
|
|
|
|
|
// Might be missing on Windows.
|
|
#ifndef M_PI
|
|
#define M_PI (3.14159265358979323846)
|
|
#endif
|
|
|
|
// Might be missing on Windows.
|
|
#ifndef M_PIl
|
|
#define M_PIl (3.14159265358979323846264338327950288)
|
|
#endif
|
|
|
|
#ifndef M_1_PI
|
|
#define M_1_PI (1. / M_PI)
|
|
#endif
|