[vala/0.48] valadoc: Add implicit "Posix" using-directive for POSIX profile
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [vala/0.48] valadoc: Add implicit "Posix" using-directive for POSIX profile
- Date: Mon, 18 May 2020 12:38:02 +0000 (UTC)
commit d2840bc8011b8e122102a447ac5487507b819a79
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu May 7 10:44:54 2020 +0200
    valadoc: Add implicit "Posix" using-directive for POSIX profile
 valadoc/treebuilder.vala | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala
index 433938af2..521e67769 100644
--- a/valadoc/treebuilder.vala
+++ b/valadoc/treebuilder.vala
@@ -435,7 +435,12 @@ public class Valadoc.TreeBuilder : Vala.CodeVisitor {
 
                                        register_source_file (source_package, source_file);
 
-                                       if (context.profile == Vala.Profile.GOBJECT) {
+                                       if (context.profile == Vala.Profile.POSIX) {
+                                               // import the Posix namespace by default (namespace of 
backend-specific standard library)
+                                               var ns_ref = new Vala.UsingDirective (new 
Vala.UnresolvedSymbol (null, "Posix", null));
+                                               source_file.add_using_directive (ns_ref);
+                                               context.root.add_using_directive (ns_ref);
+                                       } else if (context.profile == Vala.Profile.GOBJECT) {
                                                // import the GLib namespace by default (namespace of 
backend-specific standard library)
                                                var ns_ref = new Vala.UsingDirective (new 
Vala.UnresolvedSymbol (null, "GLib", null));
                                                source_file.add_using_directive (ns_ref);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]