aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--dln.h9
-rw-r--r--ruby.h15
-rw-r--r--util.h8
4 files changed, 33 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a5771c40c..68db002dd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Dec 21 16:18:17 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
+
+ * dln.h, ruby.h, util.h: enable prototypes in C++.
+
Fri Dec 21 03:15:52 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* eval.c (rb_mod_define_method): must not convert Method to Proc.
diff --git a/dln.h b/dln.h
index 1a7e002551..c6f9654eb6 100644
--- a/dln.h
+++ b/dln.h
@@ -13,6 +13,15 @@
#ifndef DLN_H
#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
# define _(args) args
diff --git a/ruby.h b/ruby.h
index e5ff9769e4..4de8b88746 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)
diff --git a/util.h b/util.h
index 60e0ff4f60..51f32d0179 100644
--- a/util.h
+++ b/util.h
@@ -14,6 +14,14 @@
#define UTIL_H
#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
#else