HPCToolkit
fence_enum.h
Go to the documentation of this file.
1 #ifndef FENCE_ENUM
2 #define FENCE_ENUM
3 
4 #define FENCE_ENUMS \
5  _MM(NONE) \
6  _MM(MAIN) \
7  _MM(THREAD) \
8  _MM(TRAMP) \
9  _MM(BAD)
10 
11 typedef enum {
12 #define _MM(a) FENCE_ ## a,
14 #undef _MM
15 } fence_enum_t;
16 
17 static char* fence_enum_names[] = {
18 #define _MM(a) [FENCE_ ## a] = "FENCE_" #a,
20 #undef _MM
21 };
22 
23 static inline char*
25 {
26  if (f < FENCE_NONE || f > FENCE_BAD)
27  return "FENCE_UNINITIALIZED!!";
28  return fence_enum_names[f];
29 }
30 
31 #endif // FENCE_ENUM
fence_enum_t
Definition: fence_enum.h:11
#define FENCE_ENUMS
Definition: fence_enum.h:4
static char * fence_enum_names[]
Definition: fence_enum.h:17
static char * fence_enum_name(fence_enum_t f)
Definition: fence_enum.h:24