From 322c55d25500a24e67849b0097bb637be742496f Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 25 Oct 2023 00:06:08 +0200 Subject: [PATCH 1/6] iox-#2057 Move 'iceoryx_versions.hpp' to 'hoofs' --- iceoryx_hoofs/BUILD.bazel | 9 +++++++++ iceoryx_hoofs/CMakeLists.txt | 1 + .../cmake/iceoryx_versions.hpp.in | 0 .../cmake/iceoryxversions.cmake | 4 ++-- iceoryx_posh/BUILD.bazel | 9 --------- iceoryx_posh/CMakeLists.txt | 1 - 6 files changed, 12 insertions(+), 12 deletions(-) rename {iceoryx_posh => iceoryx_hoofs}/cmake/iceoryx_versions.hpp.in (100%) rename {iceoryx_posh => iceoryx_hoofs}/cmake/iceoryxversions.cmake (87%) diff --git a/iceoryx_hoofs/BUILD.bazel b/iceoryx_hoofs/BUILD.bazel index 393ae70224..0f7c083600 100644 --- a/iceoryx_hoofs/BUILD.bazel +++ b/iceoryx_hoofs/BUILD.bazel @@ -16,6 +16,7 @@ load("@rules_cc//cc:defs.bzl", "cc_library") load("//bazel:configure_file.bzl", "configure_file") +load("//bazel:configure_version.bzl", "configure_version") configure_file( name = "iceoryx_hoofs_deployment_hpp", @@ -27,6 +28,13 @@ configure_file( }, ) +configure_version( + name = "iceoryx_versions_hpp", + src = "cmake/iceoryx_versions.hpp.in", + out = "include/iceoryx_versions.hpp", + version_from = "//:VERSION", +) + cc_library( name = "iceoryx_hoofs", srcs = glob([ @@ -46,6 +54,7 @@ cc_library( ]), hdrs = glob(["include/**"]) + glob(["legacy/**"]) + glob(["memory/**"]) + glob(["container/**"]) + glob(["vocabulary/**"]) + glob(["time/**"]) + glob(["utility/**"]) + glob(["primitives/**"]) + glob(["posix/**"]) + glob(["design/**"]) + glob(["buffer/**"]) + glob(["filesystem/**"]) + glob(["functional/**"]) + glob(["reporting/**"]) + [ ":iceoryx_hoofs_deployment_hpp", + ":iceoryx_versions_hpp", ], includes = [ "buffer/include/", diff --git a/iceoryx_hoofs/CMakeLists.txt b/iceoryx_hoofs/CMakeLists.txt index 169ea69ab4..39d549549f 100644 --- a/iceoryx_hoofs/CMakeLists.txt +++ b/iceoryx_hoofs/CMakeLists.txt @@ -35,6 +35,7 @@ if(CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin) endif() set(PREFIX iceoryx/v${CMAKE_PROJECT_VERSION}) +include(cmake/iceoryxversions.cmake) # ########## build iceoryx hoofs lib ########## diff --git a/iceoryx_posh/cmake/iceoryx_versions.hpp.in b/iceoryx_hoofs/cmake/iceoryx_versions.hpp.in similarity index 100% rename from iceoryx_posh/cmake/iceoryx_versions.hpp.in rename to iceoryx_hoofs/cmake/iceoryx_versions.hpp.in diff --git a/iceoryx_posh/cmake/iceoryxversions.cmake b/iceoryx_hoofs/cmake/iceoryxversions.cmake similarity index 87% rename from iceoryx_posh/cmake/iceoryxversions.cmake rename to iceoryx_hoofs/cmake/iceoryxversions.cmake index 14922f2896..ab204985ce 100644 --- a/iceoryx_posh/cmake/iceoryxversions.cmake +++ b/iceoryx_hoofs/cmake/iceoryxversions.cmake @@ -31,7 +31,7 @@ if(DEFINED ${PROJECT_VERSION_TWEAK}) endif() configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_versions.hpp.in" - "${CMAKE_BINARY_DIR}/generated/iceoryx/include/iceoryx_versions.hpp" @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/generated/iceoryx/include/iceoryx_versions.hpp + "${CMAKE_BINARY_DIR}/generated/iceoryx_hoofs/include/iceoryx_versions.hpp" @ONLY) +install(FILES ${CMAKE_BINARY_DIR}/generated/iceoryx_hoofs/include/iceoryx_versions.hpp DESTINATION include/${PREFIX} COMPONENT dev) diff --git a/iceoryx_posh/BUILD.bazel b/iceoryx_posh/BUILD.bazel index a131e22ba1..77f9f634f6 100644 --- a/iceoryx_posh/BUILD.bazel +++ b/iceoryx_posh/BUILD.bazel @@ -17,7 +17,6 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") load("//bazel:configure_file.bzl", "configure_file") -load("//bazel:configure_version.bzl", "configure_version") # ########## posh core lib ########## @@ -79,13 +78,6 @@ configure_file( }), ) -configure_version( - name = "iceoryx_versions_hpp", - src = "cmake/iceoryx_versions.hpp.in", - out = "include/iceoryx_versions.hpp", - version_from = "//:VERSION", -) - # ########## posh lib ########## # @@ -124,7 +116,6 @@ cc_library( iceory_posh_extra_roudi_files, hdrs = glob(["include/**"]) + [ ":iceoryx_posh_deployment_hpp", - ":iceoryx_versions_hpp", ], strip_include_prefix = "include", visibility = ["//visibility:public"], diff --git a/iceoryx_posh/CMakeLists.txt b/iceoryx_posh/CMakeLists.txt index 6280e5cfc3..d543078cdd 100644 --- a/iceoryx_posh/CMakeLists.txt +++ b/iceoryx_posh/CMakeLists.txt @@ -48,7 +48,6 @@ if(CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin) endif() set(PREFIX iceoryx/v${CMAKE_PROJECT_VERSION}) -include(cmake/iceoryxversions.cmake) ########## Multiple libraries are exported, the setup and installation is done # manually without the iox_* macros From 13e8daeb285e4d46b79995bb3f34efff1ed54528 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 25 Oct 2023 00:29:52 +0200 Subject: [PATCH 2/6] iox-#1014 Make iceoryx versions available for C user --- iceoryx_hoofs/BUILD.bazel | 8 +++--- iceoryx_hoofs/cmake/iceoryx_versions.h.in | 29 +++++++++++++++++++++ iceoryx_hoofs/cmake/iceoryx_versions.hpp.in | 18 ------------- iceoryx_hoofs/cmake/iceoryxversions.cmake | 6 ++--- iceoryx_hoofs/include/iceoryx_versions.hpp | 22 ++++++++++++++++ 5 files changed, 58 insertions(+), 25 deletions(-) create mode 100644 iceoryx_hoofs/cmake/iceoryx_versions.h.in delete mode 100644 iceoryx_hoofs/cmake/iceoryx_versions.hpp.in create mode 100644 iceoryx_hoofs/include/iceoryx_versions.hpp diff --git a/iceoryx_hoofs/BUILD.bazel b/iceoryx_hoofs/BUILD.bazel index 0f7c083600..80463a60a8 100644 --- a/iceoryx_hoofs/BUILD.bazel +++ b/iceoryx_hoofs/BUILD.bazel @@ -29,9 +29,9 @@ configure_file( ) configure_version( - name = "iceoryx_versions_hpp", - src = "cmake/iceoryx_versions.hpp.in", - out = "include/iceoryx_versions.hpp", + name = "iceoryx_versions_h", + src = "cmake/iceoryx_versions.h.in", + out = "include/iceoryx_versions.h", version_from = "//:VERSION", ) @@ -54,7 +54,7 @@ cc_library( ]), hdrs = glob(["include/**"]) + glob(["legacy/**"]) + glob(["memory/**"]) + glob(["container/**"]) + glob(["vocabulary/**"]) + glob(["time/**"]) + glob(["utility/**"]) + glob(["primitives/**"]) + glob(["posix/**"]) + glob(["design/**"]) + glob(["buffer/**"]) + glob(["filesystem/**"]) + glob(["functional/**"]) + glob(["reporting/**"]) + [ ":iceoryx_hoofs_deployment_hpp", - ":iceoryx_versions_hpp", + ":iceoryx_versions_h", ], includes = [ "buffer/include/", diff --git a/iceoryx_hoofs/cmake/iceoryx_versions.h.in b/iceoryx_hoofs/cmake/iceoryx_versions.h.in new file mode 100644 index 0000000000..a9d44671ef --- /dev/null +++ b/iceoryx_hoofs/cmake/iceoryx_versions.h.in @@ -0,0 +1,29 @@ +// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// +// 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. +// +// SPDX-License-Identifier: Apache-2.0 + +#ifndef IOX_ICEORYX_VERSIONS_H +#define IOX_ICEORYX_VERSIONS_H + +#define ICEORYX_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define ICEORYX_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define ICEORYX_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define ICEORYX_VERSION_TWEAK @IOX_VERSION_TWEAK@ + +#define ICEORYX_LATEST_RELEASE_VERSION "@PROJECT_VERSION@@IOX_VERSION_SUFFIX@" +#define ICEORYX_BUILDDATE "@ICEORYX_BUILDDATE@" +#define ICEORYX_SHA1 "@ICEORYX_SHA1@" + +#endif // IOX_ICEORYX_VERSIONS_H diff --git a/iceoryx_hoofs/cmake/iceoryx_versions.hpp.in b/iceoryx_hoofs/cmake/iceoryx_versions.hpp.in deleted file mode 100644 index a8f3a65cce..0000000000 --- a/iceoryx_hoofs/cmake/iceoryx_versions.hpp.in +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __ICEORYXVERSIONS__ -#define __ICEORYXVERSIONS__ - -#define ICEORYX_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ -#define ICEORYX_VERSION_MINOR @PROJECT_VERSION_MINOR@ -#define ICEORYX_VERSION_PATCH @PROJECT_VERSION_PATCH@ -#define ICEORYX_VERSION_TWEAK @IOX_VERSION_TWEAK@ - -#define ICEORYX_LATEST_RELEASE_VERSION "@PROJECT_VERSION@@IOX_VERSION_SUFFIX@" -#define ICEORYX_BUILDDATE "@ICEORYX_BUILDDATE@" -#define ICEORYX_SHA1 "@ICEORYX_SHA1@" - -#include "iox/logging.hpp" - -#define ICEORYX_PRINT_BUILDINFO() IOX_LOG(INFO) << "Built: " << ICEORYX_BUILDDATE; - - -#endif diff --git a/iceoryx_hoofs/cmake/iceoryxversions.cmake b/iceoryx_hoofs/cmake/iceoryxversions.cmake index ab204985ce..fb01cf298c 100644 --- a/iceoryx_hoofs/cmake/iceoryxversions.cmake +++ b/iceoryx_hoofs/cmake/iceoryxversions.cmake @@ -30,8 +30,8 @@ if(DEFINED ${PROJECT_VERSION_TWEAK}) set(IOX_VERSION_TWEAK ${PROJECT_VERSION_TWEAK}) endif() -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_versions.hpp.in" - "${CMAKE_BINARY_DIR}/generated/iceoryx_hoofs/include/iceoryx_versions.hpp" @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/generated/iceoryx_hoofs/include/iceoryx_versions.hpp +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_versions.h.in" + "${CMAKE_BINARY_DIR}/generated/iceoryx_hoofs/include/iceoryx_versions.h" @ONLY) +install(FILES ${CMAKE_BINARY_DIR}/generated/iceoryx_hoofs/include/iceoryx_versions.h DESTINATION include/${PREFIX} COMPONENT dev) diff --git a/iceoryx_hoofs/include/iceoryx_versions.hpp b/iceoryx_hoofs/include/iceoryx_versions.hpp new file mode 100644 index 0000000000..a1fbea2d6d --- /dev/null +++ b/iceoryx_hoofs/include/iceoryx_versions.hpp @@ -0,0 +1,22 @@ +// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// +// 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. +// +// SPDX-License-Identifier: Apache-2.0 + +#ifndef IOX_ICEORYX_VERSIONS_HPP +#define IOX_ICEORYX_VERSIONS_HPP + +#include "iceoryx_versions.h" + +#endif // IOX_ICEORYX_VERSIONS_HPP From 10aa4b89ac32726406c413f9ec4d78952d61c851 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 25 Oct 2023 00:37:58 +0200 Subject: [PATCH 3/6] iox-#2057 Fix path for generated files --- .../example/iceoryx_component/CMakeLists.txt | 2 +- iceoryx_binding_c/CMakeLists.txt | 2 +- iceoryx_dust/CMakeLists.txt | 6 +++--- iceoryx_posh/CMakeLists.txt | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/aspice_swe3_4/example/iceoryx_component/CMakeLists.txt b/doc/aspice_swe3_4/example/iceoryx_component/CMakeLists.txt index cc81be293b..112da7a5db 100644 --- a/doc/aspice_swe3_4/example/iceoryx_component/CMakeLists.txt +++ b/doc/aspice_swe3_4/example/iceoryx_component/CMakeLists.txt @@ -31,7 +31,7 @@ iox_add_library( NAMESPACE iceoryx_component PRIVATE_INCLUDES source/example_module BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/generated/iceoryx/include + ${CMAKE_BINARY_DIR}/generated/iceoryx_component/include INSTALL_INTERFACE include/${PREFIX} PRIVATE_LIBS ${CMAKE_THREAD_LIBS_INIT} FILES diff --git a/iceoryx_binding_c/CMakeLists.txt b/iceoryx_binding_c/CMakeLists.txt index 319f2b0600..db82e7b200 100644 --- a/iceoryx_binding_c/CMakeLists.txt +++ b/iceoryx_binding_c/CMakeLists.txt @@ -43,7 +43,7 @@ iox_add_library( NAMESPACE ${PROJECT_NAME} PROJECT_PREFIX ${PREFIX} BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/generated/iceoryx/include + ${CMAKE_BINARY_DIR}/generated/iceoryx_binding_c/include INSTALL_INTERFACE include/${PREFIX} EXPORT_INCLUDE_DIRS include/ PUBLIC_LIBS_LINUX stdc++ pthread diff --git a/iceoryx_dust/CMakeLists.txt b/iceoryx_dust/CMakeLists.txt index 1ee495e741..e8ade1cea5 100644 --- a/iceoryx_dust/CMakeLists.txt +++ b/iceoryx_dust/CMakeLists.txt @@ -48,7 +48,7 @@ iox_add_library( PUBLIC_LIBS iceoryx_hoofs::iceoryx_hoofs BUILD_INTERFACE ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/vocabulary/include - ${CMAKE_BINARY_DIR}/generated/iceoryx/include + ${CMAKE_BINARY_DIR}/generated/iceoryx_dust/include INSTALL_INTERFACE include/${PREFIX} EXPORT_INCLUDE_DIRS include/ vocabulary/include/ @@ -65,10 +65,10 @@ iox_add_library( ) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_dust_deployment.hpp.in" - "${CMAKE_BINARY_DIR}/generated/iceoryx/include/iceoryx_dust/iceoryx_dust_deployment.hpp" @ONLY) + "${CMAKE_BINARY_DIR}/generated/iceoryx_dust/include/iceoryx_dust/iceoryx_dust_deployment.hpp" @ONLY) install( - FILES ${CMAKE_BINARY_DIR}/generated/iceoryx/include/${PROJECT_NAME}/iceoryx_dust_deployment.hpp + FILES ${CMAKE_BINARY_DIR}/generated/iceoryx_dust/include/${PROJECT_NAME}/iceoryx_dust_deployment.hpp DESTINATION include/${PREFIX}/${PROJECT_NAME}/ COMPONENT dev ) diff --git a/iceoryx_posh/CMakeLists.txt b/iceoryx_posh/CMakeLists.txt index d543078cdd..b165dba52d 100644 --- a/iceoryx_posh/CMakeLists.txt +++ b/iceoryx_posh/CMakeLists.txt @@ -81,7 +81,7 @@ iox_add_library( # and include both iceoryx_posh_core and iceoryx_posh_runtime PROJECT_PREFIX ${PREFIX} BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/generated/iceoryx/include + ${CMAKE_BINARY_DIR}/generated/iceoryx_posh/include INSTALL_INTERFACE include/${PREFIX} PRIVATE_INCLUDES source/capro source/log @@ -171,7 +171,7 @@ iox_add_library( NAMESPACE iceoryx_posh PROJECT_PREFIX ${PREFIX} BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/generated/iceoryx/include + ${CMAKE_BINARY_DIR}/generated/iceoryx_posh/include ${CMAKE_BINARY_DIR}/dependencies/install/include INSTALL_INTERFACE include/${PREFIX} PUBLIC_LIBS iceoryx_hoofs::iceoryx_hoofs @@ -239,7 +239,7 @@ if(TOML_CONFIG) iceoryx_posh::iceoryx_posh_roudi cpptoml BUILD_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/generated/iceoryx/include + ${CMAKE_BINARY_DIR}/generated/iceoryx_posh/include ${CMAKE_BINARY_DIR}/dependencies/install/include INSTALL_INTERFACE include/${PREFIX} FILES @@ -278,10 +278,10 @@ if(TOML_CONFIG) endif() configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_posh_deployment.hpp.in" - "${CMAKE_BINARY_DIR}/generated/iceoryx/include/iceoryx_posh/iceoryx_posh_deployment.hpp" @ONLY) + "${CMAKE_BINARY_DIR}/generated/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_deployment.hpp" @ONLY) install( - FILES ${CMAKE_BINARY_DIR}/generated/iceoryx/include/${PROJECT_NAME}/iceoryx_posh_deployment.hpp + FILES ${CMAKE_BINARY_DIR}/generated/iceoryx_posh/include/${PROJECT_NAME}/iceoryx_posh_deployment.hpp DESTINATION include/${PREFIX}/${PROJECT_NAME}/ COMPONENT dev ) From 9deba473910671fa4062fad05deb6955be2e84a5 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 25 Oct 2023 01:00:16 +0200 Subject: [PATCH 4/6] iox-#2057 Add deprecation macros --- .../test_utility_deprecation_marker.cpp | 20 +++ .../include/iox/detail/deprecation_marker.hpp | 131 ++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 iceoryx_hoofs/test/moduletests/test_utility_deprecation_marker.cpp create mode 100644 iceoryx_hoofs/utility/include/iox/detail/deprecation_marker.hpp diff --git a/iceoryx_hoofs/test/moduletests/test_utility_deprecation_marker.cpp b/iceoryx_hoofs/test/moduletests/test_utility_deprecation_marker.cpp new file mode 100644 index 0000000000..39d7617dcb --- /dev/null +++ b/iceoryx_hoofs/test/moduletests/test_utility_deprecation_marker.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2023 by Mathias Kraus . All rights reserved. +// +// 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. +// +// SPDX-License-Identifier: Apache-2.0 + +#include "iox/detail/deprecation_marker.hpp" + +// NOTE: this ensures that the "deprecation_marker.hpp" header is included in at least one translation unit in order to +// execute the 'static_assert' which checks if the macros need to be updated; no additional tests are required diff --git a/iceoryx_hoofs/utility/include/iox/detail/deprecation_marker.hpp b/iceoryx_hoofs/utility/include/iox/detail/deprecation_marker.hpp new file mode 100644 index 0000000000..7bd981a6d0 --- /dev/null +++ b/iceoryx_hoofs/utility/include/iox/detail/deprecation_marker.hpp @@ -0,0 +1,131 @@ +// Copyright (c) 2023 by Mathias Kraus . All rights reserved. +// +// 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. +// +// SPDX-License-Identifier: Apache-2.0 + +#ifndef IOX_HOOFS_UTILITY_DEPRECATION_MARKER_HPP +#define IOX_HOOFS_UTILITY_DEPRECATION_MARKER_HPP + +#include "iceoryx_versions.hpp" + +namespace iox +{ +namespace detail +{ +struct DeprecationMarker +{ +}; +} // namespace detail +} // namespace iox + +// NOLINTJUSTIFICATION there is no other way to create the intended functionality for the deprecation marker +// NOLINTBEGIN(cppcoreguidelines-macro-usage) + +#define IOX_INTERNAL_NEXT_DEPRECATED_VERSION 3 + +#define IOX_INTERNAL_DEPRECATED_STINGIFY_HELPER_EXPAMD(NUM) #NUM +#define IOX_INTERNAL_DEPRECATED_STINGIFY_HELPER(NUM) IOX_INTERNAL_DEPRECATED_STINGIFY_HELPER_EXPAMD(NUM) + +// clang-format off +static_assert(ICEORYX_VERSION_MAJOR < IOX_INTERNAL_NEXT_DEPRECATED_VERSION, + "The iceoryx major version changed to v" IOX_INTERNAL_DEPRECATED_STINGIFY_HELPER(ICEORYX_VERSION_MAJOR) "!\n" + "The following steps need to be done to fix this error: \n" + " - increment 'IOX_INTERNAL_NEXT_DEPRECATED_VERSION'\n" + " - update 'IOX_INTERNAL_DEPRECATED_SINCE_V" IOX_INTERNAL_DEPRECATED_STINGIFY_HELPER(ICEORYX_VERSION_MAJOR) + " to call 'IOX_INTERNAL_DEPRECATED_SINCE(VERSION, MESSAGE)'\n" + " - update 'IOX_INTERNAL_DEPRECATED_HEADER_SINCE_V" IOX_INTERNAL_DEPRECATED_STINGIFY_HELPER(ICEORYX_VERSION_MAJOR) + " to call 'IOX_INTERNAL_DEPRECATED_HEADER_SINCE(VERSION, MESSAGE)'"); + +// clang-format on + + +// BEGIN IOX_DEPRECATED_HEADER_SINCE macros + +// when the namespace is called 'header' the warning will be "warning: 'header' is deprecated: Deprecated since v#.0 +// ..." with the file and line where the 'IOX_DEPRECATED_HEADER_SINCE' macro is used +#define IOX_INTERNAL_DEPRECATED_HEADER_SINCE(VERSION, MESSAGE) \ + namespace iox \ + { \ + namespace detail \ + { \ + namespace \ + [[deprecated("Deprecated since v" #VERSION ".0 and will be removed at a later version! " MESSAGE)]] header \ + { \ + using iox::detail::DeprecationMarker; \ + } \ + using header::DeprecationMarker; \ + } \ + } + +#define IOX_INTERNAL_DEPRECATED_HEADER_SINCE_V1(VERSION, MESSAGE) IOX_INTERNAL_DEPRECATED_HEADER_SINCE(VERSION, MESSAGE) + +#define IOX_INTERNAL_DEPRECATED_HEADER_SINCE_V2(VERSION, MESSAGE) IOX_INTERNAL_DEPRECATED_HEADER_SINCE(VERSION, MESSAGE) + +#define IOX_INTERNAL_DEPRECATED_HEADER_SINCE_V3(VERSION, MESSAGE) + +#define IOX_INTERNAL_DEPRECATED_HEADER_SINCE_V4(VERSION, MESSAGE) + +// This indirection is required to expand defines passed to 'IOX_DEPRECATED_HEADER_SINCE' make code like this work +// ---- +// #define V 3 +// IOX_DEPRECATED_HEADER_SINCE(V, "Please include 'iox/foo.hpp' instead.") +// ---- +#define IOX_INTERNAL_DEPRECATED_HEADER_SINCE_EXPANSION(VERSION, MESSAGE) \ + IOX_INTERNAL_DEPRECATED_HEADER_SINCE_V##VERSION(VERSION, MESSAGE) + +/// @brief Macro to deprecate header depending on the iceoryx major version +/// @param[in] VERSION from when the header is deprecated +/// @param[in] MESSAGE custom message to be printed after 'Deprecated since vX.0 and will be remove at a later version!' +/// @code +/// IOX_DEPRECATED_HEADER_SINCE(3, "Please use 'iox/foo.hpp' instead.") +/// @endcode +#define IOX_DEPRECATED_HEADER_SINCE(VERSION, MESSAGE) IOX_INTERNAL_DEPRECATED_HEADER_SINCE_EXPANSION(VERSION, MESSAGE) + +// END IOX_DEPRECATED_HEADER_SINCE macros + + +// BEGIN IOX_DEPRECATED_SINCE macros + +#define IOX_INTERNAL_DEPRECATED_SINCE(VERSION, MESSAGE) \ + [[deprecated("Deprecated since v" #VERSION ".0 and will be removed at a later version! " MESSAGE)]] + +#define IOX_INTERNAL_DEPRECATED_SINCE_V1(VERSION, MESSAGE) IOX_INTERNAL_DEPRECATED_SINCE(VERSION, MESSAGE) + +#define IOX_INTERNAL_DEPRECATED_SINCE_V2(VERSION, MESSAGE) IOX_INTERNAL_DEPRECATED_SINCE(VERSION, MESSAGE) + +#define IOX_INTERNAL_DEPRECATED_SINCE_V3(VERSION, MESSAGE) + +#define IOX_INTERNAL_DEPRECATED_SINCE_V4(VERSION, MESSAGE) + +// This indirection is required to expand defines passed to 'IOX_DEPRECATED_SINCE' make code like this work +// ---- +// #define V 3 +// IOX_DEPRECATED_SINCE(V, "Please use 'iox::foo' instead.") void bar() {} +// ---- +#define IOX_INTERNAL_DEPRECATED_SINCE_EXPANSION(VERSION, MESSAGE) \ + IOX_INTERNAL_DEPRECATED_SINCE_V##VERSION(VERSION, MESSAGE) + +/// @brief Macro to deprecate code depending on the iceoryx major version +/// @param[in] VERSION from when the code is deprecated +/// @param[in] MESSAGE custom message to be printed after 'Deprecated since vX and will be remove at a later version!' +/// @code +/// IOX_DEPRECATED_SINCE(3, "Please use 'iox::foo' instead.") void bar() {} +/// @endcode +#define IOX_DEPRECATED_SINCE(VERSION, MESSAGE) IOX_INTERNAL_DEPRECATED_SINCE_EXPANSION(VERSION, MESSAGE) + +// END IOX_DEPRECATED_SINCE macros + +// NOLINTEND(cppcoreguidelines-macro-usage) + +#endif // IOX_HOOFS_UTILITY_DEPRECATION_MARKER_HPP From 94481656a5a86e886b3f3c3549fa9e7f09982186 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 25 Oct 2023 03:56:03 +0200 Subject: [PATCH 5/6] iox-#2057 Use deprecation macros and fix issues --- iceoryx_hoofs/cmake/iceoryx_hoofs_deployment.hpp.in | 2 +- .../internal/posix_wrapper/unix_domain_socket.hpp | 2 +- .../legacy/include/iceoryx_hoofs/cxx/algorithm.hpp | 5 +++-- .../legacy/include/iceoryx_hoofs/cxx/attributes.hpp | 5 +++-- .../legacy/include/iceoryx_hoofs/cxx/deadline_timer.hpp | 5 +++-- .../legacy/include/iceoryx_hoofs/cxx/expected.hpp | 5 +++-- .../legacy/include/iceoryx_hoofs/cxx/filesystem.hpp | 7 ++++--- .../legacy/include/iceoryx_hoofs/cxx/function.hpp | 5 +++-- .../legacy/include/iceoryx_hoofs/cxx/function_ref.hpp | 5 +++-- .../include/iceoryx_hoofs/cxx/functional_interface.hpp | 5 +++-- iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/newtype.hpp | 5 +++-- .../legacy/include/iceoryx_hoofs/cxx/optional.hpp | 5 +++-- .../legacy/include/iceoryx_hoofs/cxx/scope_guard.hpp | 5 +++-- .../legacy/include/iceoryx_hoofs/cxx/scoped_static.hpp | 5 +++-- iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/stack.hpp | 5 +++-- iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/string.hpp | 5 +++-- .../legacy/include/iceoryx_hoofs/cxx/type_traits.hpp | 5 +++-- .../legacy/include/iceoryx_hoofs/cxx/unique_ptr.hpp | 5 +++-- iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/variant.hpp | 5 +++-- iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/vector.hpp | 5 +++-- .../include/iceoryx_hoofs/design_pattern/builder.hpp | 7 ++++--- .../legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp | 7 ++++--- iceoryx_hoofs/memory/include/iox/bump_allocator.hpp | 2 +- .../error_reporting/test_error_reporting_macros.cpp | 1 - iceoryx_hoofs/time/include/iox/detail/duration.inl | 2 +- iceoryx_hoofs/time/include/iox/duration.hpp | 2 +- 26 files changed, 68 insertions(+), 49 deletions(-) diff --git a/iceoryx_hoofs/cmake/iceoryx_hoofs_deployment.hpp.in b/iceoryx_hoofs/cmake/iceoryx_hoofs_deployment.hpp.in index 5b97b0bcfd..fe0b419757 100644 --- a/iceoryx_hoofs/cmake/iceoryx_hoofs_deployment.hpp.in +++ b/iceoryx_hoofs/cmake/iceoryx_hoofs_deployment.hpp.in @@ -17,7 +17,7 @@ #ifndef IOX_HOOFS_ICEORYX_HOOFS_DEPLOYMENT_HPP #define IOX_HOOFS_ICEORYX_HOOFS_DEPLOYMENT_HPP -#include "iceoryx_hoofs/iceoryx_hoofs_types.hpp" +#include "iox/iceoryx_hoofs_types.hpp" namespace iox { diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/unix_domain_socket.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/unix_domain_socket.hpp index af021516f1..c7927dc980 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/unix_domain_socket.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/unix_domain_socket.hpp @@ -18,7 +18,6 @@ #ifndef IOX_HOOFS_POSIX_WRAPPER_UNIX_DOMAIN_SOCKET_HPP #define IOX_HOOFS_POSIX_WRAPPER_UNIX_DOMAIN_SOCKET_HPP -#include "iceoryx_hoofs/cxx/filesystem.hpp" #include "iceoryx_hoofs/internal/posix_wrapper/ipc_channel.hpp" #include "iceoryx_platform/fcntl.hpp" #include "iceoryx_platform/platform_settings.hpp" @@ -27,6 +26,7 @@ #include "iceoryx_platform/un.hpp" #include "iox/builder.hpp" #include "iox/duration.hpp" +#include "iox/filesystem.hpp" #include "iox/optional.hpp" namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/algorithm.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/algorithm.hpp index 9c7d846fb6..1f0324fe13 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/algorithm.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/algorithm.hpp @@ -17,7 +17,8 @@ #define IOX_HOOFS_CXX_ALGORITHM_HPP #include "iox/algorithm.hpp" -#pragma message( \ - "Deprecated in 3.0, removed in 4.0, please include 'iox/algorithm.hpp' instead of 'iceoryx_hoofs/cxx/algorithm.hpp'") +#include "iox/detail/deprecation_marker.hpp" + +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/algorithm.hpp' instead.") #endif // IOX_HOOFS_CXX_ALGORITHM_HPP diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/attributes.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/attributes.hpp index 9e62b3c6f2..52734bea94 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/attributes.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/attributes.hpp @@ -18,11 +18,12 @@ #define IOX_HOOFS_CXX_ATTRIBUTES_HPP #include "iox/attributes.hpp" +#include "iox/detail/deprecation_marker.hpp" + +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/attributes.hpp' instead.") namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/attributes.hpp' instead")]] namespace cxx { namespace internal diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/deadline_timer.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/deadline_timer.hpp index ceb07dbb93..f905871c5e 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/deadline_timer.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/deadline_timer.hpp @@ -18,11 +18,12 @@ #define IOX_HOOFS_CXX_DEADLINE_TIMER_HPP #include "iox/deadline_timer.hpp" +#include "iox/detail/deprecation_marker.hpp" + +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/deadline_timer.hpp' instead.") namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/deadline_timer.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::deadline_timer' instead of 'iox::cxx::DeadlineTimer' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/expected.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/expected.hpp index 361a2c97c5..a47ff90df4 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/expected.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/expected.hpp @@ -17,12 +17,13 @@ #ifndef IOX_HOOFS_CXX_EXPECTED_HPP #define IOX_HOOFS_CXX_EXPECTED_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/expected.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/expected.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/expected.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::error' instead of 'iox::cxx::error' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/filesystem.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/filesystem.hpp index 989cf24f44..51caa9a715 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/filesystem.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/filesystem.hpp @@ -16,16 +16,17 @@ #ifndef IOX_HOOFS_CXX_FILESYSTEM_HPP #define IOX_HOOFS_CXX_FILESYSTEM_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/filesystem.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/filesystem.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/filesystem.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::access_rights' instead of 'iox::cxx::perms' -using perms = iox::access_rights; +using perms IOX_DEPRECATED_SINCE(3, "Please use 'iox::access_rights' instead.") = iox::access_rights; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function.hpp index cd71e9f760..ae659a353d 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function.hpp @@ -17,12 +17,13 @@ #ifndef IOX_HOOFS_FUNCTION_HPP #define IOX_HOOFS_FUNCTION_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/function.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/function.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/function.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::function' instead of 'iox::cxx::function' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function_ref.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function_ref.hpp index 9d15f5d9c6..b1b94e611d 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function_ref.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function_ref.hpp @@ -17,12 +17,13 @@ #ifndef IOX_HOOFS_CXX_FUNCTION_REF_HPP #define IOX_HOOFS_CXX_FUNCTION_REF_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/function_ref.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/function_ref.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/function_ref.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::function_ref' instead of 'iox::cxx::function_ref' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/functional_interface.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/functional_interface.hpp index fc09159e4a..a35d09d96b 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/functional_interface.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/functional_interface.hpp @@ -16,12 +16,13 @@ #ifndef IOX_HOOFS_CXX_FUNCTIONAL_INTERFACE_HPP #define IOX_HOOFS_CXX_FUNCTIONAL_INTERFACE_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/functional_interface.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/functional_interface.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/functional_interface.hpp' instead")]] namespace cxx { namespace internal diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/newtype.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/newtype.hpp index c5b823515a..6438ef1eb6 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/newtype.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/newtype.hpp @@ -16,12 +16,13 @@ #ifndef IOX_HOOFS_CXX_NEWTYPE_HPP #define IOX_HOOFS_CXX_NEWTYPE_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/newtype.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/newtype.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/newtype.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::NewType' instead of 'iox::cxx::NewType' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/optional.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/optional.hpp index dc619be5e6..7b567fef2f 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/optional.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/optional.hpp @@ -17,12 +17,13 @@ #ifndef IOX_HOOFS_CXX_OPTIONAL_HPP #define IOX_HOOFS_CXX_OPTIONAL_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/optional.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/optional.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/optional.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::in_place' instead of 'iox::cxx::in_place' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scope_guard.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scope_guard.hpp index 2c794c7288..128a7598cf 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scope_guard.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scope_guard.hpp @@ -17,12 +17,13 @@ #ifndef IOX_HOOFS_CXX_SCOPE_GUARD_HPP #define IOX_HOOFS_CXX_SCOPE_GUARD_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/scope_guard.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/scope_guard.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/scope_guard.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::ScopeGuard' instead of 'iox::cxx::ScopeGuard' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scoped_static.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scoped_static.hpp index 0c92288982..b369c88833 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scoped_static.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scoped_static.hpp @@ -17,12 +17,13 @@ #ifndef IOX_HOOFS_CXX_SCOPED_STATIC_HPP #define IOX_HOOFS_CXX_SCOPED_STATIC_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/scoped_static.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/scoped_static.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/scoped_static.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::makeScopedStatic' instead of 'iox::cxx::makeScopedStatic' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/stack.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/stack.hpp index 329b981c3f..b53ee0c53f 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/stack.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/stack.hpp @@ -16,12 +16,13 @@ #ifndef IOX_HOOFS_CXX_STACK_HPP #define IOX_HOOFS_CXX_STACK_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/stack.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/stack.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/stack.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::stack' instead of 'iox::cxx::stack' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/string.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/string.hpp index cb7ba95cc8..2f17ce4ed6 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/string.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/string.hpp @@ -17,12 +17,13 @@ #ifndef IOX_HOOFS_CXX_STRING_HPP #define IOX_HOOFS_CXX_STRING_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/string.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/string.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/string.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::concatenate' instead of 'iox::cxx::concatenate' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/type_traits.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/type_traits.hpp index a15e871455..d8a2712c00 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/type_traits.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/type_traits.hpp @@ -17,12 +17,13 @@ #ifndef IOX_HOOFS_CXX_TYPE_TRAITS_HPP #define IOX_HOOFS_CXX_TYPE_TRAITS_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/type_traits.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/type_traits.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/type_traits.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::add_const_conditionally' instead of 'iox::cxx::add_const_conditionally' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/unique_ptr.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/unique_ptr.hpp index cf6d96e2d1..ceac2a1589 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/unique_ptr.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/unique_ptr.hpp @@ -17,12 +17,13 @@ #ifndef IOX_HOOFS_CXX_UNIQUE_PTR_HPP #define IOX_HOOFS_CXX_UNIQUE_PTR_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/unique_ptr.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/unique_ptr.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/unique_ptr.hpp' instead")]] namespace cxx { /// @deprecated diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/variant.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/variant.hpp index 2029a46a1c..e81cf62141 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/variant.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/variant.hpp @@ -17,12 +17,13 @@ #ifndef IOX_HOOFS_CXX_VARIANT_HPP #define IOX_HOOFS_CXX_VARIANT_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/variant.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/variant.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/variant.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::in_place_index' instead of 'iox::cxx::in_place_index' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/vector.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/vector.hpp index 6079f817fb..6500636120 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/vector.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/vector.hpp @@ -16,12 +16,13 @@ #ifndef IOX_HOOFS_CXX_VECTOR_HPP #define IOX_HOOFS_CXX_VECTOR_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/vector.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/vector.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::vector' instead of 'iox::cxx::vector' diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/design_pattern/builder.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/design_pattern/builder.hpp index a6d32e6753..9a11039317 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/design_pattern/builder.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/design_pattern/builder.hpp @@ -18,7 +18,8 @@ #define IOX_HOOFS_DESIGN_PATTERN_BUILDER_HPP #include "iox/builder.hpp" -#pragma message( \ - "Deprecated in 3.0, removed in 4.0, please include 'iox/builder.hpp' instead of 'iceoryx_hoofs/design_pattern/builder.hpp'") +#include "iox/detail/deprecation_marker.hpp" -#endif +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/builder.hpp' instead.") + +#endif // IOX_HOOFS_DESIGN_PATTERN_BUILDER_HPP diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp index 3917c73224..eabb90665f 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp @@ -17,16 +17,17 @@ #ifndef IOX_HOOFS_ICEORYX_HOOFS_TYPES_HPP #define IOX_HOOFS_ICEORYX_HOOFS_TYPES_HPP +#include "iox/detail/deprecation_marker.hpp" #include "iox/iceoryx_hoofs_types.hpp" +IOX_DEPRECATED_HEADER_SINCE(3, "Please include 'iox/iceoryx_hoofs_types.hpp' instead.") + namespace iox { -/// @todo iox-#1593 Deprecate include -/// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/iceoryx_hoofs_types.hpp' instead")]] namespace cxx { /// @deprecated use 'iox::byte' instead of 'iox::cxx::byte_t' -using byte_t = byte; +using byte_t IOX_DEPRECATED_SINCE(3, "Please use 'iox::byte' instead.") = byte; } // namespace cxx namespace log diff --git a/iceoryx_hoofs/memory/include/iox/bump_allocator.hpp b/iceoryx_hoofs/memory/include/iox/bump_allocator.hpp index 7b88e8095a..5cebf22f7d 100644 --- a/iceoryx_hoofs/memory/include/iox/bump_allocator.hpp +++ b/iceoryx_hoofs/memory/include/iox/bump_allocator.hpp @@ -17,7 +17,7 @@ #ifndef IOX_HOOFS_MEMORY_BUMP_ALLOCATOR_HPP #define IOX_HOOFS_MEMORY_BUMP_ALLOCATOR_HPP -#include "iceoryx_hoofs/cxx/expected.hpp" +#include "iox/expected.hpp" #include diff --git a/iceoryx_hoofs/test/moduletests/error_reporting/test_error_reporting_macros.cpp b/iceoryx_hoofs/test/moduletests/error_reporting/test_error_reporting_macros.cpp index 6480cbff0c..8cd4003665 100644 --- a/iceoryx_hoofs/test/moduletests/error_reporting/test_error_reporting_macros.cpp +++ b/iceoryx_hoofs/test/moduletests/error_reporting/test_error_reporting_macros.cpp @@ -31,7 +31,6 @@ namespace // NOLINTBEGIN(cppcoreguidelines-avoid-do-while) bad rule, disable globally using namespace ::testing; using namespace iox::er; -using namespace iox::cxx; using namespace iox::testing; using MyErrorA = module_a::errors::Error; diff --git a/iceoryx_hoofs/time/include/iox/detail/duration.inl b/iceoryx_hoofs/time/include/iox/detail/duration.inl index 960eec224b..1820d4513c 100644 --- a/iceoryx_hoofs/time/include/iox/detail/duration.inl +++ b/iceoryx_hoofs/time/include/iox/detail/duration.inl @@ -483,7 +483,7 @@ template inline constexpr T& operator*=(T&, const Duration&) noexcept { static_assert( - cxx::always_false_v, + always_false_v, "Assigning the result of a Duration multiplication with 'operator*=' to an arithmetic type is not supported"); return T(); } diff --git a/iceoryx_hoofs/time/include/iox/duration.hpp b/iceoryx_hoofs/time/include/iox/duration.hpp index 0e92ce3eab..1f5bc56912 100644 --- a/iceoryx_hoofs/time/include/iox/duration.hpp +++ b/iceoryx_hoofs/time/include/iox/duration.hpp @@ -17,11 +17,11 @@ #ifndef IOX_HOOFS_TIME_UNITS_DURATION_HPP #define IOX_HOOFS_TIME_UNITS_DURATION_HPP -#include "iceoryx_hoofs/cxx/type_traits.hpp" #include "iceoryx_platform/time.hpp" // required for QNX #include "iox/expected.hpp" #include "iox/log/logstream.hpp" #include "iox/logging.hpp" +#include "iox/type_traits.hpp" #include From b9b2c4ad20390dc01cef8cb871d9e5af46844d03 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 25 Oct 2023 03:59:17 +0200 Subject: [PATCH 6/6] iox-#2057 Update release notes --- doc/website/release-notes/iceoryx-unreleased.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index 64c8bcaa9a..c22826bac2 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -49,6 +49,8 @@ - Implement custom error reporting API [\#1032](https://github.com/eclipse-iceoryx/iceoryx/issues/1032) - Implement iceoryx platform for FreeRTOS [#1982](https://github.com/eclipse-iceoryx/iceoryx/issues/1982) - Extend 'iceperf' with 'WaitSet' [#2003](https://github.com/eclipse-iceoryx/iceoryx/issues/2003) +- Create iceoryx version header for the C-binding [#1014](https://github.com/eclipse-iceoryx/iceoryx/issues/1014) +- Create macros to deprecate header and code constructs [#2057](https://github.com/eclipse-iceoryx/iceoryx/issues/2057) **Bugfixes:**