Skip to content

Commit 0e8c41d

Browse files
committed
Fix header includes
1 parent 9de9a01 commit 0e8c41d

File tree

8 files changed

+38
-0
lines changed

8 files changed

+38
-0
lines changed

ext/rbs_extension/ast_translation.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
#ifndef RBS_EXTENSION_AST_TRANSLATION_H
99
#define RBS_EXTENSION_AST_TRANSLATION_H
1010

11+
#include "compat.h"
12+
13+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
1114
#include "ruby.h"
1215
#include "ruby/encoding.h"
16+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
1317

1418
#include "rbs/ast.h"
1519
#include "rbs/location.h"

ext/rbs_extension/class_constants.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
#ifndef RBS__CONSTANTS_H
99
#define RBS__CONSTANTS_H
1010

11+
#include "compat.h"
12+
13+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
1114
#include "ruby.h"
15+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
1216

1317
extern VALUE RBS;
1418

ext/rbs_extension/compat.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifdef __clang__
2+
#define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN \
3+
_Pragma("clang diagnostic push") \
4+
_Pragma("clang diagnostic ignored \"-Wc2x-extensions\"")
5+
#define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END \
6+
_Pragma("clang diagnostic pop")
7+
#else
8+
#define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
9+
#define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
10+
#endif

ext/rbs_extension/legacy_location.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#ifndef RBS_LOCATION_H
22
#define RBS_LOCATION_H
33

4+
#include "compat.h"
5+
6+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
47
#include "ruby.h"
8+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
9+
510
#include "rbs.h"
611

712
/**

ext/rbs_extension/rbs_extension.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#include <stdbool.h>
2+
#include "compat.h"
23

4+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
35
#include "ruby.h"
46
#include "ruby/re.h"
57
#include "ruby/encoding.h"
8+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
69

710
#include "class_constants.h"
811
#include "rbs.h"

ext/rbs_extension/rbs_string_bridging.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#ifndef RBS__RBS_STRING_BRIDGING_H
22
#define RBS__RBS_STRING_BRIDGING_H
33

4+
#include "compat.h"
5+
6+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
47
#include "ruby.h"
58
#include "ruby/encoding.h"
9+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
610

711
#include "rbs/string.h"
812

templates/ext/rbs_extension/ast_translation.h.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#ifndef RBS_EXTENSION_AST_TRANSLATION_H
22
#define RBS_EXTENSION_AST_TRANSLATION_H
33

4+
#include "compat.h"
5+
6+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
47
#include "ruby.h"
58
#include "ruby/encoding.h"
9+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
610

711
#include "rbs/ast.h"
812
#include "rbs/location.h"

templates/ext/rbs_extension/class_constants.h.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#ifndef RBS__CONSTANTS_H
22
#define RBS__CONSTANTS_H
33

4+
#include "compat.h"
5+
6+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
47
#include "ruby.h"
8+
SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
59

610
extern VALUE RBS;
711

0 commit comments

Comments
 (0)