From: Alain Spineux Date: Thu, 8 Sep 2022 11:54:07 +0000 (+0200) Subject: Fix #9455 test-cpp.c in 14.0.5 don't compile on freebsd X-Git-Tag: Beta-15.0.0~516 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ac072a061eebd42559029fc5e2b40f102ddbd3d;p=thirdparty%2Fbacula.git Fix #9455 test-cpp.c in 14.0.5 don't compile on freebsd - fixed the elegant way :-) --- diff --git a/bacula/.gitignore b/bacula/.gitignore index 3b8c271db..c533a43b7 100644 --- a/bacula/.gitignore +++ b/bacula/.gitignore @@ -570,6 +570,7 @@ src/tools/ing_test src/tools/bregex src/tools/bwild src/tools/testls +src/tools/test-cpp src/tools/1 src/tools/Makefile src/tools/dbcheck diff --git a/bacula/src/tools/test-cpp.c b/bacula/src/tools/test-cpp.c index c7edb2625..b6ea5899c 100644 --- a/bacula/src/tools/test-cpp.c +++ b/bacula/src/tools/test-cpp.c @@ -25,14 +25,16 @@ /* These macro are defined in src/baconfig.h */ #if __cplusplus >= 201103L # define bdelete_and_null_auto(a) do{if(a){auto b__ = a; (a)=NULL; delete b__;}} while(0) +# define TEST_AUTO { ok(1, "auto available"); } #else -# define bdelete_and_null_auto(a) do{ok(1, "auto not available");}while(0) +# define TEST_AUTO { ok(1, "auto not available"); } #endif # ifdef HAVE_TYPEOF -# define bdelete_and_null_typeof(a) do{if(a){typeof(a) b__ = a; (a)=NULL; delete b__;}} while(0) +# define bdelete_and_null_typeof(a) do{if(a){typeof(a) b__ = a; (a)=NULL; delete b__;}} while(0) +# define TEST_TYPEOF { ok(1, "typeof available"); } # else -# define bdelete_and_null_typeof(a) do{ok(1, "typeof not available");}while(0) +# define TEST_TYPEOF { ok(1, "typeof not available"); } #endif class obj @@ -46,6 +48,8 @@ int main() { Unittests alist_test("test-cpp"); log("Test C++ Features ..."); + TEST_AUTO; + TEST_TYPEOF; obj *a = new obj(); obj *b = new obj(); char *c = (char *)malloc(10);