From 89e2187d28416885bcb0be12ba87309cbad1188a Mon Sep 17 00:00:00 2001 From: KuraZuzu Date: Fri, 22 Nov 2024 13:08:14 +0900 Subject: [PATCH] Fix Indent and replace .h with .hpp --- .../camera_line_follower_component.hpp | 2 +- .../direction_controller_component.hpp | 2 +- .../line_follower_component.hpp | 2 +- .../object_tracking_component.hpp | 2 +- .../visibility_control.h | 57 ------------------ .../visibility_control.hpp | 58 +++++++++++++++++++ 6 files changed, 62 insertions(+), 61 deletions(-) delete mode 100644 include/raspimouse_ros2_examples/visibility_control.h create mode 100644 include/raspimouse_ros2_examples/visibility_control.hpp diff --git a/include/raspimouse_ros2_examples/camera_line_follower_component.hpp b/include/raspimouse_ros2_examples/camera_line_follower_component.hpp index 73ee262..5dbcf0a 100644 --- a/include/raspimouse_ros2_examples/camera_line_follower_component.hpp +++ b/include/raspimouse_ros2_examples/camera_line_follower_component.hpp @@ -19,7 +19,7 @@ #include #include "raspimouse_msgs/msg/switches.hpp" -#include "raspimouse_ros2_examples/visibility_control.h" +#include "raspimouse_ros2_examples/visibility_control.hpp" #include "rclcpp/rclcpp.hpp" #include "rclcpp_lifecycle/lifecycle_node.hpp" #include "rclcpp_lifecycle/lifecycle_publisher.hpp" diff --git a/include/raspimouse_ros2_examples/direction_controller_component.hpp b/include/raspimouse_ros2_examples/direction_controller_component.hpp index 0ab164a..d6cd802 100644 --- a/include/raspimouse_ros2_examples/direction_controller_component.hpp +++ b/include/raspimouse_ros2_examples/direction_controller_component.hpp @@ -19,7 +19,7 @@ #include #include -#include "raspimouse_ros2_examples/visibility_control.h" +#include "raspimouse_ros2_examples/visibility_control.hpp" #include "raspimouse_msgs/msg/switches.hpp" #include "rclcpp/rclcpp.hpp" #include "sensor_msgs/msg/imu.hpp" diff --git a/include/raspimouse_ros2_examples/line_follower_component.hpp b/include/raspimouse_ros2_examples/line_follower_component.hpp index c8a5522..56b03e3 100644 --- a/include/raspimouse_ros2_examples/line_follower_component.hpp +++ b/include/raspimouse_ros2_examples/line_follower_component.hpp @@ -19,7 +19,7 @@ #include #include -#include "raspimouse_ros2_examples/visibility_control.h" +#include "raspimouse_ros2_examples/visibility_control.hpp" #include "raspimouse_msgs/msg/switches.hpp" #include "raspimouse_msgs/msg/light_sensors.hpp" #include "raspimouse_msgs/msg/leds.hpp" diff --git a/include/raspimouse_ros2_examples/object_tracking_component.hpp b/include/raspimouse_ros2_examples/object_tracking_component.hpp index d49c408..8a3a052 100644 --- a/include/raspimouse_ros2_examples/object_tracking_component.hpp +++ b/include/raspimouse_ros2_examples/object_tracking_component.hpp @@ -18,7 +18,7 @@ #include #include -#include "raspimouse_ros2_examples/visibility_control.h" +#include "raspimouse_ros2_examples/visibility_control.hpp" #include "rclcpp/rclcpp.hpp" #include "rclcpp_lifecycle/lifecycle_node.hpp" #include "rclcpp_lifecycle/lifecycle_publisher.hpp" diff --git a/include/raspimouse_ros2_examples/visibility_control.h b/include/raspimouse_ros2_examples/visibility_control.h deleted file mode 100644 index 3da7bdf..0000000 --- a/include/raspimouse_ros2_examples/visibility_control.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020-2024 RT Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef RASPIMOUSE_ROS2_EXAMPLES__VISIBILITY_CONTROL_H_ -#define RASPIMOUSE_ROS2_EXAMPLES__VISIBILITY_CONTROL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -// This logic was borrowed (then namespaced) from the examples on the gcc wiki: -// https://gcc.gnu.org/wiki/Visibility - -#if defined _WIN32 || defined __CYGWIN__ -#ifdef __GNUC__ -#define RASPIMOUSE_ROS2_EXAMPLES_EXPORT __attribute__((dllexport)) -#define RASPIMOUSE_ROS2_EXAMPLES_IMPORT __attribute__((dllimport)) -#else -#define RASPIMOUSE_ROS2_EXAMPLES_EXPORT __declspec(dllexport) -#define RASPIMOUSE_ROS2_EXAMPLES_IMPORT __declspec(dllimport) -#endif -#ifdef RASPIMOUSE_ROS2_EXAMPLES_BUILDING_DLL -#define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC RASPIMOUSE_ROS2_EXAMPLES_EXPORT -#else -#define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC RASPIMOUSE_ROS2_EXAMPLES_IMPORT -#endif -#define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC_TYPE RASPIMOUSE_ROS2_EXAMPLES_PUBLIC -#define RASPIMOUSE_ROS2_EXAMPLES_LOCAL -#else -#define RASPIMOUSE_ROS2_EXAMPLES_EXPORT __attribute__((visibility("default"))) -#define RASPIMOUSE_ROS2_EXAMPLES_IMPORT -#if __GNUC__ >= 4 -#define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC __attribute__((visibility("default"))) -#define RASPIMOUSE_ROS2_EXAMPLES_LOCAL __attribute__((visibility("hidden"))) -#else -#define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC -#define RASPIMOUSE_ROS2_EXAMPLES_LOCAL -#endif -#define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC_TYPE -#endif - -#ifdef __cplusplus -} -#endif - -#endif // RASPIMOUSE_ROS2_EXAMPLES__VISIBILITY_CONTROL_H_ diff --git a/include/raspimouse_ros2_examples/visibility_control.hpp b/include/raspimouse_ros2_examples/visibility_control.hpp new file mode 100644 index 0000000..e9df852 --- /dev/null +++ b/include/raspimouse_ros2_examples/visibility_control.hpp @@ -0,0 +1,58 @@ +// Copyright 2020-2024 RT Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef RASPIMOUSE_ROS2_EXAMPLES__VISIBILITY_CONTROL_HPP_ +#define RASPIMOUSE_ROS2_EXAMPLES__VISIBILITY_CONTROL_HPP_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +// This logic was borrowed (then namespaced) from the examples on the gcc wiki: +// https://gcc.gnu.org/wiki/Visibility + +#if defined _WIN32 || defined __CYGWIN__ + #ifdef __GNUC__ + #define RASPIMOUSE_ROS2_EXAMPLES_EXPORT __attribute__ ((dllexport)) + #define RASPIMOUSE_ROS2_EXAMPLES_IMPORT __attribute__ ((dllimport)) + #else + #define RASPIMOUSE_ROS2_EXAMPLES_EXPORT __declspec(dllexport) + #define RASPIMOUSE_ROS2_EXAMPLES_IMPORT __declspec(dllimport) + #endif + #ifdef RASPIMOUSE_ROS2_EXAMPLES_BUILDING_DLL + #define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC RASPIMOUSE_ROS2_EXAMPLES_EXPORT + #else + #define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC RASPIMOUSE_ROS2_EXAMPLES_IMPORT + #endif + #define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC_TYPE RASPIMOUSE_ROS2_EXAMPLES_PUBLIC + #define RASPIMOUSE_ROS2_EXAMPLES_LOCAL +#else + #define RASPIMOUSE_ROS2_EXAMPLES_EXPORT __attribute__ ((visibility("default"))) + #define RASPIMOUSE_ROS2_EXAMPLES_IMPORT + #if __GNUC__ >= 4 + #define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC __attribute__ ((visibility("default"))) + #define RASPIMOUSE_ROS2_EXAMPLES_LOCAL __attribute__ ((visibility("hidden"))) + #else + #define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC + #define RASPIMOUSE_ROS2_EXAMPLES_LOCAL + #endif + #define RASPIMOUSE_ROS2_EXAMPLES_PUBLIC_TYPE +#endif + +#ifdef __cplusplus +} +#endif + +#endif // RASPIMOUSE_ROS2_EXAMPLES__VISIBILITY_CONTROL_HPP_