aboutsummaryrefslogtreecommitdiff
path: root/src/aterm-helper.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/aterm-helper.pl')
-rwxr-xr-xsrc/aterm-helper.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/aterm-helper.pl b/src/aterm-helper.pl
index 3bb466fe3..54eb33abd 100755
--- a/src/aterm-helper.pl
+++ b/src/aterm-helper.pl
@@ -40,6 +40,11 @@ my $initFun = "init";
open HEADER, ">$ARGV[0]";
open IMPL, ">$ARGV[1]";
+print HEADER "#ifdef __cplusplus\n";
+print HEADER "namespace nix {\n";
+print HEADER "#endif\n\n\n";
+print IMPL "namespace nix {\n";
+
while (<STDIN>) {
next if (/^\s*$/);
@@ -162,5 +167,10 @@ print IMPL "void $initFun() {\n";
print IMPL "$init";
print IMPL "}\n";
+print HEADER "#ifdef __cplusplus\n";
+print HEADER "}\n";
+print HEADER "#endif\n\n\n";
+print IMPL "}\n";
+
close HEADER;
close IMPL;