]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #9455 test-cpp.c in 14.0.5 don't compile on freebsd
authorAlain Spineux <alain@baculasystems.com>
Thu, 8 Sep 2022 11:54:07 +0000 (13:54 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:58 +0000 (13:56 +0200)
- fixed the elegant way :-)

bacula/.gitignore
bacula/src/tools/test-cpp.c

index 3b8c271db6e7e399e922a5f4bd94a39c70a6bf73..c533a43b70e853c20acc8f8c8debc4b0058fc315 100644 (file)
@@ -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
index c7edb26259ef11518777858e22b867c2ee1932cb..b6ea5899c0dbbcf00b7e168f0c50e31c96a187c7 100644 (file)
 /* 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);