Project

General

Profile

Actions

Backport #6748

closed

bignum.c does not compile

Added by pedz (Perry Smith) over 11 years ago. Updated over 11 years ago.

Status:
Closed
[ruby-core:46534]

Description

I'm using the ruby_1_9_3 branch of ruby/ruby on github and bignum.c does not compile with an error that ffs is not defined.

I'm on AIX 6.1 TL07 SP03.

I assume HAVE_STRING_H is set (because AIX has string.h and strings.h) so ruby/ruby.h includes string.h but ffs is defined in strings.h.

I noticed that time.c also uses ffs and it simply includes strings.h from within a #if construct.

Adding:
diff --git a/bignum.c b/bignum.c
index 8d024fe..0439062 100644
--- a/bignum.c
+++ b/bignum.c
@@ -13,6 +13,9 @@
#include "ruby/util.h"
#include "internal.h"

+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
#include <math.h>
#include <float.h>
#include <ctype.h>

resolves the issue.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0