From a771a9247f16de9db0dba44a6c5e2f8bcedc6604 Mon Sep 17 00:00:00 2001 From: William Hjelm Date: Fri, 23 Sep 2022 14:26:57 +0200 Subject: [PATCH] Add _countof when not compiling with MSVS --- src/ffx-fsr2-api/ffx_fsr2.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ffx-fsr2-api/ffx_fsr2.cpp b/src/ffx-fsr2-api/ffx_fsr2.cpp index ebd69d5..e08bbcd 100644 --- a/src/ffx-fsr2-api/ffx_fsr2.cpp +++ b/src/ffx-fsr2-api/ffx_fsr2.cpp @@ -32,6 +32,14 @@ #include "ffx_fsr2_maximum_bias.h" +#ifndef _MSC_VER +template < typename T, size_t N > +size_t _countof(T(&arr)[N]) +{ + return std::extent< T[N] >::value; +} +#endif + #ifdef __clang__ #pragma clang diagnostic ignored "-Wunused-variable" #endif