Verified Commit c7b63a76 authored by Ralph Giles's avatar Ralph Giles
Browse files

Set _USE_MATH_DEFINES for MSVC builds.

Add this define to lib/os.h and test/util.c so M_PI is available
when building with Microsoft's math.h. On other systems, it's
typically enabled by default, e.g. through __USE_XOPEN or __USE_GNU.

We already had a fallback definition of M_PI in os.h which was
used by the core library, but not included in the test harness,
which failed to compile under CMake and MSVC.

Using the system define should be more consistent.

Based on a patch by Ozkan Sezer.
parent 4e1155cc
Pipeline #2455 passed with stage
in 1 minute and 42 seconds
......@@ -20,6 +20,10 @@
#include "config.h"
#endif
#ifdef _MSC_VER
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#include <ogg/os_types.h>
......
......@@ -14,6 +14,10 @@
********************************************************************/
#ifdef _MSC_VER
#define _USE_MATH_DEFINES
#endif
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment