[vala/wip/valadoc-code-context: 2/2] vala: Add Profile.LIBC as synonym for POSIX and accept "libc" profile



commit 32cec5ffb4597a8a7ae7282275513b71f114a0d5
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Jan 3 13:30:26 2019 +0100

    vala: Add Profile.LIBC as synonym for POSIX and accept "libc" profile

 compiler/valacompiler.vala | 1 +
 vala/valacodecontext.vala  | 2 ++
 vala/valaprofile.vala      | 3 ++-
 valadoc/valadoc.vala       | 1 +
 4 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index 4a08adf41..14ddc247c 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -186,6 +186,7 @@ class Vala.Compiler {
                        case null:
                        case "gobject-2.0":
                        case "gobject": profile = Profile.GOBJECT; break;
+                       case "libc": profile = Vala.Profile.LIBC; break;
                        case "posix": profile = Profile.POSIX; break;
                        default: throw new OptionError.FAILED ("Invalid --profile argument '%s'", val);
                }
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index 38e993070..092cbbe38 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -594,8 +594,10 @@ public class Vala.CodeContext {
                                add_external_package ("gobject-2.0");
                        }
                        break;
+               case Profile.LIBC:
                case Profile.POSIX:
                        this.profile = profile;
+                       add_define ("LIBC");
                        add_define ("POSIX");
 
                        if (include_stdpkg) {
diff --git a/vala/valaprofile.vala b/vala/valaprofile.vala
index 1ef0bd516..50350a85f 100644
--- a/vala/valaprofile.vala
+++ b/vala/valaprofile.vala
@@ -22,5 +22,6 @@
 
 public enum Vala.Profile {
        GOBJECT,
-       POSIX
+       LIBC,
+       POSIX = LIBC
 }
diff --git a/valadoc/valadoc.vala b/valadoc/valadoc.vala
index 2769e9a21..800700220 100644
--- a/valadoc/valadoc.vala
+++ b/valadoc/valadoc.vala
@@ -128,6 +128,7 @@ public class ValaDoc : Object {
                        case null:
                        case "gobject-2.0":
                        case "gobject": profile = Vala.Profile.GOBJECT; break;
+                       case "libc": profile = Vala.Profile.LIBC; break;
                        case "posix": profile = Vala.Profile.POSIX; break;
                        default: throw new OptionError.FAILED ("Invalid --profile argument '%s'", val);
                }


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