#endif
#endif
+/* Enable the use of the non-standard keyword CC_ATTRIBUTE to silence warnings under some compilers */
+#if defined(__GUNC__) || defined(__clang__) || defined(USE_CC_ATTRIBUTE)
+ #define CC_ATTRIBUTE(_x) __attribute__ ((_x))
+#else
+ #define CC_ATTRIBUTE(_x)
+#endif
/* Note our global private identifiers end with '__' to mitigate risk of clash
* with the unit tests implementation. */
#define TEST_COLOR_GREEN_INTENSIVE__ 4
#define TEST_COLOR_RED_INTENSIVE__ 5
-static int __attribute__((format (printf, 2, 3)))
+static int CC_ATTRIBUTE(format (printf, 2, 3))
test_print_in_color__(int color, const char* fmt, ...)
{
va_list args;
printf("%.*s", n, spaces);
}
-int __attribute__((format (printf, 4, 5)))
+int CC_ATTRIBUTE(format (printf, 4, 5))
test_check__(int cond, const char* file, int line, const char* fmt, ...)
{
const char *result_str;
return !test_cond_failed__;
}
-void __attribute__((format (printf, 1, 2)))
+void CC_ATTRIBUTE(format (printf, 1, 2))
test_case__(const char* fmt, ...)
{
va_list args;
}
}
-void __attribute__((format (printf, 1, 2)))
+void CC_ATTRIBUTE(format (printf, 1, 2))
test_message__(const char* fmt, ...)
{
char buffer[TEST_MSG_MAXSIZE];
/* Called if anything goes bad in Acutest, or if the unit test ends in other
* way then by normal returning from its function (e.g. exception or some
* abnormal child process termination). */
-static void __attribute__((format (printf, 1, 2)))
+static void CC_ATTRIBUTE(format (printf, 1, 2))
test_error__(const char* fmt, ...)
{
va_list args;