Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
c-wrapperがMojave+Xcode11で動かなかったので
--- c-grammar.scm.orig 2019-10-04 00:07:42.000000000 +0900
+++ c-grammar.scm 2019-10-03 22:17:39.000000000 +0900
@@ -19,7 +19,7 @@
XOR_ASSIGN OR_ASSIGN TYPENAME
TYPEDEF EXTERN STATIC AUTO REGISTER INLINE RESTRICT
- SIGNED UNSIGNED CONST VOLATILE
+ SIGNED UNSIGNED CONST VOLATILE NULLABLE NONNULL
STRUCT UNION ENUM ELLIPSIS RANGE
CASE DEFAULT IF ELSE SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN
@@ -113,6 +113,8 @@
(RESTRICT) : '()
(TYPENAME objc_non_empty_protocol_references) : (%TYPENAME $1)
(objc_non_empty_protocol_references) : '(id)
+ (NULLABLE) : '()
+ (NONNULL) : '()
)
(primary_expr
@@ -549,6 +551,8 @@
(CONST)
(VOLATILE)
(RESTRICT)
+ (NULLABLE)
+ (NONNULL)
)
(array_qualifier
@@ -556,6 +560,8 @@
(RESTRICT)
(CONST)
(VOLATILE)
+ (NULLABLE)
+ (NONNULL)
)
(array_qualifier_list
--- c-lex.c.orig 2019-10-04 00:07:27.000000000 +0900
+++ c-lex.c 2019-10-04 00:19:50.000000000 +0900
@@ -161,10 +161,13 @@ static void init_c_keyword_table()
{"asm", "ASM"},
{"__asm", "ASM"},
{"__asm__", "ASM"},
+ {"restrict", "RESTRICT"},
{"__restrict", "RESTRICT"},
{"__restrict__", "RESTRICT"},
{"__extension__", "EXTENSION"},
{"__attribute__", "ATTRIBUTE"},
+ {"_Nullable", "NULLABLE"},
+ {"_Nonnull", "NONNULL"},
{"@interface", "AT_INTERFACE"},
{"@implementation", "AT_IMPLEMENTATION"},
{"@end", "AT_END"},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment