Skip to content

Commit 72d21cd

Browse files
authored
Fixes review nitpick (#168)
1 parent aaa9047 commit 72d21cd

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/profiler/include/macros.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
#ifndef __MACROS_H_
22
#define __MACROS_H_
33

4+
#ifdef PROFILER
5+
46
#include "internal/profiler_c.h"
57
#include "rdtsc.h"
68

7-
#ifdef PROFILER
8-
99
#define PROFILER_SETUP() prof_start();
1010

1111
#define PROFILER_STOP(fp) \
12-
prof_stop(); \
13-
prof_print(fp);
12+
do { \
13+
prof_stop(); \
14+
prof_print(fp); \
15+
} while (0)
1416

1517
#define _NameConcat(A, B) A##B
1618
#define NameConcat(A, B) _NameConcat(A, B)

0 commit comments

Comments
 (0)