[vala] Drop legacy header support



commit 488868046b949086831a1c136575f83d3b0fa783
Author: Jürg Billeter <j bitron ch>
Date:   Fri Apr 3 23:00:07 2009 +0200

    Drop legacy header support
---
 gobject/valaccodebasemodule.vala |   41 --------------------------------------
 gobject/valaccodecompiler.vala   |    8 -------
 vala/valacodecontext.vala        |    7 ------
 3 files changed, 0 insertions(+), 56 deletions(-)

diff --git a/gobject/valaccodebasemodule.vala b/gobject/valaccodebasemodule.vala
index 2176477..9354205 100644
--- a/gobject/valaccodebasemodule.vala
+++ b/gobject/valaccodebasemodule.vala
@@ -135,8 +135,6 @@ internal class Vala.CCodeBaseModule : CCodeModule {
 
 	public Map<string,string> variable_name_map = new HashMap<string,string> (str_hash, str_equal);
 
-	string? legacy_header_define;
-
 	public CCodeBaseModule (CCodeGenerator codegen, CCodeModule? next) {
 		base (codegen, next);
 
@@ -306,45 +304,6 @@ internal class Vala.CCodeBaseModule : CCodeModule {
 			once.append (new CCodeNewline ());
 			once.write (writer);
 			writer.close ();
-		} else if (context.legacy_headers) {
-			foreach (SourceFile file in source_files) {
-				if (file.external_package) {
-					continue;
-				}
-
-				if (legacy_header_define == null) {
-					// share the same define for all legacy headers
-					legacy_header_define = get_define_for_filename (file.get_cinclude_filename ());
-				}
-
-				var writer = new CCodeWriter (file.get_cheader_filename ());
-				if (!writer.open ()) {
-					Report.error (null, "unable to open `%s' for writing".printf (writer.filename));
-					return;
-				}
-				writer.write_newline ();
-
-				var once = new CCodeOnceSection (legacy_header_define);
-				once.append (new CCodeNewline ());
-				once.append (header_declarations.include_directives);
-				once.append (new CCodeNewline ());
-				once.append (new CCodeIdentifier ("G_BEGIN_DECLS"));
-				once.append (new CCodeNewline ());
-				once.append (new CCodeNewline ());
-				once.append (header_declarations.type_declaration);
-				once.append (new CCodeNewline ());
-				once.append (header_declarations.type_definition);
-				once.append (new CCodeNewline ());
-				once.append (header_declarations.type_member_declaration);
-				once.append (new CCodeNewline ());
-				once.append (header_declarations.constant_declaration);
-				once.append (new CCodeNewline ());
-				once.append (new CCodeIdentifier ("G_END_DECLS"));
-				once.append (new CCodeNewline ());
-				once.append (new CCodeNewline ());
-				once.write (writer);
-				writer.close ();
-			}
 		}
 
 		// generate C header file for internal API
diff --git a/gobject/valaccodecompiler.vala b/gobject/valaccodecompiler.vala
index 2302c17..c5696e6 100644
--- a/gobject/valaccodecompiler.vala
+++ b/gobject/valaccodecompiler.vala
@@ -94,11 +94,6 @@ public class Vala.CCodeCompiler {
 			cmdline += " -o " + Shell.quote (output);
 		}
 
-		/* make sure include files can be found if -d is used */
-		if (context.legacy_headers && context.directory != null && context.directory != "") {
-			cmdline += " -I" + Shell.quote (context.directory);
-		}
-
 		/* we're only interested in non-pkg source files */
 		var source_files = context.get_source_files ();
 		foreach (SourceFile file in source_files) {
@@ -133,9 +128,6 @@ public class Vala.CCodeCompiler {
 				if (!context.save_csources) {
 					FileUtils.unlink (file.get_csource_filename ());
 				}
-				if (context.legacy_headers && !context.save_cheaders) {
-					FileUtils.unlink (file.get_cheader_filename ());
-				}
 			}
 		}
 	}
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index 3babfa8..771a1e5 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -106,13 +106,6 @@ public class Vala.CodeContext {
 	public string directory { get; set; }
 
 	/**
-	 * Generate a C header file per Vala source file.
-	 */
-	public bool legacy_headers {
-		get { return header_filename == null; }
-	}
-
-	/**
 	 * Produce debug information.
 	 */
 	public bool debug { get; set; }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]