From: nobu.nakada@... Date: 2001-12-21T15:52:31+09:00 Subject: [ruby-dev:15517] prototypes in headers なかだです。 Cでだとプロトタイプが使えないという環境で、C++でコンパイルする とプロトタイプが無効になってしまっているような気がします。そん な環境が実際にあるのかはちょっと疑問ですが。 それと、ruby.hのinline関数にはせっかくプロトタイプがあるので、 C++のときだけじゃなくてHAVE_PROTOTYPESのときも有効にしといても いいんじゃないでしょうか。 Index: dln.h =================================================================== RCS file: /cvs/ruby/src/ruby/dln.h,v retrieving revision 1.6 diff -u -2 -p -r1.6 dln.h --- dln.h 2001/05/02 04:22:10 1.6 +++ dln.h 2001/12/21 06:47:33 @@ -14,4 +14,13 @@ #define DLN_H +#ifdef __cplusplus +# ifndef HAVE_PROTOTYPES +# define HAVE_PROTOTYPES 1 +# endif +# ifndef HAVE_STDARG_PROTOTYPES +# define HAVE_STDARG_PROTOTYPES 1 +# endif +#endif + #undef _ #ifdef HAVE_PROTOTYPES Index: ruby.h =================================================================== RCS file: /cvs/ruby/src/ruby/ruby.h,v retrieving revision 1.56 diff -u -2 -p -r1.56 ruby.h --- ruby.h 2001/12/17 07:52:35 1.56 +++ ruby.h 2001/12/21 06:47:24 @@ -53,4 +53,13 @@ extern "C" { #endif +#ifdef __cplusplus +# ifndef HAVE_PROTOTYPES +# define HAVE_PROTOTYPES 1 +# endif +# ifndef HAVE_STDARG_PROTOTYPES +# define HAVE_STDARG_PROTOTYPES 1 +# endif +#endif + #undef _ #ifdef HAVE_PROTOTYPES @@ -583,5 +592,5 @@ EXTERN VALUE rb_defout, rb_stdin, rb_std static inline VALUE -#if defined(__cplusplus) +#if defined(HAVE_PROTOTYPES) rb_class_of(VALUE obj) #else @@ -600,5 +609,5 @@ rb_class_of(obj) static inline int -#if defined(__cplusplus) +#if defined(HAVE_PROTOTYPES) rb_type(VALUE obj) #else @@ -617,5 +626,5 @@ rb_type(obj) static inline int -#if defined(__cplusplus) +#if defined(HAVE_PROTOTYPES) rb_special_const_p(VALUE obj) #else Index: util.h =================================================================== RCS file: /cvs/ruby/src/ruby/util.h,v retrieving revision 1.8 diff -u -2 -p -r1.8 util.h --- util.h 2001/12/10 14:43:37 1.8 +++ util.h 2001/12/21 06:49:36 @@ -15,4 +15,12 @@ #ifndef _ +#ifdef __cplusplus +# ifndef HAVE_PROTOTYPES +# define HAVE_PROTOTYPES 1 +# endif +# ifndef HAVE_STDARG_PROTOTYPES +# define HAVE_STDARG_PROTOTYPES 1 +# endif +#endif #ifdef HAVE_PROTOTYPES # define _(args) args -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦