Skip to content

Commit

Permalink
[ExecuTorch] Clean up pre-C++17 macros
Browse files Browse the repository at this point in the history
We require C++17.

Differential Revision: [D65233922](https://our.internmc.facebook.com/intern/diff/D65233922/)

[ghstack-poisoned]
  • Loading branch information
swolchok committed Oct 30, 2024
1 parent db38bcc commit d1f8cd3
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions runtime/platform/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,13 @@

#endif // defined(__GNUC__)

#if (__cplusplus) >= 201703L

#define ET_DEPRECATED [[deprecated]]
#define ET_EXPERIMENTAL \
[[deprecated("This API is experimental and may change without notice.")]]
#define ET_FALLTHROUGH [[fallthrough]]
#define ET_NODISCARD [[nodiscard]]
#define ET_UNUSED [[maybe_unused]]

#else

#define ET_DEPRECATED __attribute__((deprecated))
#define ET_EXPERIMENTAL \
__attribute__(( \
deprecated("This API is experimental and may change without notice.")))
#define ET_FALLTHROUGH __attribute__((fallthrough))
#define ET_NODISCARD __attribute__((warn_unused_result))
#define ET_UNUSED __attribute__((unused))

#endif // (__cplusplus) >= 201703L

// UNLIKELY Macro
// example
// if ET_UNLIKELY(a > 10 && b < 5) {
Expand Down

0 comments on commit d1f8cd3

Please sign in to comment.