mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
artf4106: ISO C++ forbids variable-size array
C++14 changed the definition of VLAs, so the previous usage was no longer valid ISO C++. GCC 5.1.0 actually enforces this definition, so this commit fixes the build under GCC 5.1.0. This also builds under GCC 4.9.1. Change-Id: Ib5ae2c49b4c4c21455b722b6633d7841066b4872
This commit is contained in:
committed by
Tyler Veness (3512)
parent
b5695581c3
commit
f96b61ef11
@@ -5,6 +5,7 @@
|
||||
#include <regex>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
@@ -130,8 +131,8 @@ void USBCamera::UpdateSettings() {
|
||||
uInt32 count = 0;
|
||||
uInt32 currentMode = 0;
|
||||
SAFE_IMAQ_CALL(IMAQdxEnumerateVideoModes, m_id, nullptr, &count, ¤tMode);
|
||||
IMAQdxVideoMode modes[count];
|
||||
SAFE_IMAQ_CALL(IMAQdxEnumerateVideoModes, m_id, modes, &count, ¤tMode);
|
||||
auto modes = std::make_unique<IMAQdxVideoMode[]>(count);
|
||||
SAFE_IMAQ_CALL(IMAQdxEnumerateVideoModes, m_id, modes.get(), &count, ¤tMode);
|
||||
|
||||
// Groups are:
|
||||
// 0 - width
|
||||
|
||||
Reference in New Issue
Block a user