mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
[vkgen] Add support for c23 bool
Even though I'm not using c23 yet :P (properly).
This commit is contained in:
parent
0a50fb1bf1
commit
3e28ad62f4
3 changed files with 35 additions and 25 deletions
|
@ -9,5 +9,6 @@ typedef int int16_t;
|
|||
typedef int int32_t;
|
||||
typedef int int64_t;
|
||||
typedef int size_t;
|
||||
typedef struct char { int x; } char;
|
||||
typedef struct char { int x; } char;//FIXME add char to qfcc
|
||||
typedef struct bool { int x; } bool;//FIXME add bool to qfcc
|
||||
#endif//__vkgen_stdint_h
|
||||
|
|
|
@ -77,6 +77,9 @@
|
|||
id enumObj = [(id) Hash_Find (available_types, name) resolveType];
|
||||
return [enumObj cexprType];
|
||||
}
|
||||
if (name == "bool") {
|
||||
return "cexpr_bool";
|
||||
}
|
||||
if (name == "uint32_t") {
|
||||
return "cexpr_uint";
|
||||
}
|
||||
|
@ -101,12 +104,15 @@
|
|||
return [enumObj parseType];
|
||||
}
|
||||
}
|
||||
if (name == "VkBool32") {
|
||||
id enumObj = [(id) Hash_Find (available_types, name) resolveType];
|
||||
return [enumObj parseType];
|
||||
}
|
||||
if (name == "uint32_t" || name == "size_t" || name == "vec4f_t") {
|
||||
return "QFString";
|
||||
switch (name) {
|
||||
case "VkBool32":
|
||||
id enumObj = [(id) Hash_Find (available_types, name) resolveType];
|
||||
return [enumObj parseType];
|
||||
case "uint32_t":
|
||||
case "size_t":
|
||||
case "vec4f_t":
|
||||
case "bool":
|
||||
return "QFString";
|
||||
}
|
||||
return [alias parseType];
|
||||
}
|
||||
|
@ -123,12 +129,14 @@
|
|||
return [enumObj parseFunc];
|
||||
}
|
||||
}
|
||||
if (name == "VkBool32") {
|
||||
id enumObj = [(id) Hash_Find (available_types, name) resolveType];
|
||||
return [enumObj parseFunc];
|
||||
}
|
||||
if (name == "uint32_t") {
|
||||
return "parse_uint32_t";
|
||||
switch (name) {
|
||||
case "VkBool32":
|
||||
id enumObj = [(id) Hash_Find (available_types, name) resolveType];
|
||||
return [enumObj parseFunc];
|
||||
case "bool":
|
||||
return "parse_enum";
|
||||
case "uint32_t":
|
||||
return "parse_uint32_t";
|
||||
}
|
||||
return [alias parseFunc];
|
||||
}
|
||||
|
@ -145,18 +153,18 @@
|
|||
return [enumObj parseData];
|
||||
}
|
||||
}
|
||||
if (name == "VkBool32") {
|
||||
id enumObj = [(id) Hash_Find (available_types, name) resolveType];
|
||||
return [enumObj parseData];
|
||||
}
|
||||
if (name == "uint32_t") {
|
||||
return "0";
|
||||
}
|
||||
if (name == "vec4f_t") {
|
||||
return "&cexpr_vector";
|
||||
}
|
||||
if (name == "size_t") {
|
||||
return "&cexpr_size_t";
|
||||
switch (name) {
|
||||
case "VkBool32":
|
||||
id enumObj = [(id) Hash_Find (available_types, name) resolveType];
|
||||
return [enumObj parseData];
|
||||
case "uint32_t":
|
||||
return "0";
|
||||
case "bool":
|
||||
return "&cexpr_bool_enum";
|
||||
case "vec4f_t":
|
||||
return "&cexpr_vector";
|
||||
case "size_t":
|
||||
return "&cexpr_size_t";
|
||||
}
|
||||
return [alias parseData];
|
||||
}
|
||||
|
|
|
@ -212,6 +212,7 @@ main(int argc, string *argv)
|
|||
if ([obj class] == [Struct class]) {
|
||||
string name = [obj name];
|
||||
if (name == "char" // char type faked via a struct
|
||||
|| name == "bool" // bool type faked via a struct
|
||||
|| [[parse getObjectForKey:name] string] == "skip") {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue