Skip to content

Commit 72b7ba9

Browse files
committed
Fix Windows build failures
1 parent 28efd52 commit 72b7ba9

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/Assert.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
# include <immintrin.h>
88
#endif
99

10+
#ifdef BUNGEE_PETRIFY
11+
# include <unistd.h>
12+
#endif
13+
14+
#include <array>
1015
#include <csignal>
1116
#include <cstdio>
1217
#include <cstdlib>
13-
#include <unistd.h>
14-
#include <array>
1518

1619
namespace Bungee::Assert {
1720

src/Resample.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,17 @@ struct RatioState<true>
154154
}
155155
};
156156

157+
#if defined(_MSC_VER)
158+
# define BUNGEE_NOINLINE __declspec(noinline)
159+
#else
160+
# define BUNGEE_NOINLINE __attribute__((noinline))
161+
#endif
162+
157163
template <class Interpolation, class Mode>
158164
struct Loop
159165
{
160166
template <bool ratioIsConstant>
161-
static __attribute__((noinline)) void run(RatioState<ratioIsConstant> &ratioState, Internal &internal, External external) // const & ext
167+
static BUNGEE_NOINLINE void run(RatioState<ratioIsConstant> &ratioState, Internal &internal, External external) // const & ext
162168
{
163169
const Assert::FloatingPointExceptions floatingPointExceptions(FE_INEXACT | FE_UNDERFLOW);
164170

0 commit comments

Comments
 (0)