summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-22 07:15:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-22 07:15:56 +0000
commit1656b70c0e3eea3e0484c9862134e275cd1af07a (patch)
treefafabd86da82a147feab10987529cd922b070623 /internal.h
parentf66f998241da20335979c7330acdd6eaa1c52ee0 (diff)
internal.h: shortcut macros
* internal.h (RRATIONAL_SET_{NUM,DEN}): shortcut macros for internal only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 949c6f8a42..dc3862323a 100644
--- a/internal.h
+++ b/internal.h
@@ -390,6 +390,8 @@ struct RRational {
};
#define RRATIONAL(obj) (R_CAST(RRational)(obj))
+#define RRATIONAL_SET_NUM(rat, n) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->num,(n))
+#define RRATIONAL_SET_DEN(rat, d) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->den,(d))
struct RFloat {
struct RBasic basic;