1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use inline function with stable code instead of macro

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2018-10-21 16:37:24 +00:00
parent e6202c41b5
commit 6018bc5e73

View file

@ -159,9 +159,25 @@ typedef struct obj_info {
struct dwarf_section debug_str;
struct obj_info *next;
} obj_info_t;
#define obj_dwarf_section_at(obj,n) (&obj->debug_abbrev + n)
#define DWARF_SECTION_COUNT 5
static struct dwarf_section *
obj_dwarf_section_at(obj_info_t *obj, int n)
{
struct dwarf_section *ary[] = {
&obj->debug_abbrev,
&obj->debug_info,
&obj->debug_line,
&obj->debug_ranges,
&obj->debug_str
};
if (n < 0 || DWARF_SECTION_COUNT <= n) {
abort();
}
return ary[n];
}
struct debug_section_definition {
const char *name;
struct dwarf_section *dwarf;