mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 15:05:41 +00:00
* ESCLParser.cs: OpenCL bitfileds are defines as long, not int. Added 'type' attribute to enums, which can be 'long' or 'int'.
This commit is contained in:
parent
ab138bfb37
commit
49f9609309
|
@ -57,6 +57,7 @@ namespace CHeaderToXML
|
||||||
public IEnumerable<XElement> Parse(string[] lines)
|
public IEnumerable<XElement> Parse(string[] lines)
|
||||||
{
|
{
|
||||||
char[] splitters = new char[] { ' ', '\t', ',', '(', ')', ';', '\n', '\r' };
|
char[] splitters = new char[] { ' ', '\t', ',', '(', ')', ';', '\n', '\r' };
|
||||||
|
bool is_long_bitfield = false;
|
||||||
|
|
||||||
// Line splitter
|
// Line splitter
|
||||||
Func<string, string[]> split = line =>
|
Func<string, string[]> split = line =>
|
||||||
|
@ -70,7 +71,7 @@ namespace CHeaderToXML
|
||||||
{
|
{
|
||||||
switch (t.ToLower())
|
switch (t.ToLower())
|
||||||
{
|
{
|
||||||
case ("bitfield"): return "Flags";
|
case ("bitfield"): is_long_bitfield = true; return "Flags";
|
||||||
default:
|
default:
|
||||||
if (t.ToLower() == Prefix)
|
if (t.ToLower() == Prefix)
|
||||||
return "";
|
return "";
|
||||||
|
@ -126,7 +127,9 @@ namespace CHeaderToXML
|
||||||
case "":
|
case "":
|
||||||
return acc;
|
return acc;
|
||||||
default:
|
default:
|
||||||
acc.Add(new XElement("enum", new XAttribute("name", @enum)));
|
acc.Add(new XElement("enum",
|
||||||
|
new XAttribute("name", @enum),
|
||||||
|
new XAttribute("type", is_long_bitfield ? "long" : "int")));
|
||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue