summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-31 06:34:10 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-31 06:34:10 +0000
commit17c3d539f008c3ad4179e520511b6a64fb4ba969 (patch)
tree6a277eed8c128f9212b0ef8316750e697701059d /string.c
parentdc136c12ee4d704de7621408ab0a5d9108284b45 (diff)
* ruby.h: use ifdef (or defined) for macro constants that may or
may not be defined to shut up gcc's -Wundef warnings. [ruby-core:08447] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index fb8be9dca4..83ac1e486c 100644
--- a/string.c
+++ b/string.c
@@ -856,7 +856,7 @@ rb_str_hash(str)
register char *p = RSTRING(str)->ptr;
register int key = 0;
-#ifdef HASH_ELFHASH
+#if defined(HASH_ELFHASH)
register unsigned int g;
while (len--) {
@@ -865,7 +865,7 @@ rb_str_hash(str)
key ^= g >> 24;
key &= ~g;
}
-#elif HASH_PERL
+#elif defined(HASH_PERL)
while (len--) {
key += *p++;
key += (key << 10);