Skip to content

Commit 3c41049

Browse files
authored
Merge pull request #6 from Simple-Robotics/macro-headers-cleanup
Macro headers cleanup
2 parents eeb31eb + 860b0e9 commit 3c41049

File tree

16 files changed

+20
-79
lines changed

16 files changed

+20
-79
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1919
### Changed
2020

2121
- bindings/python : Add missing arg names in `visualizer-visitor.hpp`
22+
- use deprecation, warning macros already provided by jrl-cmakemodules
23+
24+
### Removed
25+
26+
- Remove unused headers `deprecated-macros.hpp` and `deprecated-namespaces.hpp`
27+
- Remove header `pinocchio/deprecation.hpp`, directly use generated `pinocchio/deprecated.hpp`
28+
- macros.hpp : remove macros already provided by jrl-cmakemodules
2229

2330
## [3.7.0] - 2025-05-21
2431

include/pinocchio/algorithm/parallel/geometry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "pinocchio/macros.hpp"
99

1010
// clang-format off
11-
PINOCCHIO_PRAGMA_DEPRECATED_HEADER(pinocchio/algorithm/parallel/geometry.hpp, pinocchio/collision/parallel/geometry.hpp)
11+
PINOCCHIO_DEPRECATED_HEADER(pinocchio/algorithm/parallel/geometry.hpp, pinocchio/collision/parallel/geometry.hpp)
1212
// clang-format on
1313

1414
#include "pinocchio/collision/parallel/geometry.hpp"

include/pinocchio/algorithm/parallel/omp.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define __pinocchio_algorithm_parallel_omp_hpp__
77

88
#include "pinocchio/macros.hpp"
9-
PINOCCHIO_PRAGMA_DEPRECATED_HEADER(
9+
PINOCCHIO_DEPRECATED_HEADER(
1010
pinocchio / algorithm / parallel / omp.hpp, pinocchio / utils / openmp.hpp)
1111
#include "pinocchio/utils/openmp.hpp"
1212

include/pinocchio/bindings/python/parsers/python.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "pinocchio/macros.hpp"
99

1010
// clang-format off
11-
PINOCCHIO_PRAGMA_DEPRECATED_HEADER(pinocchio/bindings/python/parsers/python.hpp, pinocchio/parsers/python.hpp)
11+
PINOCCHIO_DEPRECATED_HEADER(pinocchio/bindings/python/parsers/python.hpp, pinocchio/parsers/python.hpp)
1212
// clang-format on
1313

1414
#include "pinocchio/parsers/python.hpp"

include/pinocchio/deprecated-macros.hpp

Lines changed: 0 additions & 20 deletions
This file was deleted.

include/pinocchio/deprecated-namespaces.hpp

Lines changed: 0 additions & 12 deletions
This file was deleted.

include/pinocchio/deprecation.hpp

Lines changed: 0 additions & 12 deletions
This file was deleted.

include/pinocchio/fwd.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace pinocchio
2626
#endif
2727

2828
#include "pinocchio/macros.hpp"
29-
#include "pinocchio/deprecation.hpp"
29+
#include "pinocchio/deprecated.hpp"
3030
#include "pinocchio/warning.hpp"
3131
#include "pinocchio/config.hpp"
3232
#include "pinocchio/unsupported.hpp"

include/pinocchio/macros.hpp

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
#ifndef __pinocchio_macros_hpp__
77
#define __pinocchio_macros_hpp__
88

9-
#include <sstream>
9+
#include "pinocchio/deprecated.hpp"
10+
#include "pinocchio/warning.hpp"
1011

1112
// On Windows, __cplusplus is not necessarily set to the C++ version being used.
1213
// See https://docs.microsoft.com/fr-fr/cpp/build/reference/zc-cplusplus?view=vs-2019 for further
@@ -36,28 +37,8 @@
3637
#define PINOCCHIO_MAC_ARM64
3738
#endif
3839

39-
#define PINOCCHIO_STRING_LITERAL(string) #string
4040
#define PINOCCHIO_NOEXCEPT noexcept
4141

42-
// For more details, visit
43-
// https://stackoverflow.com/questions/171435/portability-of-warning-preprocessor-directive
44-
#if defined(__GNUC__) || defined(__clang__)
45-
#define PINOCCHIO_PRAGMA(x) _Pragma(#x)
46-
#define PINOCCHIO_PRAGMA_MESSAGE(the_message) PINOCCHIO_PRAGMA(GCC message #the_message)
47-
#define PINOCCHIO_PRAGMA_WARNING(the_message) PINOCCHIO_PRAGMA(GCC warning #the_message)
48-
#define PINOCCHIO_PRAGMA_DEPRECATED(the_message) \
49-
PINOCCHIO_PRAGMA_WARNING(Deprecated : #the_message)
50-
#define PINOCCHIO_PRAGMA_DEPRECATED_HEADER(old_header, new_header) \
51-
PINOCCHIO_PRAGMA_WARNING(Deprecated header file : #old_header has been replaced \
52-
by #new_header.\n Please use #new_header instead of #old_header.)
53-
#else
54-
#define PINOCCHIO_PRAGMA(x)
55-
#define PINOCCHIO_PRAGMA_MESSAGE(the_message)
56-
#define PINOCCHIO_PRAGMA_WARNING(the_message)
57-
#define PINOCCHIO_PRAGMA_DEPRECATED(the_message)
58-
#define PINOCCHIO_PRAGMA_DEPRECATED_HEADER(old_header, new_header)
59-
#endif
60-
6142
/// \brief Function attribute to forbid inlining.
6243
/// This is a compiler hint that can be not respected.
6344
#define PINOCCHIO_DONT_INLINE EIGEN_DONT_INLINE
@@ -244,7 +225,7 @@ PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_VARIADIC_MACROS
244225
#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_2(size, expected_size) \
245226
_PINOCCHIO_CHECK_ARGUMENT_SIZE_3( \
246227
size, expected_size, \
247-
PINOCCHIO_STRING_LITERAL(size) " is different from " PINOCCHIO_STRING_LITERAL(expected_size))
228+
PINOCCHIO_WARN_STRINGISE(size) " is different from " PINOCCHIO_WARN_STRINGISE(expected_size))
248229

249230
#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_1
250231

include/pinocchio/math/casadi.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "pinocchio/macros.hpp"
99

1010
// clang-format off
11-
PINOCCHIO_PRAGMA_DEPRECATED_HEADER(pinocchio/math/casadi.hpp, pinocchio/autodiff/casadi.hpp)
11+
PINOCCHIO_DEPRECATED_HEADER(pinocchio/math/casadi.hpp, pinocchio/autodiff/casadi.hpp)
1212
// clang-format on
1313

1414
#include "pinocchio/autodiff/casadi.hpp"

0 commit comments

Comments
 (0)