summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-05-18 12:45:09 +0900
committerYukihiro Matsumoto <[email protected]>2012-05-18 12:45:09 +0900
commitbbf7b0ceba117e30662f9e2459d9c06360950a10 (patch)
tree0398e37b768db379966170fdaeb5fae163dd1d11 /src
parentec6c6df9953745d78577898dd62ab81f38e8dda6 (diff)
downloadmruby-bbf7b0ceba117e30662f9e2459d9c06360950a10.tar.gz
mruby-bbf7b0ceba117e30662f9e2459d9c06360950a10.zip
add extern "C" guards
Diffstat (limited to 'src')
-rw-r--r--src/compile.h12
-rw-r--r--src/gc.h8
2 files changed, 20 insertions, 0 deletions
diff --git a/src/compile.h b/src/compile.h
index 7afa82e76..3cebb68f0 100644
--- a/src/compile.h
+++ b/src/compile.h
@@ -4,6 +4,13 @@
** See Copyright Notice in mruby.h
*/
+#ifndef RUBY_COMPILE_H
+#define RUBY_COMPILE_H 1
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
#include "mruby.h"
#include <stdio.h>
#include <setjmp.h>
@@ -93,3 +100,8 @@ int mrb_compile_file(mrb_state*,FILE*);
int mrb_compile_string(mrb_state*,char*);
int mrb_compile_nstring(mrb_state*,char*,size_t);
+#if defined(__cplusplus)
+} /* extern "C" { */
+#endif
+
+#endif /* MRUBY_COMPILE_H */
diff --git a/src/gc.h b/src/gc.h
index 61f8ce96a..0a4bc1c51 100644
--- a/src/gc.h
+++ b/src/gc.h
@@ -7,6 +7,10 @@
#ifndef MRUBY_GC_H
#define MRUBY_GC_H
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
typedef struct {
union {
struct free_obj {
@@ -41,4 +45,8 @@ void mrb_gc_mark_ht(mrb_state*, struct RHash*);
size_t mrb_gc_mark_ht_size(mrb_state*, struct RHash*);
void mrb_gc_free_ht(mrb_state*, struct RHash*);
+#if defined(__cplusplus)
+} /* extern "C" { */
+#endif
+
#endif /* MRUBY_GC_H */