diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-22 07:15:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-22 07:15:56 +0000 |
commit | 1656b70c0e3eea3e0484c9862134e275cd1af07a (patch) | |
tree | fafabd86da82a147feab10987529cd922b070623 /internal.h | |
parent | f66f998241da20335979c7330acdd6eaa1c52ee0 (diff) | |
download | ruby-1656b70c0e3eea3e0484c9862134e275cd1af07a.tar.gz |
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.h | 2 |
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; |