Nobuyoshi Nakada
9/18/2006 2:53:00 AM
Hi,
At Mon, 18 Sep 2006 01:06:07 +0900,
Bil Kleb wrote in [ruby-talk:214856]:
> > RFILE seems redefined somewhere after here.
>
> But I can't find another RFILE in /ext/openssl or below...
`Somewhere' inside <openssl/*.h> below it.
> $ cd /ext/openssl && grep -nr RFILE *
> ossl.h:21:* OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
> ossl.h:23:#if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
> ossl.h:24:# undef RFILE
>
> Suggestions?
Moving the code block after #include lines of openssl. Try
this patch.
Index: ext/openssl/ossl.h
===================================================================
RCS file: /cvs/ruby/src/ruby/ext/openssl/ossl.h,v
retrieving revision 1.14.2.4
diff -p -u -2 -r1.14.2.4 ossl.h
--- ext/openssl/ossl.h 27 Jul 2006 07:45:33 -0000 1.14.2.4
+++ ext/openssl/ossl.h 18 Sep 2006 02:49:17 -0000
@@ -16,14 +16,13 @@
#if defined(__cplusplus)
extern "C" {
+#elif 0
+}
#endif
/*
-* OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
-*/
-#if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
-# undef RFILE
-#endif
-#include <ruby.h>
-#include <rubyio.h>
+ *_FILE_OFFSET_BITS needs to be defined before some system headers on
+ * Solaris.
+ */
+#include "config.h"
/*
@@ -70,4 +69,13 @@ extern "C" {
/*
+* OpenSSL has defined RFILE and Ruby has defined RFILE - so undef it!
+*/
+#if defined(RFILE) /*&& !defined(OSSL_DEBUG)*/
+# undef RFILE
+#endif
+#include <ruby.h>
+#include <rubyio.h>
+
+/*
* Common Module
*/
@@ -212,5 +220,7 @@ void ossl_debug(const char *, ...);
void Init_openssl(void);
-#if defined(__cplusplus)
+#if 0
+{
+#elif defined(__cplusplus)
}
#endif
--
Nobu Nakada