Using math defines requires switch in MSVC (#1665)

* Using math defines requires switch in MSVC

* Fix more math macros

* Fix type

* Remove _MSC_VER guard for math defines
This commit is contained in:
Cheng 2024-12-09 01:16:28 +09:00 committed by GitHub
parent 6f316b8bf5
commit d0f471cff7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 0 deletions

View File

@ -1,4 +1,8 @@
// Copyright © 2023-2024 Apple Inc.
// Required for using M_PI in MSVC.
#define _USE_MATH_DEFINES
#include <algorithm>
#include <climits>
#include <cmath>

View File

@ -1,4 +1,8 @@
// Copyright © 2023-2024 Apple Inc.
// Required for using M_2_SQRTPI in MSVC.
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cassert>
#include <cmath>

View File

@ -1,5 +1,8 @@
// Copyright © 2023 Apple Inc.
// Required for using M_2_SQRTPI in MSVC.
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <numeric>

View File

@ -1,5 +1,8 @@
// Copyright © 2023-2024 Apple Inc.
// Required for using M_SQRT2 in MSVC.
#define _USE_MATH_DEFINES
#include "doctest/doctest.h"
#include "mlx/mlx.h"

View File

@ -1,4 +1,8 @@
// Copyright © 2023-2024 Apple Inc.
// Required for using M_PI_2 in MSVC.
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>