mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-12 00:45:32 +00:00
* CppSpecWriter.cs: Mark deprecated functions.
This commit is contained in:
parent
778ddbe0e8
commit
9feb6a6b7c
|
@ -122,18 +122,24 @@ namespace Bind
|
||||||
sw.Indent();
|
sw.Indent();
|
||||||
}
|
}
|
||||||
|
|
||||||
Delegate last_delegate = null;
|
|
||||||
foreach (Function f in wrappers[extension])
|
|
||||||
{
|
|
||||||
var d = f.WrappedDelegate;
|
|
||||||
// Avoid multiple definitions of the same function
|
// Avoid multiple definitions of the same function
|
||||||
if (d != last_delegate)
|
Delegate last_delegate = null;
|
||||||
|
|
||||||
|
// Write forward-compatible functions
|
||||||
|
foreach (Function f in wrappers[extension].Where(f => !f.Deprecated).Select(f => f))
|
||||||
{
|
{
|
||||||
last_delegate = d;
|
WriteDelegate(sw, f, ref last_delegate);
|
||||||
sw.WriteLine("static {0} (*p{1})({2});", d.ReturnType, f.TrimmedName, d.Parameters);
|
|
||||||
sw.WriteLine("extern p{0} {0};", f.TrimmedName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write deprecated functions
|
||||||
|
sw.WriteLine("#ifdef ALLOW_DEPRECATED_GL");
|
||||||
|
sw.Indent();
|
||||||
|
foreach (Function f in wrappers[extension].Where(f => !f.Deprecated).Select(f => f))
|
||||||
|
{
|
||||||
|
WriteDelegate(sw, f, ref last_delegate);
|
||||||
}
|
}
|
||||||
|
sw.Unindent();
|
||||||
|
sw.WriteLine("#endif");
|
||||||
|
|
||||||
if (extension != "Core")
|
if (extension != "Core")
|
||||||
{
|
{
|
||||||
|
@ -146,6 +152,18 @@ namespace Bind
|
||||||
sw.WriteLine("};");
|
sw.WriteLine("};");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void WriteDelegate(BindStreamWriter sw, Function f, ref Delegate last_delegate)
|
||||||
|
{
|
||||||
|
var d = f.WrappedDelegate;
|
||||||
|
// Avoid multiple definitions of the same function
|
||||||
|
if (d != last_delegate)
|
||||||
|
{
|
||||||
|
last_delegate = d;
|
||||||
|
sw.WriteLine("static {0} (*p{1})({2});", d.ReturnType, f.TrimmedName, d.Parameters);
|
||||||
|
sw.WriteLine("extern p{0} {0};", f.TrimmedName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static DocProcessor processor = new DocProcessor(Path.Combine(Settings.DocPath, Settings.DocFile));
|
static DocProcessor processor = new DocProcessor(Path.Combine(Settings.DocPath, Settings.DocFile));
|
||||||
static Dictionary<string, string> docfiles;
|
static Dictionary<string, string> docfiles;
|
||||||
void WriteDocumentation(BindStreamWriter sw, Function f)
|
void WriteDocumentation(BindStreamWriter sw, Function f)
|
||||||
|
|
Loading…
Reference in a new issue