From 7badf813e1794d56654d2bd2153a5e874a430bc5 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Fri, 20 Jun 2025 10:40:09 -0700 Subject: [PATCH] ET_HAS_EXCEPTIONS: require defined(_MSC_VER) to conclude _HAS_EXCEPTIONS implies exceptions are on Pull Request resolved: https://github.com/pytorch/executorch/pull/11770 _HAS_EXCEPTIONS might get defined on some other platform by coincidence; require it to be actual MSVC for us to conclude exceptions are on. ghstack-source-id: 291685590 Differential Revision: [D76857541](https://our.internmc.facebook.com/intern/diff/D76857541/) --- runtime/platform/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/platform/compiler.h b/runtime/platform/compiler.h index 864b76e2050..f8588930e15 100644 --- a/runtime/platform/compiler.h +++ b/runtime/platform/compiler.h @@ -173,7 +173,7 @@ using ssize_t = ptrdiff_t; #ifdef __EXCEPTIONS #define ET_HAS_EXCEPTIONS 1 -#elif defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS +#elif defined(_MSC_VER) && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS #define ET_HAS_EXCEPTIONS 1 #else #define ET_HAS_EXCEPTIONS 0