File tree Expand file tree Collapse file tree 2 files changed +25
-19
lines changed Expand file tree Collapse file tree 2 files changed +25
-19
lines changed Original file line number Diff line number Diff line change @@ -27,30 +27,15 @@ const char *irep_ids_table[]=
27
27
28
28
#ifdef USE_DSTRING
29
29
30
- enum class idt :unsigned
31
- {
32
- #define IREP_ID_ONE (the_id ) id_##the_id,
33
- #define IREP_ID_TWO (the_id, str ) id_##the_id,
34
-
35
- #include " irep_ids.def" // NOLINT(build/include)
36
- };
37
-
38
- #define IREP_ID_ONE (the_id ) \
39
- const dstringt ID_##the_id=dstringt::make_from_table_index( \
40
- static_cast <unsigned >(idt::id_##the_id));
41
- #define IREP_ID_TWO (the_id, str ) \
42
- const dstringt ID_##the_id=dstringt::make_from_table_index( \
43
- static_cast <unsigned >(idt::id_##the_id));
44
-
45
30
#else
46
31
47
32
#define IREP_ID_ONE (the_id ) const std::string ID_##the_id(#the_id);
48
33
#define IREP_ID_TWO (the_id, str ) const std::string ID_##the_id(#the_id);
49
34
50
- #endif
51
-
52
35
#include " irep_ids.def" // NOLINT(build/include)
53
36
37
+ #endif
38
+
54
39
string_containert::string_containert ()
55
40
{
56
41
// pre-allocate empty string -- this gets index 0
Original file line number Diff line number Diff line change 35
35
36
36
#ifdef USE_DSTRING
37
37
38
- #define IREP_ID_ONE (the_id ) extern const dstringt ID_##the_id;
39
- #define IREP_ID_TWO (the_id, str ) extern const dstringt ID_##the_id;
38
+ enum class idt :unsigned
39
+ {
40
+ #define IREP_ID_ONE (the_id ) id_##the_id,
41
+ #define IREP_ID_TWO (the_id, str ) id_##the_id,
42
+
43
+ #include " irep_ids.def" // NOLINT(build/include)
44
+ };
45
+
46
+ #ifdef __GNUC__
47
+ #define IREP_ID_ONE (the_id ) \
48
+ constexpr dstringt ID_##the_id=dstringt::make_from_table_index( \
49
+ static_cast <unsigned >(idt::id_##the_id));
50
+ #define IREP_ID_TWO (the_id, str ) \
51
+ constexpr dstringt ID_##the_id=dstringt::make_from_table_index( \
52
+ static_cast <unsigned >(idt::id_##the_id));
53
+ #else
54
+ #define IREP_ID_ONE (the_id ) \
55
+ const dstringt ID_##the_id=dstringt::make_from_table_index( \
56
+ static_cast <unsigned >(idt::id_##the_id));
57
+ #define IREP_ID_TWO (the_id, str ) \
58
+ const const dstringt ID_##the_id=dstringt::make_from_table_index( \
59
+ static_cast <unsigned >(idt::id_##the_id));
60
+ #endif
40
61
41
62
#else
42
63
You can’t perform that action at this time.
0 commit comments