]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Add Profile.LIBC as synonym for POSIX and accept "libc" profile
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 15 Apr 2021 14:49:14 +0000 (16:49 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 15 Apr 2021 14:49:14 +0000 (16:49 +0200)
compiler/valacompiler.vala
vala/valacodecontext.vala
vala/valaprofile.vala
valadoc/valadoc.vala

index 4cc7b2967a136b929b0fbe51f5a9e7cbeb360ffb..222e82d2e548a25270a1b4dd828b3d6c1fb7194a 100644 (file)
@@ -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);
                }
index dc1421e6c2d92af63015c0ab3c0add99311757f5..9fc211f7a3a85b104c3833bbc420cd5de17ae46d 100644 (file)
@@ -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) {
index 1ef0bd516df26e69d00859fcb60e6c63ff990d4f..50350a85f7b3d7cc7b19258cb1e803436a1987a1 100644 (file)
@@ -22,5 +22,6 @@
 
 public enum Vala.Profile {
        GOBJECT,
-       POSIX
+       LIBC,
+       POSIX = LIBC
 }
index 68d8b8fa4ace1ff9beed13c9c0773bad55d76842..0854be1573deac6f3b9a31c6228730ffa8df2291 100644 (file)
@@ -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);
                }