Skip to content

Commit bbf7b0c

Browse files
committed
add extern "C" guards
1 parent ec6c6df commit bbf7b0c

3 files changed

Lines changed: 23 additions & 4 deletions

File tree

include/mruby/data.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
** See Copyright Notice in mruby.h
55
*/
66

7-
#ifndef RUBY_DATA_H
8-
#define RUBY_DATA_H 1
7+
#ifndef MRUBY_DATA_H
8+
#define MRUBY_DATA_H 1
99

1010
#if defined(__cplusplus)
1111
extern "C" {
1212
#endif
1313

14-
1514
struct mrb_data_type {
1615
const char *struct_name;
1716
void (*dfree)(mrb_state *mrb, void*);
@@ -48,4 +47,4 @@ void *mrb_check_datatype(mrb_state *mrb, mrb_value, const struct mrb_data_type*)
4847
} /* extern "C" { */
4948
#endif
5049

51-
#endif /* RUBY_DATA_H */
50+
#endif /* MRUBY_DATA_H */

src/compile.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
** See Copyright Notice in mruby.h
55
*/
66

7+
#ifndef RUBY_COMPILE_H
8+
#define RUBY_COMPILE_H 1
9+
10+
#if defined(__cplusplus)
11+
extern "C" {
12+
#endif
13+
714
#include "mruby.h"
815
#include <stdio.h>
916
#include <setjmp.h>
@@ -93,3 +100,8 @@ int mrb_compile_file(mrb_state*,FILE*);
93100
int mrb_compile_string(mrb_state*,char*);
94101
int mrb_compile_nstring(mrb_state*,char*,size_t);
95102

103+
#if defined(__cplusplus)
104+
} /* extern "C" { */
105+
#endif
106+
107+
#endif /* MRUBY_COMPILE_H */

src/gc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#ifndef MRUBY_GC_H
88
#define MRUBY_GC_H
99

10+
#if defined(__cplusplus)
11+
extern "C" {
12+
#endif
13+
1014
typedef struct {
1115
union {
1216
struct free_obj {
@@ -41,4 +45,8 @@ void mrb_gc_mark_ht(mrb_state*, struct RHash*);
4145
size_t mrb_gc_mark_ht_size(mrb_state*, struct RHash*);
4246
void mrb_gc_free_ht(mrb_state*, struct RHash*);
4347

48+
#if defined(__cplusplus)
49+
} /* extern "C" { */
50+
#endif
51+
4452
#endif /* MRUBY_GC_H */

0 commit comments

Comments
 (0)