Changed printf attribute check to look for gcc and clang compilers specifically.

This commit is contained in:
harry 2023-01-29 20:46:16 -05:00
parent f815c849c2
commit 3266a20970
1 changed files with 1 additions and 1 deletions

View File

@ -167,7 +167,7 @@ typedef uint8 (*readfunc)(uint32 A);
#define __FCEU_PRINTF_FORMAT _In_z_ _Printf_format_string_
#define __FCEU_PRINTF_ATTRIBUTE( fmt, va )
#elif FCEU_HAS_CPP_ATTRIBUTE(format)
#elif defined(__GNUC__) || defined(__clang__) || FCEU_HAS_CPP_ATTRIBUTE(format)
// GCC and Clang compilers will perform printf format type checks, useful for catching format errors.
#define __FCEU_PRINTF_FORMAT
#define __FCEU_PRINTF_ATTRIBUTE( fmt, va ) __attribute__((__format__(__printf__, fmt, va)))