From d6484bd63002c3512b9f49c3b66b1e37b09cba4d Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Mon, 6 Dec 2010 00:46:23 +0000 Subject: [PATCH] * CppSpecWriter.cs: Renamed output files to gldef++. Added preprocessor macros for enum generation. --- Source/Bind/CppSpecWriter.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Source/Bind/CppSpecWriter.cs b/Source/Bind/CppSpecWriter.cs index 9c7effab..d3b8e624 100644 --- a/Source/Bind/CppSpecWriter.cs +++ b/Source/Bind/CppSpecWriter.cs @@ -74,7 +74,6 @@ namespace Bind { WriteLicense(sw); - sw.WriteLine("#include \"gldef++.h\""); sw.WriteLine("namespace {0}", Settings.OutputNamespace); sw.WriteLine("{"); sw.Indent(); @@ -96,7 +95,6 @@ namespace Bind { WriteLicense(sw); - sw.WriteLine("#include \"gldef++.cpp\""); sw.WriteLine("namespace {0}", Settings.OutputNamespace); sw.WriteLine("{"); sw.Indent(); @@ -107,8 +105,8 @@ namespace Bind sw.WriteLine("}"); } - string output_header = Path.Combine(Settings.OutputPath, "gl++.h"); - string output_cpp = Path.Combine(Settings.OutputPath, "gl++.cpp"); + string output_header = Path.Combine(Settings.OutputPath, "gldef++.h"); + string output_cpp = Path.Combine(Settings.OutputPath, "gldef++.cpp"); if (File.Exists(output_header)) File.Delete(output_header); File.Move(temp_header_file, output_header); @@ -431,10 +429,7 @@ namespace Bind { foreach (Enum @enum in enums.Values) { - sw.WriteLine("struct {0} : Enumeration<{0}>", @enum.Name); - sw.WriteLine("{"); - sw.Indent(); - sw.WriteLine("enum"); + sw.WriteLine("ENUM({0})", @enum.Name); sw.WriteLine("{"); sw.Indent(); foreach (var c in @enum.ConstantCollection.Values) @@ -447,8 +442,7 @@ namespace Bind } sw.Unindent(); sw.WriteLine("};"); - sw.Unindent(); - sw.WriteLine("};"); + sw.WriteLine("END_ENUM({0})", @enum.Name); sw.WriteLine(); } }