summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-25 13:57:01 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-25 13:57:01 +0000
commitb134b912780e0fd84fbc107a9362e45f04391b47 (patch)
tree3aad53ec0421149c8fb9e163379bba8efb2ab42e /class.c
parent4ec25bdd63c8cb9acf70880666c1d113ae0cb51e (diff)
* various files: macro fix-up by Michal Rokos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/class.c b/class.c
index 4856535..1ead9b0 100644
--- a/class.c
+++ b/class.c
@@ -661,19 +661,23 @@ rb_undef_method(klass, name)
#if 0
-#define SPECIAL_SINGLETON(x,c) if (obj == (x)) {\
- if (!FL_TEST(c, FL_SINGLETON)) {\
- c = rb_singleton_class_new(c);\
- rb_singleton_class_attached(c,obj);\
+#define SPECIAL_SINGLETON(x,c) do {
+ if (obj == (x)) {\
+ if (!FL_TEST(c, FL_SINGLETON)) {\
+ c = rb_singleton_class_new(c);\
+ rb_singleton_class_attached(c,obj);\
+ }\
+ return c;\
}\
- return c;\
-}
+} while (0)
#else
-#define SPECIAL_SINGLETON(x,c) if (obj == (x)) {\
- return c;\
-}
+#define SPECIAL_SINGLETON(x,c) do {\
+ if (obj == (x)) {\
+ return c;\
+ }\
+} while (0)
#endif