summaryrefslogtreecommitdiff
path: root/constant.h
diff options
context:
space:
mode:
Diffstat (limited to 'constant.h')
-rw-r--r--constant.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/constant.h b/constant.h
index c7de5da533..23d17ac24c 100644
--- a/constant.h
+++ b/constant.h
@@ -12,15 +12,21 @@
#define CONSTANT_H
typedef enum {
+ CONST_DEPRECATED = 0x100,
+
+ CONST_VISIBILITY_MASK = 0xff,
CONST_PUBLIC = 0x00,
CONST_PRIVATE,
CONST_VISIBILITY_MAX
} rb_const_flag_t;
#define RB_CONST_PRIVATE_P(ce) \
- ((ce)->flag == CONST_PRIVATE)
+ (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE)
#define RB_CONST_PUBLIC_P(ce) \
- ((ce)->flag == CONST_PUBLIC)
+ (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PUBLIC)
+
+#define RB_CONST_DEPRECATED_P(ce) \
+ ((ce)->flag & CONST_DEPRECATED)
typedef struct rb_const_entry_struct {
rb_const_flag_t flag;
@@ -31,6 +37,7 @@ typedef struct rb_const_entry_struct {
VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj);
VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj);
+VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj);
void rb_free_const_table(st_table *tbl);
VALUE rb_public_const_get(VALUE klass, ID id);
VALUE rb_public_const_get_at(VALUE klass, ID id);