From 97bd6dbc39dfc6b997f967a02ab5727451c8c792 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Thu, 31 Oct 2013 00:20:05 +0100 Subject: [PATCH] Warn on function redefinition A function redefinition usually stems from a bug in the OpenGL specs, or a bug in the spec converter. The binding generator now logs a warning, instead of crashing, when a redefinition is encountered. --- Source/Bind/Utilities.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Bind/Utilities.cs b/Source/Bind/Utilities.cs index 77892662..acf6c900 100644 --- a/Source/Bind/Utilities.cs +++ b/Source/Bind/Utilities.cs @@ -251,7 +251,10 @@ namespace Bind // Merges the given delegate into the delegate list. internal static void Merge(DelegateCollection delegates, Delegate t) { - delegates.Add(t.Name, t); + if (!delegates.ContainsKey(t.Name)) + delegates.Add(t.Name, t); + else + Console.WriteLine("Function '{0}' redefined", t.Name); } #endregion