From e63c653889f0a90d1ac894eed50249017aeb7933 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 12 Aug 2024 18:01:33 +0200 Subject: [PATCH] Define _USE_MATH_DEFINES even when using mingw --- xapian-core/config.h.meson | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xapian-core/config.h.meson b/xapian-core/config.h.meson index ac3246cb34..fa2477d8e7 100644 --- a/xapian-core/config.h.meson +++ b/xapian-core/config.h.meson @@ -432,13 +432,15 @@ */ # define _WINSOCK_DEPRECATED_NO_WARNINGS -/* Tell MSVC we want M_PI, etc defined. */ -# define _USE_MATH_DEFINES - /* Tell MSVC we don't want max() and min() macros defined. */ # define NOMINMAX #endif +#if defined _MSC_VER || defined __MINGW32__ +/* Tell MSVC we want M_PI, etc defined. */ +# define _USE_MATH_DEFINES +#endif + /* Make the POSIX-like functions support large files. MSVC needs this; * current mingw32 does too; mingw64 supports _FILE_OFFSET_BITS, which * AC_SYS_LARGEFILE should discover and enable automatically.