diff options
author | 2023-02-01 10:00:25 +0700 | |
---|---|---|
committer | 2023-02-01 10:00:25 +0700 | |
commit | c4830168a56953af9714907664ceee72999df70c (patch) | |
tree | 9e8c11632e1a415467ae8e2063dbe76617f62a7f | |
parent | 8518c8421555e9ad7443e4537ea02ed6d4f4c441 (diff) |
osd/tools: msvc fixes
* xinput.h depends on windows.h
* avoid use of non-standard variable-length arrays
-rw-r--r-- | src/osd/modules/input/input_xinput.h | 1 | ||||
-rw-r--r-- | src/osd/modules/render/d3d/d3dhlsl.cpp | 2 | ||||
-rw-r--r-- | src/tools/chdman.cpp | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/src/osd/modules/input/input_xinput.h b/src/osd/modules/input/input_xinput.h index c403b2a0dc4..fa36b7a2622 100644 --- a/src/osd/modules/input/input_xinput.h +++ b/src/osd/modules/input/input_xinput.h @@ -11,6 +11,7 @@ #include <memory> +#include <windows.h> #include <xinput.h> diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp index 85313f3e9ec..a1e5f7d2e01 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.cpp +++ b/src/osd/modules/render/d3d/d3dhlsl.cpp @@ -571,7 +571,7 @@ void shaders::begin_frame(render_primitive_list *primlist) std::fill(std::begin(target_to_screen), std::end(target_to_screen), 0); std::fill(std::begin(targets_per_screen), std::end(targets_per_screen), 0); - render_container *containers[std::size(target_to_screen)]; + render_container *containers[sizeof(target_to_screen)/sizeof(*target_to_screen)]; // Maximum potential runtime O(max_num_targets^2) num_targets = 0; diff --git a/src/tools/chdman.cpp b/src/tools/chdman.cpp index e24d5a58588..45438bc1f82 100644 --- a/src/tools/chdman.cpp +++ b/src/tools/chdman.cpp @@ -518,7 +518,7 @@ public: // loop over channels and read the samples int channels = unsigned((std::min<std::size_t>)(m_info.channels, std::size(m_audio))); - int16_t *samplesptr[std::size(m_audio)]; + int16_t *samplesptr[sizeof(m_audio)/sizeof(*m_audio)]; for (int chnum = 0; chnum < channels; chnum++) { // read the sound samples |