[vala/staging] vala: Add Profile.LIBC as synonym for POSIX and accept "libc" profile



commit 4a08b52bd817b648a5eadee2b9cb179561587329
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Apr 15 16:49:14 2021 +0200

    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 4cc7b2967..222e82d2e 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -185,6 +185,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 dc1421e6c..9fc211f7a 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -607,7 +607,9 @@ public class Vala.CodeContext {
                        }
                        break;
                case Profile.POSIX:
+               // case Profile.LIBC:
                        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 68d8b8fa4..0854be157 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]