From f4b24c219b149c8b202035ccba19cfa5341c8002 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 21 Dec 2001 07:20:23 +0000 Subject: * dln.h, ruby.h, util.h: enable prototypes in C++. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'ruby.h') diff --git a/ruby.h b/ruby.h index e5ff9769e..4de8b8874 100644 --- a/ruby.h +++ b/ruby.h @@ -52,6 +52,15 @@ extern "C" { # define volatile #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 # define _(args) args @@ -582,7 +591,7 @@ EXTERN VALUE rb_eLoadError; EXTERN VALUE rb_defout, rb_stdin, rb_stdout, rb_stderr, ruby_errinfo; static inline VALUE -#if defined(__cplusplus) +#if defined(HAVE_PROTOTYPES) rb_class_of(VALUE obj) #else rb_class_of(obj) @@ -599,7 +608,7 @@ rb_class_of(obj) } static inline int -#if defined(__cplusplus) +#if defined(HAVE_PROTOTYPES) rb_type(VALUE obj) #else rb_type(obj) @@ -616,7 +625,7 @@ rb_type(obj) } static inline int -#if defined(__cplusplus) +#if defined(HAVE_PROTOTYPES) rb_special_const_p(VALUE obj) #else rb_special_const_p(obj) -- cgit