mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Move entirety of llvm namespace to wpi namespace.
During shared library loading, a different libLLVM can be pulled in, causing llvm symbols from dependent libraries to resolve to that library instead of this one. This has been seen in the wild with the Mesa OpenGL implementation in JavaFX applications (see wpilibsuite/shuffleboard#361). This is clearly a very breaking change. For some level of backwards compatibility, a namespace alias from llvm to wpi is performed in the "llvm" headers. Unfortunately, forward declarations of llvm classes will still break, but compilers seem to generate clear error messages in those cases ("namespace alias 'llvm' not allowed here, assuming 'wpi'"). This change also moves all the wpiutil headers to a single "wpi" subdirectory from the previously split "llvm", "support", "tcpsockets", and "udpsockets". Shim headers will be added for backwards compatibility in a later commit.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <llvm/raw_ostream.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "Drive/RobotDriveBase.h"
|
||||
|
||||
@@ -116,7 +116,7 @@ class DifferentialDrive : public RobotDriveBase {
|
||||
void SetQuickStopAlpha(double alpha);
|
||||
|
||||
void StopMotor() override;
|
||||
void GetDescription(llvm::raw_ostream& desc) const override;
|
||||
void GetDescription(wpi::raw_ostream& desc) const override;
|
||||
|
||||
void InitSendable(SendableBuilder& builder) override;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <llvm/raw_ostream.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "Drive/RobotDriveBase.h"
|
||||
#include "Drive/Vector2d.h"
|
||||
@@ -65,7 +65,7 @@ class KilloughDrive : public RobotDriveBase {
|
||||
void DrivePolar(double magnitude, double angle, double zRotation);
|
||||
|
||||
void StopMotor() override;
|
||||
void GetDescription(llvm::raw_ostream& desc) const override;
|
||||
void GetDescription(wpi::raw_ostream& desc) const override;
|
||||
|
||||
void InitSendable(SendableBuilder& builder) override;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <llvm/raw_ostream.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "Drive/RobotDriveBase.h"
|
||||
|
||||
@@ -77,7 +77,7 @@ class MecanumDrive : public RobotDriveBase {
|
||||
void DrivePolar(double magnitude, double angle, double rotation);
|
||||
|
||||
void StopMotor() override;
|
||||
void GetDescription(llvm::raw_ostream& desc) const override;
|
||||
void GetDescription(wpi::raw_ostream& desc) const override;
|
||||
|
||||
void InitSendable(SendableBuilder& builder) override;
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <llvm/ArrayRef.h>
|
||||
#include <llvm/raw_ostream.h>
|
||||
#include <wpi/ArrayRef.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "MotorSafety.h"
|
||||
#include "MotorSafetyHelper.h"
|
||||
@@ -53,12 +53,12 @@ class RobotDriveBase : public MotorSafety, public SendableBase {
|
||||
void StopMotor() override = 0;
|
||||
bool IsSafetyEnabled() const override;
|
||||
void SetSafetyEnabled(bool enabled) override;
|
||||
void GetDescription(llvm::raw_ostream& desc) const override = 0;
|
||||
void GetDescription(wpi::raw_ostream& desc) const override = 0;
|
||||
|
||||
protected:
|
||||
double Limit(double number);
|
||||
double ApplyDeadband(double number, double deadband);
|
||||
void Normalize(llvm::MutableArrayRef<double> wheelSpeeds);
|
||||
void Normalize(wpi::MutableArrayRef<double> wheelSpeeds);
|
||||
|
||||
double m_deadband = 0.02;
|
||||
double m_maxOutput = 1.0;
|
||||
|
||||
Reference in New Issue
Block a user