mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #3639 from Asmod4n/patch-1
Add macOS support to mrb_ro_data_p
This commit is contained in:
@@ -266,6 +266,14 @@ mrb_undef_value(void)
|
||||
}
|
||||
|
||||
#ifdef MRB_USE_ETEXT_EDATA
|
||||
#if (defined(__APPLE__) && defined(__MACH__))
|
||||
#include <mach-o/getsect.h>
|
||||
static inline mrb_bool
|
||||
mrb_ro_data_p(const char *p)
|
||||
{
|
||||
return (const char*)get_etext() < p && p < (const char*)get_edata();
|
||||
}
|
||||
#else
|
||||
extern char _etext[];
|
||||
#ifdef MRB_NO_INIT_ARRAY_START
|
||||
extern char _edata[];
|
||||
@@ -284,6 +292,7 @@ mrb_ro_data_p(const char *p)
|
||||
return _etext < p && p < (char*)&__init_array_start;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
# define mrb_ro_data_p(p) FALSE
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user