summaryrefslogtreecommitdiff
path: root/valadoc
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-05-07 10:44:54 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2020-05-07 10:44:54 +0200
commitc685ab4d9e302705808653e0fa7155513c65155b (patch)
tree7059875470ca35f19ddfd61f44cf380592e487d1 /valadoc
parent6746468b71810108958a5bf86d653cff2e371a1a (diff)
downloadvala-c685ab4d9e302705808653e0fa7155513c65155b.tar.gz
valadoc: Add implicit "Posix" using-directive for POSIX profile
Diffstat (limited to 'valadoc')
-rw-r--r--valadoc/treebuilder.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala
index 82e8a9287..67e1d460e 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);