diff --git a/3rdparty/imgui/examples/imgui_impl_win32.cpp b/3rdparty/imgui/examples/imgui_impl_win32.cpp index 6cf8d630..ca230c3b 100644 --- a/3rdparty/imgui/examples/imgui_impl_win32.cpp +++ b/3rdparty/imgui/examples/imgui_impl_win32.cpp @@ -13,6 +13,7 @@ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif +#define NOMINMAX #include #include diff --git a/3rdparty/imgui/examples/libs/gl3w/GL/gl3w.c b/3rdparty/imgui/examples/libs/gl3w/GL/gl3w.c index 464e0177..784c0969 100644 --- a/3rdparty/imgui/examples/libs/gl3w/GL/gl3w.c +++ b/3rdparty/imgui/examples/libs/gl3w/GL/gl3w.c @@ -7,6 +7,7 @@ #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN 1 +#define NOMINMAX #include static HMODULE libgl; diff --git a/3rdparty/imgui/examples/libs/gl3w/GL/glcorearb.h b/3rdparty/imgui/examples/libs/gl3w/GL/glcorearb.h index 07cb03e1..d8f6581c 100644 --- a/3rdparty/imgui/examples/libs/gl3w/GL/glcorearb.h +++ b/3rdparty/imgui/examples/libs/gl3w/GL/glcorearb.h @@ -57,6 +57,7 @@ extern "C" { #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) #define WIN32_LEAN_AND_MEAN 1 +#define NOMINMAX #include #endif diff --git a/3rdparty/imgui/examples/libs/glfw/include/GLFW/glfw3native.h b/3rdparty/imgui/examples/libs/glfw/include/GLFW/glfw3native.h index 9fa955e9..bc35dde0 100644 --- a/3rdparty/imgui/examples/libs/glfw/include/GLFW/glfw3native.h +++ b/3rdparty/imgui/examples/libs/glfw/include/GLFW/glfw3native.h @@ -85,7 +85,8 @@ extern "C" { // example to allow applications to correctly declare a GL_ARB_debug_output // callback) but windows.h assumes no one will define APIENTRY before it does #undef APIENTRY - #include + #define NOMINMAX +#include #elif defined(GLFW_EXPOSE_NATIVE_COCOA) #include #if defined(__OBJC__) diff --git a/3rdparty/imgui/imgui.cpp b/3rdparty/imgui/imgui.cpp index 26359924..04237f81 100644 --- a/3rdparty/imgui/imgui.cpp +++ b/3rdparty/imgui/imgui.cpp @@ -8723,8 +8723,10 @@ static void SettingsHandlerWindow_WriteAll(ImGuiContext* imgui_ctx, ImGuiSetting #define WIN32_LEAN_AND_MEAN #endif #ifndef __MINGW32__ -#include +#define NOMINMAX +#include #else +#define NOMINMAX #include #endif #endif diff --git a/3rdparty/oourafft/fftsg.cc b/3rdparty/oourafft/fftsg.cc index d74fbb15..8ee2e187 100644 --- a/3rdparty/oourafft/fftsg.cc +++ b/3rdparty/oourafft/fftsg.cc @@ -321,11 +321,41 @@ Appendix : NEXTPNR_NAMESPACE_BEGIN +void makewt(int nw, int* ip, float* w); +void cftfsub(int n, float* a, int* ip, int nw, float* w); +void cftbsub(int n, float* a, int* ip, int nw, float* w); +void makect(int nc, int* ip, float* c); +void rftfsub(int n, float* a, int nc, float* c); +void rftbsub(int n, float* a, int nc, float* c); +void dctsub(int n, float* a, int nc, float* c); +void dstsub(int n, float* a, int nc, float* c); +void bitrv2(int n, int* ip, float* a); +void bitrv216(float* a); +void bitrv208(float* a); +void cftf1st(int n, float* a, float* w); +void cftrec4(int n, float* a, int nw, float* w); +void cftleaf(int n, int isplt, float* a, int nw, float* w); +void cftfx41(int n, float* a, int nw, float* w); +void cftf161(float* a, float* w); +void cftf081(float* a, float* w); +void cftf040(float* a); +void cftx020(float* a); +void bitrv2conj(int n, int* ip, float* a); +void bitrv216neg(float* a); +void bitrv208neg(float* a); +void cftb1st(int n, float* a, float* w); +void cftb040(float* a); +void makeipt(int nw, int* ip); +void cftf162(float* a, float* w); +void cftf082(float* a, float* w); +void cftmdl1(int n, float* a, float* w); +void cftmdl2(int n, float* a, float* w); +int cfttree(int n, int j, int k, float* a, int nw, float* w); +void* cftrec1_th(void* p); +void* cftrec2_th(void* p); + void cdft(int n, int isgn, float* a, int* ip, float* w) { - void makewt(int nw, int* ip, float* w); - void cftfsub(int n, float* a, int* ip, int nw, float* w); - void cftbsub(int n, float* a, int* ip, int nw, float* w); int nw; nw = ip[0]; @@ -342,12 +372,6 @@ void cdft(int n, int isgn, float* a, int* ip, float* w) void rdft(int n, int isgn, float* a, int* ip, float* w) { - void makewt(int nw, int* ip, float* w); - void makect(int nc, int* ip, float* c); - void cftfsub(int n, float* a, int* ip, int nw, float* w); - void cftbsub(int n, float* a, int* ip, int nw, float* w); - void rftfsub(int n, float* a, int nc, float* c); - void rftbsub(int n, float* a, int nc, float* c); int nw, nc; float xi; @@ -385,13 +409,6 @@ void rdft(int n, int isgn, float* a, int* ip, float* w) void ddct(int n, int isgn, float* a, int* ip, float* w) { - void makewt(int nw, int* ip, float* w); - void makect(int nc, int* ip, float* c); - void cftfsub(int n, float* a, int* ip, int nw, float* w); - void cftbsub(int n, float* a, int* ip, int nw, float* w); - void rftfsub(int n, float* a, int nc, float* c); - void rftbsub(int n, float* a, int nc, float* c); - void dctsub(int n, float* a, int nc, float* c); int j, nw, nc; float xr; @@ -441,13 +458,6 @@ void ddct(int n, int isgn, float* a, int* ip, float* w) void ddst(int n, int isgn, float* a, int* ip, float* w) { - void makewt(int nw, int* ip, float* w); - void makect(int nc, int* ip, float* c); - void cftfsub(int n, float* a, int* ip, int nw, float* w); - void cftbsub(int n, float* a, int* ip, int nw, float* w); - void rftfsub(int n, float* a, int nc, float* c); - void rftbsub(int n, float* a, int nc, float* c); - void dstsub(int n, float* a, int nc, float* c); int j, nw, nc; float xr; @@ -496,11 +506,6 @@ void ddst(int n, int isgn, float* a, int* ip, float* w) void dfct(int n, float* a, float* t, int* ip, float* w) { - void makewt(int nw, int* ip, float* w); - void makect(int nc, int* ip, float* c); - void cftfsub(int n, float* a, int* ip, int nw, float* w); - void rftfsub(int n, float* a, int nc, float* c); - void dctsub(int n, float* a, int nc, float* c); int j, k, l, m, mh, nw, nc; float xr, xi, yr, yi; @@ -588,11 +593,6 @@ void dfct(int n, float* a, float* t, int* ip, float* w) void dfst(int n, float* a, float* t, int* ip, float* w) { - void makewt(int nw, int* ip, float* w); - void makect(int nc, int* ip, float* c); - void cftfsub(int n, float* a, int* ip, int nw, float* w); - void rftfsub(int n, float* a, int nc, float* c); - void dstsub(int n, float* a, int nc, float* c); int j, k, l, m, mh, nw, nc; float xr, xi, yr, yi; @@ -673,7 +673,6 @@ void dfst(int n, float* a, float* t, int* ip, float* w) void makewt(int nw, int* ip, float* w) { - void makeipt(int nw, int* ip); int j, nwh, nw0, nw1; float delta, wn4r, wk1r, wk1i, wk3r, wk3i; @@ -808,6 +807,7 @@ void makect(int nc, int* ip, float* c) #endif #include #include +#define NOMINMAX #include #define cdft_thread_t HANDLE #define cdft_thread_create(thp, func, argp) \ @@ -829,17 +829,6 @@ void makect(int nc, int* ip, float* c) void cftfsub(int n, float* a, int* ip, int nw, float* w) { - void bitrv2(int n, int* ip, float* a); - void bitrv216(float* a); - void bitrv208(float* a); - void cftf1st(int n, float* a, float* w); - void cftrec4(int n, float* a, int nw, float* w); - void cftleaf(int n, int isplt, float* a, int nw, float* w); - void cftfx41(int n, float* a, int nw, float* w); - void cftf161(float* a, float* w); - void cftf081(float* a, float* w); - void cftf040(float* a); - void cftx020(float* a); #ifdef USE_CDFT_THREADS void cftrec4_th(int n, float* a, int nw, float* w); #endif /* USE_CDFT_THREADS */ @@ -876,17 +865,6 @@ void cftfsub(int n, float* a, int* ip, int nw, float* w) void cftbsub(int n, float* a, int* ip, int nw, float* w) { - void bitrv2conj(int n, int* ip, float* a); - void bitrv216neg(float* a); - void bitrv208neg(float* a); - void cftb1st(int n, float* a, float* w); - void cftrec4(int n, float* a, int nw, float* w); - void cftleaf(int n, int isplt, float* a, int nw, float* w); - void cftfx41(int n, float* a, int nw, float* w); - void cftf161(float* a, float* w); - void cftf081(float* a, float* w); - void cftb040(float* a); - void cftx020(float* a); #ifdef USE_CDFT_THREADS void cftrec4_th(int n, float* a, int nw, float* w); #endif /* USE_CDFT_THREADS */ @@ -2221,8 +2199,6 @@ typedef struct cdft_arg_st cdft_arg_t; void cftrec4_th(int n, float* a, int nw, float* w) { - void* cftrec1_th(void* p); - void* cftrec2_th(void* p); int i, idiv4, m, nthread; cdft_thread_t th[4]; cdft_arg_t ag[4]; @@ -2254,9 +2230,6 @@ void cftrec4_th(int n, float* a, int nw, float* w) void* cftrec1_th(void* p) { - int cfttree(int n, int j, int k, float* a, int nw, float* w); - void cftleaf(int n, int isplt, float* a, int nw, float* w); - void cftmdl1(int n, float* a, float* w); int isplt, j, k, m, n, n0, nw; float *a, *w; @@ -2282,9 +2255,6 @@ void* cftrec1_th(void* p) void* cftrec2_th(void* p) { - int cfttree(int n, int j, int k, float* a, int nw, float* w); - void cftleaf(int n, int isplt, float* a, int nw, float* w); - void cftmdl2(int n, float* a, float* w); int isplt, j, k, m, n, n0, nw; float *a, *w; @@ -2313,9 +2283,6 @@ void* cftrec2_th(void* p) void cftrec4(int n, float* a, int nw, float* w) { - int cfttree(int n, int j, int k, float* a, int nw, float* w); - void cftleaf(int n, int isplt, float* a, int nw, float* w); - void cftmdl1(int n, float* a, float* w); int isplt, j, k, m; m = n; @@ -2334,8 +2301,6 @@ void cftrec4(int n, float* a, int nw, float* w) int cfttree(int n, int j, int k, float* a, int nw, float* w) { - void cftmdl1(int n, float* a, float* w); - void cftmdl2(int n, float* a, float* w); int i, isplt, m; if ((k & 3) != 0) { @@ -2368,12 +2333,6 @@ int cfttree(int n, int j, int k, float* a, int nw, float* w) void cftleaf(int n, int isplt, float* a, int nw, float* w) { - void cftmdl1(int n, float* a, float* w); - void cftmdl2(int n, float* a, float* w); - void cftf161(float* a, float* w); - void cftf162(float* a, float* w); - void cftf081(float* a, float* w); - void cftf082(float* a, float* w); if (n == 512) { cftmdl1(128, a, &w[nw - 64]); @@ -2674,11 +2633,6 @@ void cftmdl2(int n, float* a, float* w) void cftfx41(int n, float* a, int nw, float* w) { - void cftf161(float* a, float* w); - void cftf162(float* a, float* w); - void cftf081(float* a, float* w); - void cftf082(float* a, float* w); - if (n == 128) { cftf161(a, &w[nw - 8]); cftf162(&a[32], &w[nw - 32]); diff --git a/3rdparty/oourafft/fftsg2d.cc b/3rdparty/oourafft/fftsg2d.cc index 2bbc2428..5d674ed8 100644 --- a/3rdparty/oourafft/fftsg2d.cc +++ b/3rdparty/oourafft/fftsg2d.cc @@ -412,6 +412,7 @@ macro definitions #ifndef FFT2D_THREADS_BEGIN_N #define FFT2D_THREADS_BEGIN_N 131072 #endif +#define NOMINMAX #include #define fft2d_thread_t HANDLE #define fft2d_thread_create(thp, func, argp) \ diff --git a/3rdparty/pybind11/docs/advanced/cast/strings.rst b/3rdparty/pybind11/docs/advanced/cast/strings.rst index e246c521..806b7a25 100644 --- a/3rdparty/pybind11/docs/advanced/cast/strings.rst +++ b/3rdparty/pybind11/docs/advanced/cast/strings.rst @@ -174,7 +174,8 @@ decoded to Python ``str``. .. code-block:: c++ #define UNICODE - #include + #define NOMINMAX +#include m.def("set_window_text", [](HWND hwnd, std::wstring s) { diff --git a/common/kernel/base_arch.h b/common/kernel/base_arch.h index ff906bfd..a27e261d 100644 --- a/common/kernel/base_arch.h +++ b/common/kernel/base_arch.h @@ -24,7 +24,6 @@ #include #include -#define NOMINMAX #include "arch_api.h" #include "base_clusterinfo.h" #include "idstring.h" diff --git a/common/kernel/command.cc b/common/kernel/command.cc index 565f5fc5..087af5b3 100644 --- a/common/kernel/command.cc +++ b/common/kernel/command.cc @@ -46,8 +46,8 @@ #include "version.h" #if defined(_WIN32) -#define NOMINMAX #include +#define NOMINMAX #include #elif defined(__APPLE__) #include diff --git a/common/kernel/embed.cc b/common/kernel/embed.cc index 6beb157b..de7f545c 100644 --- a/common/kernel/embed.cc +++ b/common/kernel/embed.cc @@ -1,5 +1,6 @@ #include #if defined(WIN32) +#define NOMINMAX #include #endif #include diff --git a/gui/application.cc b/gui/application.cc index d3260684..b04d4a2f 100644 --- a/gui/application.cc +++ b/gui/application.cc @@ -34,6 +34,7 @@ NEXTPNR_NAMESPACE_BEGIN #ifdef _WIN32 +#define NOMINMAX #include BOOL WINAPI WinHandler(DWORD dwCtrlType) {