I wrote a macro I use to perform an action every given time interval:
#define DO_ONLY_EVERY_SEC(every_sec) DO_ONLY_EVERY_SEC_LBL(every_sec, def)
#define DO_ONLY_EVERY_SEC_LBL(every_sec, lbl) \ static float nextT##lbl = 0.f; \ bool _bDo##lbl = (GetCurrentTime() > nextT##lbl); \ if (_bDo##lbl) \ nextT##lbl = GetCurrentTime() + every_sec; \ if (_bDo##lbl)
This doesn't work well with VA; variables introduced inside the scope of the macro aren't recognized, and are often underlined.
For instance,
DO_ONLY_EVERY_SEC(1.f)
{
static int test = 0;
tes
}
Generates no suggestion box.
If I comment out the
DO_ONLY_EVERY_SEC(1.f)
then "test" is suggested when I type "t" or "te".
vs2013, VA 10.9.2068.0