Don't generate empty statements in DeterministicScheduleTest
authorChristopher Dykes <cdykes@fb.com>
Wed, 9 Nov 2016 22:35:17 +0000 (14:35 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Wed, 9 Nov 2016 22:38:40 +0000 (14:38 -0800)
Summary: Because MSVC generates warnings if you have a control-flow statement followed by a single trailing semicolon.

Reviewed By: yfeldblum

Differential Revision: D4155588

fbshipit-source-id: dfd8774fc6a62675764f7e069c26b799b622a9af

folly/test/DeterministicScheduleTest.cpp

index bdf7ebcbe85a37f4dfda0b74c886d21c3990fb43..2dc67e532d0ee3931352bd4bdaa72a71e74e674e 100644 (file)
@@ -234,17 +234,17 @@ DEFINE_bool(bug, false, "Introduce bug");
 
 /** Macro for inline definition of auxiliary actions */
 #define AUX_ACT(act)                          \
-  {                                           \
+  do {                                        \
     AUX_THR(func_) = __func__;                \
     AUX_THR(line_) = __LINE__;                \
     AuxAct auxfn(                             \
       [&](bool success) {                     \
-        if (success);                         \
+        if (success) {}                       \
         if (true) {act}                       \
       }                                       \
     );                                        \
     DeterministicSchedule::setAuxAct(auxfn);  \
-  }
+  } while (0)
 
 /** Alias for original class */
 template <typename T>