diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-10 07:18:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-10 07:18:03 +0000 |
commit | b80c265fa46d9ce3e116c0746341ec1b5dfac1cb (patch) | |
tree | 2a7661064529118c8d3e2c6450021b5290ee8f14 /debug_counter.c | |
parent | ac3b77c98ef09b2e93d2483dfb9995f86b9a5c82 (diff) | |
download | ruby-b80c265fa46d9ce3e116c0746341ec1b5dfac1cb.tar.gz |
debug_counter.c: debug_counter_names [ci skip]
* debug_counter.c (debug_counter_names): stringize debug counter
names by preprocessor.
* debug_counter.h (RB_DEBUG_COUNTER): define counter names outside
the include guard, to expand multiple times.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'debug_counter.c')
-rw-r--r-- | debug_counter.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/debug_counter.c b/debug_counter.c index 7c23354df1..6000f98c54 100644 --- a/debug_counter.c +++ b/debug_counter.c @@ -12,14 +12,16 @@ #include <stdio.h> #if USE_DEBUG_COUNTER +#include "internal.h" -/* do not modify manually. use a script above */ -const char * const debug_counter_names[] = { -#include "debug_counter_names.inc" +static const char *const debug_counter_names[] = { "" +#define RB_DEBUG_COUNTER(name) #name, +#include "debug_counter.h" +#undef RB_DEBUG_COUNTER }; -size_t rb_debug_counter[RB_DEBUG_COUNTER_MAX + 1]; +size_t rb_debug_counter[numberof(debug_counter_names)]; __attribute__((destructor)) static void |