From 1c8a0b2bda7adaf6db501f9cfb98dbf4ab8cc733 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Mon, 6 Dec 2010 10:26:06 +0000 Subject: [PATCH] * CppSpecWriter.cs: Do not use macros to define enumerations, as this makes debugging difficult. --- Source/Bind/CppSpecWriter.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Bind/CppSpecWriter.cs b/Source/Bind/CppSpecWriter.cs index e6c0c08d..beb9c109 100644 --- a/Source/Bind/CppSpecWriter.cs +++ b/Source/Bind/CppSpecWriter.cs @@ -440,7 +440,11 @@ namespace Bind { foreach (Enum @enum in enums.Values) { - sw.WriteLine("ENUM({0})", @enum.Name); + sw.WriteLine("struct {0} : Enumeration<{0}>", @enum.Name); + sw.WriteLine("{"); + sw.Indent(); + sw.WriteLine("inline {0}(int value) : Enumeration<{0}>(value) {{ }}", @enum.Name); + sw.WriteLine("enum"); sw.WriteLine("{"); sw.Indent(); foreach (var c in @enum.ConstantCollection.Values) @@ -453,7 +457,8 @@ namespace Bind } sw.Unindent(); sw.WriteLine("};"); - sw.WriteLine("END_ENUM({0})", @enum.Name); + sw.Unindent(); + sw.WriteLine("};"); sw.WriteLine(); } }