Skip to content

Commit 40044b5

Browse files
committed
regex: make ExperimentalRegexBridging.h C friendly
`bool` is not a valid type in C. However, C99 does provide `stdboo.h` to help bridge that type.
1 parent 8612cd0 commit 40044b5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/swift/Parse/ExperimentalRegexBridging.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef EXPERIMENTAL_REGEX_BRIDGING
22
#define EXPERIMENTAL_REGEX_BRIDGING
33

4+
#include <stdbool.h>
5+
46
#ifdef __cplusplus
57
extern "C" {
68
#endif
@@ -19,9 +21,9 @@ extern "C" {
1921
/// Returns: A bool indicating whether lexing was completely erroneous, and
2022
/// cannot be recovered from, or false if there either was no error,
2123
/// or there was a recoverable error.
22-
typedef bool(* RegexLiteralLexingFn)(/*CurPtrPtr*/ const char **,
23-
/*BufferEnd*/ const char *,
24-
/*ErrorOut*/ const char **);
24+
typedef bool (* RegexLiteralLexingFn)(/*CurPtrPtr*/ const char **,
25+
/*BufferEnd*/ const char *,
26+
/*ErrorOut*/ const char **);
2527
void Parser_registerRegexLiteralLexingFn(RegexLiteralLexingFn fn);
2628

2729
/// Parse a regex literal string. Takes the following arguments:

0 commit comments

Comments
 (0)