mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 16:05:32 +00:00
Do not emit method bodies.
This commit is contained in:
parent
40f992b5bd
commit
4149cdfa88
|
@ -301,10 +301,11 @@ namespace Bind
|
|||
{
|
||||
Trace.WriteLine(String.Format("Writing wrappers to:\t{0}.{1}", Settings.OutputNamespace, Settings.OutputClass));
|
||||
|
||||
sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
|
||||
sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments
|
||||
sw.WriteLine("#pragma warning disable 1572"); // Wrong param comments
|
||||
sw.WriteLine("#pragma warning disable 1573"); // Missing param comments
|
||||
sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
|
||||
sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments
|
||||
sw.WriteLine("#pragma warning disable 1572"); // Wrong param comments
|
||||
sw.WriteLine("#pragma warning disable 1573"); // Missing param comments
|
||||
sw.WriteLine("#pragma warning disable 626"); // extern method without DllImport
|
||||
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("partial class {0}", Settings.OutputClass);
|
||||
|
@ -396,7 +397,8 @@ namespace Bind
|
|||
|
||||
sw.WriteLine("[AutoGenerated(Category = \"{0}\", Version = \"{1}\", EntryPoint = \"{2}\")]",
|
||||
f.Category, f.Version, Settings.FunctionPrefix + f.WrappedDelegate.EntryPoint);
|
||||
sw.WriteLine("public static ");
|
||||
sw.WriteLine("[Slot({0})]", f.WrappedDelegate.Slot);
|
||||
sw.WriteLine("public static extern ");
|
||||
sw.Write(GetDeclarationString(f));
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
@ -669,11 +671,6 @@ namespace Bind
|
|||
p.WrapperType == WrapperTypes.ArrayParameter ||
|
||||
p.WrapperType == WrapperTypes.ReferenceParameter)
|
||||
{
|
||||
if (f.Name.Contains("EdgeFlagPointerList"))
|
||||
{
|
||||
System.Diagnostics.Debugger.Break();
|
||||
}
|
||||
|
||||
// Pin the parameter to obtain a pointer we can safely pass to unmanaged code
|
||||
if (p.Pointer > 0)
|
||||
{
|
||||
|
@ -1002,12 +999,7 @@ namespace Bind
|
|||
}
|
||||
}
|
||||
|
||||
sb.AppendLine("{");
|
||||
foreach (var line in f.Body)
|
||||
{
|
||||
sb.AppendLine(line);
|
||||
}
|
||||
sb.Append("}");
|
||||
sb.AppendLine(";");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
|
55
Source/OpenTK/SlotAttribute.cs
Normal file
55
Source/OpenTK/SlotAttribute.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2010 the Open Toolkit library, except where noted.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
// the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the slot index for a wrapper function.
|
||||
/// This type supports OpenTK and should not be
|
||||
/// used in user code.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
|
||||
public class SlotAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the slot index for a wrapper function.
|
||||
/// </summary>
|
||||
internal int Slot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance.
|
||||
/// </summary>
|
||||
/// <param name="index">The slot index for a wrapper function.</param>
|
||||
public SlotAttribute(int index)
|
||||
{
|
||||
Slot = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue