From 12acb7ff05d11ebef12f6c627fc912a55735f97a Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Sun, 24 Mar 2002 17:04:25 +0000 Subject: [PATCH] 2002-03-24 Mike Kestner * generator/*Gen.cs : Use Path.DirectorySeparatorChar. * generator/Parser.cs : better debug for unexpected types. * generator/SymbolTable.cs : Use linux library names. svn path=/trunk/gtk-sharp/; revision=3308 --- ChangeLog | 9 ++++++++- generator/BoxedGen.cs | 8 +++++--- generator/CallbackGen.cs | 9 +++++---- generator/EnumGen.cs | 8 +++++--- generator/InterfaceGen.cs | 8 +++++--- generator/ObjectGen.cs | 8 +++++--- generator/Parser.cs | 2 +- generator/StructGen.cs | 8 +++++--- generator/SymbolTable.cs | 6 +++--- makefile | 2 +- 10 files changed, 43 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index ecc54c244..f5417991f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,14 @@ +2002-03-24 Mike Kestner + + * generator/*Gen.cs : Use Path.DirectorySeparatorChar. + * generator/Parser.cs : better debug for unexpected types. + * generator/SymbolTable.cs : Use linux library names. + 2002-03-07 Mike Kestner * generator/CodeGenerator.cs : Refactor generatable iteration. - * generator/SymbolTable.cs : Add Generatables property to expose complex_types.Values. + * generator/SymbolTable.cs : Add Generatables property to expose + complex_types.Values. 2002-03-02 Mike Kestner diff --git a/generator/BoxedGen.cs b/generator/BoxedGen.cs index 16f468c4c..61271d273 100644 --- a/generator/BoxedGen.cs +++ b/generator/BoxedGen.cs @@ -34,10 +34,12 @@ namespace GtkSharp.Generation { public void Generate (SymbolTable table) { - if (!Directory.Exists("..\\" + ns.ToLower() + "\\generated")) { - Directory.CreateDirectory("..\\"+ns.ToLower()+"\\generated"); + char sep = Path.DirectorySeparatorChar; + string dir = ".." + sep + ns.ToLower() + sep + "generated"; + if (!Directory.Exists(dir)) { + Directory.CreateDirectory(dir); } - String filename = "..\\" + ns.ToLower() + "\\generated\\" + Name + ".cs"; + String filename = dir + sep + Name + ".cs"; FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write); StreamWriter sw = new StreamWriter (stream); diff --git a/generator/CallbackGen.cs b/generator/CallbackGen.cs index 9fab6f3e3..491e51c47 100644 --- a/generator/CallbackGen.cs +++ b/generator/CallbackGen.cs @@ -61,11 +61,12 @@ namespace GtkSharp.Generation { public void Generate (SymbolTable table) { - if (!Directory.Exists("..\\" + ns.ToLower() + "\\generated")) { - Directory.CreateDirectory("..\\"+ns.ToLower()+"\\generated"); + char sep = Path.DirectorySeparatorChar; + string dir = ".." + sep + ns.ToLower() + sep + "generated"; + if (!Directory.Exists(dir)) { + Directory.CreateDirectory(dir); } - - String filename = "..\\" + ns.ToLower() + "\\generated\\" + Name + ".cs"; + String filename = dir + sep + Name + ".cs"; FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write); StreamWriter sw = new StreamWriter (stream); diff --git a/generator/EnumGen.cs b/generator/EnumGen.cs index a9058342f..45fbfae32 100644 --- a/generator/EnumGen.cs +++ b/generator/EnumGen.cs @@ -61,10 +61,12 @@ namespace GtkSharp.Generation { public void Generate (SymbolTable table) { - if (!Directory.Exists("..\\" + ns.ToLower() + "\\generated")) { - Directory.CreateDirectory("..\\"+ns.ToLower()+"\\generated"); + char sep = Path.DirectorySeparatorChar; + string dir = ".." + sep + ns.ToLower() + sep + "generated"; + if (!Directory.Exists(dir)) { + Directory.CreateDirectory(dir); } - String filename = "..\\" + ns.ToLower() + "\\generated\\" + Name + ".cs"; + String filename = dir + sep + Name + ".cs"; FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write); StreamWriter sw = new StreamWriter (stream); diff --git a/generator/InterfaceGen.cs b/generator/InterfaceGen.cs index e9ddd1e3f..616afee70 100644 --- a/generator/InterfaceGen.cs +++ b/generator/InterfaceGen.cs @@ -61,10 +61,12 @@ namespace GtkSharp.Generation { public void Generate (SymbolTable table) { - if (!Directory.Exists("..\\" + ns.ToLower() + "\\generated")) { - Directory.CreateDirectory("..\\"+ns.ToLower()+"\\generated"); + char sep = Path.DirectorySeparatorChar; + string dir = ".." + sep + ns.ToLower() + sep + "generated"; + if (!Directory.Exists(dir)) { + Directory.CreateDirectory(dir); } - String filename = "..\\" + ns.ToLower() + "\\generated\\" + Name + ".cs"; + String filename = dir + sep + Name + ".cs"; FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write); StreamWriter sw = new StreamWriter (stream); diff --git a/generator/ObjectGen.cs b/generator/ObjectGen.cs index b8d175490..24a03aea1 100644 --- a/generator/ObjectGen.cs +++ b/generator/ObjectGen.cs @@ -34,10 +34,12 @@ namespace GtkSharp.Generation { public void Generate (SymbolTable table) { - if (!Directory.Exists("..\\" + ns.ToLower() + "\\generated")) { - Directory.CreateDirectory("..\\"+ns.ToLower()+"\\generated"); + char sep = Path.DirectorySeparatorChar; + string dir = ".." + sep + ns.ToLower() + sep + "generated"; + if (!Directory.Exists(dir)) { + Directory.CreateDirectory(dir); } - String filename = "..\\" + ns.ToLower() + "\\generated\\" + Name + ".cs"; + String filename = dir + sep + Name + ".cs"; FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write); StreamWriter sw = new StreamWriter (stream); diff --git a/generator/Parser.cs b/generator/Parser.cs index b5349afa4..6269a92ed 100644 --- a/generator/Parser.cs +++ b/generator/Parser.cs @@ -98,7 +98,7 @@ namespace GtkSharp.Generation { break; default: - Console.WriteLine ("Unexpected node."); + Console.WriteLine ("Unexpected node named " + def.Name); break; } } diff --git a/generator/StructGen.cs b/generator/StructGen.cs index 755537d18..18af9cc65 100644 --- a/generator/StructGen.cs +++ b/generator/StructGen.cs @@ -33,10 +33,12 @@ namespace GtkSharp.Generation { public void Generate (SymbolTable table) { - if (!Directory.Exists("..\\" + ns.ToLower() + "\\generated")) { - Directory.CreateDirectory("..\\"+ns.ToLower()+"\\generated"); + char sep = Path.DirectorySeparatorChar; + string dir = ".." + sep + ns.ToLower() + sep + "generated"; + if (!Directory.Exists(dir)) { + Directory.CreateDirectory(dir); } - String filename = "..\\" + ns.ToLower() + "\\generated\\" + Name + ".cs"; + String filename = dir + sep + Name + ".cs"; FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write); StreamWriter sw = new StreamWriter (stream); diff --git a/generator/SymbolTable.cs b/generator/SymbolTable.cs index c110fecff..3fa268b2a 100644 --- a/generator/SymbolTable.cs +++ b/generator/SymbolTable.cs @@ -66,10 +66,10 @@ namespace GtkSharp.Generation { simple_types.Add ("GParamSpec", "IntPtr"); dlls = new Hashtable(); - dlls.Add("Atk", "atk.dll"); - dlls.Add("Gdk", "gdk-1.3.dll"); - dlls.Add("Gtk", "gtk-1.3.dll"); dlls.Add("Pango", "pango.dll"); + dlls.Add("Atk", "atk.dll"); + dlls.Add("Gdk", "gdk-x11-1.3.dll"); + dlls.Add("Gtk", "gtk-x11-1.3.dll"); } public void AddType (IGeneratable gen) diff --git a/makefile b/makefile index f21b10930..8a140f55d 100644 --- a/makefile +++ b/makefile @@ -1,12 +1,12 @@ DIRS=generator glib pango atk gdk gtk sample ROOT=/cygdrive/$(subst \,/,$(subst :\,/,$(SYSTEMROOT))) +CSC=$(ROOT)/microsoft.net/framework/v1.0.3705/csc.exe all: @echo "You must use 'make windows' or 'make linux'." @echo "'make unix' is broken for now." windows: - CSC=$(ROOT)/microsoft.net/framework/v1.0.2914/csc.exe for i in $(DIRS); do \ (cd $$i; CSC=$(CSC) make windows) || exit 1;\ done;