From 1725b1c93de3402af94a1c2d49305539b4f5154f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 4 Jul 2019 08:58:43 -0700 Subject: [PATCH] IDL: Avoid name collisions. --- scripts/csharp.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/csharp.lua b/scripts/csharp.lua index 564aea411..12f3466ee 100644 --- a/scripts/csharp.lua +++ b/scripts/csharp.lua @@ -133,7 +133,7 @@ local function FlagBlock(typ) end yield("[Flags]") - yield("public enum " .. typ.name .. enumType) + yield("public enum " .. typ.name .. "Flags" .. enumType) yield("{") for _, flag in ipairs(typ.flag) do @@ -237,7 +237,13 @@ function converter.types(typ) FlagBlock(typ) end elseif typ.struct ~= nil then - yield("public unsafe struct " .. typ.name) + + if typ.namespace ~= nil then + yield("public unsafe struct " .. typ.namespace .. typ.name) + else + yield("public unsafe struct " .. typ.name) + end + yield("{") for _, member in ipairs(typ.struct) do