[vala/wip/issue/713: 29/32] vala: update use_header to reflect existence of header_filename compiler: remove --use-header flag



commit ac704910f9745d803af596ff1f58c38885a39e0b
Author: scythe loves you <scythe ortsz com>
Date:   Fri Mar 20 18:42:59 2020 -0400

    vala: update use_header to reflect existence of header_filename
    compiler: remove --use-header flag
    
    Fixes https://gitlab.gnome.org/GNOME/vala/issues/713

 compiler/valacompiler.vala | 7 +------
 vala/valacodecontext.vala  | 6 +++++-
 2 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index 37d43008d..4cf66f3c5 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -55,7 +55,6 @@ class Vala.Compiler {
        static bool ccode_only;
        static bool abi_stability;
        static string header_filename;
-       static bool use_header;
        static string internal_header_filename;
        static string internal_vapi_filename;
        static string fast_vapi_filename;
@@ -119,7 +118,7 @@ class Vala.Compiler {
                { "api-version", 0, 0, OptionArg.NONE, ref api_version, "Display API version number", null },
                { "ccode", 'C', 0, OptionArg.NONE, ref ccode_only, "Output C code", null },
                { "header", 'H', 0, OptionArg.FILENAME, ref header_filename, "Output C header file", "FILE" },
-               { "use-header", 0, 0, OptionArg.NONE, ref use_header, "Use C header file", null },
+               { "use-header", 0, OptionFlags.OPTIONAL_ARG | OptionFlags.NO_ARG, OptionArg.CALLBACK, (void*) 
option_deprecated, "Use C header file (DEPRECATED AND IGNORED)", null },
                { "includedir", 0, 0, OptionArg.FILENAME, ref includedir, "Directory used to include the C 
header file", "DIRECTORY" },
                { "internal-header", 'h', 0, OptionArg.FILENAME, ref internal_header_filename, "Output 
internal C header file", "FILE" },
                { "internal-vapi", 0, 0, OptionArg.FILENAME, ref internal_vapi_filename, "Output vapi with 
internal api", "FILE" },
@@ -266,10 +265,6 @@ class Vala.Compiler {
                context.abi_stability = abi_stability;
                context.compile_only = compile_only;
                context.header_filename = header_filename;
-               if (header_filename == null && use_header) {
-                       Report.error (null, "--use-header may only be used in combination with --header");
-               }
-               context.use_header = use_header;
                context.internal_header_filename = internal_header_filename;
                context.symbols_filename = symbols_filename;
                context.includedir = includedir;
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index da07b6f54..25f7bb65d 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -91,7 +91,11 @@ public class Vala.CodeContext {
         */
        public string? internal_header_filename { get; set; }
 
-       public bool use_header { get; set; }
+       public bool use_header {
+               get {
+                       return (header_filename != null);
+               }
+       }
 
        /**
         * Base directory used for header_filename in the VAPIs.


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