Define |OPENSSL_PRINTF_FORMAT_FUNC| for format string annotations. This centralizes the conditional logic into openssl/base.h so that it doesn't have to be repeated. The name |OPENSSL_PRINTF_FORMAT_FUNC| was chosen in anticipation of eventually defining an |OPENSSL_PRINTF_FORMAT_ARG| for MSVC-style parameter annotations. Change-Id: I273e6eddd209e696dc9f82099008c35b6d477cdb Reviewed-on: https://boringssl-review.googlesource.com/6909 Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/include/openssl/bio.h b/include/openssl/bio.h index c88a3e1..0c8bfe4 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h
@@ -312,14 +312,8 @@ * * These functions are versions of printf functions that output to a BIO rather * than a FILE. */ -#ifdef __GNUC__ -#define __bio_h__attr__ __attribute__ -#else -#define __bio_h__attr__(x) -#endif OPENSSL_EXPORT int BIO_printf(BIO *bio, const char *format, ...) - __bio_h__attr__((__format__(__printf__, 2, 3))); -#undef __bio_h__attr__ + OPENSSL_PRINTF_FORMAT_FUNC(2, 3); /* Utility functions. */