[wpiutil] Check MSVC Runtime (#7301)

This commit is contained in:
Thad House
2024-11-05 08:51:48 -08:00
committed by GitHub
parent 63e623d70b
commit f2d2500d1d
9 changed files with 202 additions and 2 deletions

View File

@@ -397,6 +397,9 @@ public abstract class RobotBase implements AutoCloseable {
* @param robotSupplier Function that returns an instance of the robot subclass.
*/
public static <T extends RobotBase> void startRobot(Supplier<T> robotSupplier) {
// Check that the MSVC runtime is valid.
WPIUtilJNI.checkMsvcRuntime();
if (!HAL.initialize(500, 0)) {
throw new IllegalStateException("Failed to initialize. Terminating");
}