Commit ab71b259 authored by Ting-Wei Lan's avatar Ting-Wei Lan
Browse files

giscanner: Recognize _Thread_local as a storage class specifier

_Thread_local is a C11 keyword, and thread_local is a macro to make it
more confortable to read. As this keyword can only be used in variable
declarations, not in function return values or parameters, it cannot
be included in bindable APIs and we can safely ignore it.

https://bugzilla.gnome.org/show_bug.cgi?id=756921
parent 3ad8fb81
......@@ -181,6 +181,8 @@ stringtext ([^\\\"])|(\\.)
"__signed__" { return SIGNED; }
"__restrict" { return RESTRICT; }
"__restrict__" { return RESTRICT; }
"thread_local" { return THREAD_LOCAL; }
"_Thread_local" { return THREAD_LOCAL; }
"__typeof" { if (!parse_ignored_macro()) REJECT; }
"__volatile" { return VOLATILE; }
"__volatile__" { return VOLATILE; }
......
......@@ -234,8 +234,8 @@ toggle_conditional (GISourceScanner *scanner)
%token AUTO BOOL BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM
%token EXTENSION EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER RESTRICT
%token RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED
%token VOID VOLATILE WHILE
%token RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH THREAD_LOCAL TYPEDEF
%token UNION UNSIGNED VOID VOLATILE WHILE
%token FUNCTION_MACRO OBJECT_MACRO
%token IFDEF_GI_SCANNER IFNDEF_GI_SCANNER
......@@ -849,6 +849,10 @@ storage_class_specifier
{
$$ = STORAGE_CLASS_REGISTER;
}
| THREAD_LOCAL
{
$$ = STORAGE_CLASS_THREAD_LOCAL;
}
;
type_specifier
......
......@@ -69,7 +69,8 @@ typedef enum
STORAGE_CLASS_EXTERN = 1 << 2,
STORAGE_CLASS_STATIC = 1 << 3,
STORAGE_CLASS_AUTO = 1 << 4,
STORAGE_CLASS_REGISTER = 1 << 5
STORAGE_CLASS_REGISTER = 1 << 5,
STORAGE_CLASS_THREAD_LOCAL = 1 << 6
} StorageClassSpecifier;
typedef enum
......
......@@ -70,6 +70,7 @@ STORAGE_CLASS_EXTERN = 1 << 2
STORAGE_CLASS_STATIC = 1 << 3
STORAGE_CLASS_AUTO = 1 << 4
STORAGE_CLASS_REGISTER = 1 << 5
STORAGE_CLASS_THREAD_LOCAL = 1 << 6
TYPE_QUALIFIER_NONE = 0
TYPE_QUALIFIER_CONST = 1 << 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment