Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add extern "C" guards

  • Loading branch information...
commit bbf7b0ceba117e30662f9e2459d9c06360950a10 1 parent ec6c6df
@matz matz authored
Showing with 23 additions and 4 deletions.
  1. +3 −4 include/mruby/data.h
  2. +12 −0 src/compile.h
  3. +8 −0 src/gc.h
View
7 include/mruby/data.h
@@ -4,14 +4,13 @@
** See Copyright Notice in mruby.h
*/
-#ifndef RUBY_DATA_H
-#define RUBY_DATA_H 1
+#ifndef MRUBY_DATA_H
+#define MRUBY_DATA_H 1
#if defined(__cplusplus)
extern "C" {
#endif
-
struct mrb_data_type {
const char *struct_name;
void (*dfree)(mrb_state *mrb, void*);
@@ -48,4 +47,4 @@ void *mrb_check_datatype(mrb_state *mrb, mrb_value, const struct mrb_data_type*)
} /* extern "C" { */
#endif
-#endif /* RUBY_DATA_H */
+#endif /* MRUBY_DATA_H */
View
12 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 */
View
8 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 */

1 comment on commit bbf7b0c

@mattn

s/ RUBY_COMPILE_H/ MRUBY_COMPILE_H/g

Please sign in to comment.
Something went wrong with that request. Please try again.