Skip to content

Commit d54226a

Browse files
pytorchbotswolchok
andauthored
Define ET_HAS_EXCEPTIONS macro (#11664)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #11603 by @swolchok ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/swolchok/456/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/swolchok/456/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/swolchok/456/orig @diff-train-skip-merge Co-authored-by: Scott Wolchok <[email protected]>
1 parent 884e901 commit d54226a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

runtime/platform/compiler.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@
171171
using ssize_t = ptrdiff_t;
172172
#endif
173173

174+
#ifdef __EXCEPTIONS
175+
#define ET_HAS_EXCEPTIONS 1
176+
#elif defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS
177+
#define ET_HAS_EXCEPTIONS 1
178+
#else
179+
#define ET_HAS_EXCEPTIONS 0
180+
#endif
181+
174182
// DEPRECATED: Use the non-underscore-prefixed versions instead.
175183
// TODO(T199005537): Remove these once all users have stopped using them.
176184
#define __ET_DEPRECATED ET_DEPRECATED

0 commit comments

Comments
 (0)