From: hugo303 Date: Tue, 29 Mar 2005 14:30:06 +0000 (+0000) Subject: Fixed gcc 2.95.3 compatibility for VA_ARGS in fail_if X-Git-Tag: 0.10.0~923 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83ce84324672b0bbc0498dced8f9a9ef967c8c65;p=check Fixed gcc 2.95.3 compatibility for VA_ARGS in fail_if git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@228 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/check/ChangeLog b/check/ChangeLog index 44ab5e8..9cdb9df 100644 --- a/check/ChangeLog +++ b/check/ChangeLog @@ -1,3 +1,8 @@ +2005-03-29 hugo303 + + * src/check.h.in: Fixed compatibility with gcc 2.95.3 according + to sourceforge patch #1161654. + 2005-03-02 hugo303 * src/check.h.in: Added define for NULL if needed. diff --git a/check/src/check.h.in b/check/src/check.h.in index 594f5c2..657363d 100644 --- a/check/src/check.h.in +++ b/check/src/check.h.in @@ -164,14 +164,20 @@ static void __testname (void)\ #define END_TEST } /* Fail the test case unless expr is true */ +/* The space before the comma sign before ## is essential to be compatible + with gcc 2.95.3 and earlier. +*/ #define fail_unless(expr, ...)\ _fail_unless(expr, __FILE__, __LINE__,\ "Assertion '"#expr"' failed" , ## __VA_ARGS__, NULL) /* Fail the test case if expr is true */ +/* The space before the comma sign before ## is essential to be compatible + with gcc 2.95.3 and earlier. +*/ #define fail_if(expr, ...)\ _fail_unless(!(expr), __FILE__, __LINE__,\ - "Failure '"#expr"' occured", ## __VA_ARGS__, NULL) + "Failure '"#expr"' occured" , ## __VA_ARGS__, NULL) /* Always fail */ #define fail(...) _fail_unless(0, __FILE__, __LINE__, "Failed" , ## __VA_ARGS__, NULL)