diff options
author | Tyler Veness | 2015-07-20 21:03:42 -0700 |
---|---|---|
committer | Tyler Veness | 2015-07-20 21:03:42 -0700 |
commit | 89599e688d4e163de7242b554a4af50c9534fcdd (patch) | |
tree | 723e7182cf5265541652c6e689efa4df5a70fe70 | |
parent | 14840c1505c2a0d9bdcaee2e754e9e9d3b751bb5 (diff) | |
download | aur-89599e688d4e163de7242b554a4af50c9534fcdd.tar.gz |
Added upstream patch to fix compilation errors when CANTalon is used
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | 0001-Fix-std-unique_ptrs-using-incomplete-types.patch | 96 | ||||
-rw-r--r-- | PKGBUILD | 7 |
3 files changed, 105 insertions, 4 deletions
@@ -1,6 +1,6 @@ pkgbase = arm-frc-linux-gnueabi-wpilib-git pkgdesc = The WPI FIRST Robotics Competition C/C++ library for the arm-frc-linux-gnueabi toolchain - pkgver = 935.87e1df0 + pkgver = 1081.eb7d55f pkgrel = 1 url = https://usfirst.collab.net/sf/projects/wpilib/ arch = i686 @@ -16,8 +16,10 @@ pkgbase = arm-frc-linux-gnueabi-wpilib-git options = staticlibs source = git+https://usfirst.collab.net/gerrit/allwpilib source = 0001-artf4155-Move-Port.h-from-hal-lib-Athena-to-hal-incl.patch + source = 0001-Fix-std-unique_ptrs-using-incomplete-types.patch sha512sums = SKIP - sha512sums = 18a6e1f492b28eaa913b7aebe168ce349824092c3ce6792fad569ea5604a8382bb69e2a0a17732291f8f5bd25270bff19890f5af8b918d55025d3730dd76590a + sha512sums = 3dbf006ccf7c96a58c6b5a0ad446b40d60b6cc1962b876c7cbc0ed041f34a4f17dc3848bfff183ee9258466103940e80935ccfdc3f6d0da762c01f0be023e338 + sha512sums = b83b9bd1d19efc17a961ae0b73f91cb5e48506f25a5f51bdea53827676fbbebdc45f24223b97633cf6d34d6bad8434f52e40326dc316c47335e05ec01218ca27 pkgname = arm-frc-linux-gnueabi-wpilib-git diff --git a/0001-Fix-std-unique_ptrs-using-incomplete-types.patch b/0001-Fix-std-unique_ptrs-using-incomplete-types.patch new file mode 100644 index 000000000000..683f6916a809 --- /dev/null +++ b/0001-Fix-std-unique_ptrs-using-incomplete-types.patch @@ -0,0 +1,96 @@ +From 881dcd08e5015761eb4168df6a8c05798901aa28 Mon Sep 17 00:00:00 2001 +From: Tyler Veness <calcmogul@gmail.com> +Date: Mon, 20 Jul 2015 19:58:13 -0700 +Subject: [PATCH] Fix std::unique_ptrs using incomplete types + +CANTalon declared a std::unique_ptr<CanTalonSRX> with CanTalonSRX as an incomplete type. This causes a compilation error in code using CANTalons. The CANTalonTest didn't catch this because it included ctre/CanTalonSRX.h as well as CANTalon.h. Normal user code doesn't do that. + +I reviewed uses of std::unique_ptr elsewhere and determined that PIDCommand may suffer from the same problem. There is no test for PIDCommand to prove otherwise. + +Change-Id: I54caf4941927910471ffb7170eb6737ba0e08437 +--- + wpilibc/wpilibC++/include/Commands/PIDCommand.h | 3 +-- + wpilibc/wpilibC++/src/Commands/PIDCommand.cpp | 1 - + wpilibc/wpilibC++Devices/include/CANTalon.h | 3 +-- + wpilibc/wpilibC++Devices/src/CANTalon.cpp | 1 - + wpilibc/wpilibC++IntegrationTests/src/CANTalonTest.cpp | 1 - + 5 files changed, 2 insertions(+), 7 deletions(-) + +diff --git a/wpilibc/wpilibC++/include/Commands/PIDCommand.h b/wpilibc/wpilibC++/include/Commands/PIDCommand.h +index 216818f..20443f4 100644 +--- a/wpilibc/wpilibC++/include/Commands/PIDCommand.h ++++ b/wpilibc/wpilibC++/include/Commands/PIDCommand.h +@@ -9,13 +9,12 @@ + #define __PID_COMMAND_H__ + + #include "Commands/Command.h" ++#include "PIDController.h" + #include "PIDSource.h" + #include "PIDOutput.h" + + #include <memory> + +-class PIDController; +- + class PIDCommand : public Command, public PIDOutput, public PIDSource { + public: + PIDCommand(const std::string &name, double p, double i, double d); +diff --git a/wpilibc/wpilibC++/src/Commands/PIDCommand.cpp b/wpilibc/wpilibC++/src/Commands/PIDCommand.cpp +index e508e36..52a568a 100644 +--- a/wpilibc/wpilibC++/src/Commands/PIDCommand.cpp ++++ b/wpilibc/wpilibC++/src/Commands/PIDCommand.cpp +@@ -7,7 +7,6 @@ + + #include "Commands/PIDCommand.h" + +-#include "PIDController.h" + #include "float.h" + + PIDCommand::PIDCommand(const std::string &name, double p, double i, double d, double f, +diff --git a/wpilibc/wpilibC++Devices/include/CANTalon.h b/wpilibc/wpilibC++Devices/include/CANTalon.h +index a3d679a..9de185a 100644 +--- a/wpilibc/wpilibC++Devices/include/CANTalon.h ++++ b/wpilibc/wpilibC++Devices/include/CANTalon.h +@@ -10,14 +10,13 @@ + #include "PIDOutput.h" + #include "PIDSource.h" + #include "PIDInterface.h" ++#include "ctre/CanTalonSRX.h" + #include "MotorSafetyHelper.h" + #include "LiveWindow/LiveWindowSendable.h" + #include "tables/ITable.h" + + #include <memory> + +-class CanTalonSRX; +- + /** + * CTRE Talon SRX Speed Controller with CAN Control + */ +diff --git a/wpilibc/wpilibC++Devices/src/CANTalon.cpp b/wpilibc/wpilibC++Devices/src/CANTalon.cpp +index 3e2c807..8d3eff5 100644 +--- a/wpilibc/wpilibC++Devices/src/CANTalon.cpp ++++ b/wpilibc/wpilibC++Devices/src/CANTalon.cpp +@@ -6,7 +6,6 @@ + + #include "CANTalon.h" + #include "WPIErrors.h" +-#include "ctre/CanTalonSRX.h" + #include <unistd.h> // usleep + #include <sstream> + +diff --git a/wpilibc/wpilibC++IntegrationTests/src/CANTalonTest.cpp b/wpilibc/wpilibC++IntegrationTests/src/CANTalonTest.cpp +index ca2c148..03f7ad9 100644 +--- a/wpilibc/wpilibC++IntegrationTests/src/CANTalonTest.cpp ++++ b/wpilibc/wpilibC++IntegrationTests/src/CANTalonTest.cpp +@@ -7,7 +7,6 @@ + #include "WPILib.h" + #include "gtest/gtest.h" + #include "TestBench.h" +-#include "ctre/CanTalonSRX.h" + + const int deviceId = 0; + +-- +2.4.6 + @@ -13,9 +13,11 @@ depends=('arm-frc-linux-gnueabi-gcc') makedepends=('cmake' 'git') options=('!strip' 'libtool' 'staticlibs') source=("git+https://usfirst.collab.net/gerrit/allwpilib" - "0001-artf4155-Move-Port.h-from-hal-lib-Athena-to-hal-incl.patch") + "0001-artf4155-Move-Port.h-from-hal-lib-Athena-to-hal-incl.patch" + "0001-Fix-std-unique_ptrs-using-incomplete-types.patch") sha512sums=('SKIP' - '3dbf006ccf7c96a58c6b5a0ad446b40d60b6cc1962b876c7cbc0ed041f34a4f17dc3848bfff183ee9258466103940e80935ccfdc3f6d0da762c01f0be023e338') + '3dbf006ccf7c96a58c6b5a0ad446b40d60b6cc1962b876c7cbc0ed041f34a4f17dc3848bfff183ee9258466103940e80935ccfdc3f6d0da762c01f0be023e338' + 'b83b9bd1d19efc17a961ae0b73f91cb5e48506f25a5f51bdea53827676fbbebdc45f24223b97633cf6d34d6bad8434f52e40326dc316c47335e05ec01218ca27') pkgver() { cd allwpilib @@ -25,6 +27,7 @@ pkgver() { prepare() { cd "$srcdir/allwpilib" patch -p1 < ../0001-artf4155-Move-Port.h-from-hal-lib-Athena-to-hal-incl.patch + patch -p1 < ../0001-Fix-std-unique_ptrs-using-incomplete-types.patch } build() { |