Workaround 'condition is always false' VC++ warning in test_cpp
authorIvan Maidanski <ivmai@mail.ru>
Mon, 25 Jun 2018 04:00:21 +0000 (07:00 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 25 Jun 2018 04:00:21 +0000 (07:00 +0300)
(fix of commit 5524a425d)

* tests/test_cpp.cc (GC_CHECKED_DELETE): Remove "do" and "while (0)".

tests/test_cpp.cc

index 840442f..43f034b 100644 (file)
@@ -238,12 +238,12 @@ void* Undisguise( GC_word i ) {
     return (void*) ~ i;}
 
 #define GC_CHECKED_DELETE(p) \
-    do { \
+    { \
       size_t freed_before = GC_get_expl_freed_bytes_since_gc(); \
       delete p; /* the operator should invoke GC_FREE() */ \
       size_t freed_after = GC_get_expl_freed_bytes_since_gc(); \
       my_assert(freed_before != freed_after); \
-    } while (0)
+    }
 
 #if ((defined(MSWIN32) && !defined(__MINGW32__)) || defined(MSWINCE)) \
     && !defined(NO_WINMAIN_ENTRY)