summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rwxr-xr-xbooster.pl69
-rw-r--r--include/ocl/tproc/detail/config.hpp3
3 files changed, 72 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index e1d9795..70d38f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,9 @@
build/
bin/
+# Boostified result
+boostified/
+
# Intellij
.idea
diff --git a/booster.pl b/booster.pl
new file mode 100755
index 0000000..fe50b36
--- /dev/null
+++ b/booster.pl
@@ -0,0 +1,69 @@
+#!/usr/bin/perl -w
+
+use strict;
+use File::Path qw(make_path);
+use File::Basename;
+use Getopt::Long;
+
+if (@ARGV == 0) {
+ exit 0;
+}
+
+my @files;
+
+for my $path (@ARGV) {
+ if (-f $path) {
+ push @files, $path;
+ } elsif (-d $path) {
+ find_files($path, \@files);
+ } else {
+ warn "Skipping '$path': not a file or directory\n";
+ }
+}
+
+make_path("boostified/include/boost/tproc");
+
+for my $file (@files) {
+ process_file($file);
+}
+
+sub find_files {
+ my ($dir, $list) = @_;
+ opendir(my $dh, $dir) or die "Cannot open directory $dir: $!\n";
+ while (my $entry = readdir($dh)) {
+ next if $entry eq '.' || $entry eq '..';
+ my $full = "$dir/$entry";
+ if (-d $full) {
+ find_files($full, $list);
+ } elsif (-f $full && $full =~ /\.(cpp|inl|hpp|h|cc|hh|cxx|hxx)$/i) {
+ push @$list, [ $entry, $full, dirname($full) ];
+ }
+ }
+ closedir($dh);
+}
+
+sub process_file {
+ my $info = shift;
+ my ($name, $fullpath, $srcdir) = @$info;
+
+ open(my $fh, '<', $fullpath) or die "Cannot read $fullpath: $!\n";
+ my $content = do { local $/; <$fh> };
+ close($fh);
+
+ my $original = $content;
+
+ $content =~ s/\bocl::/boost::/g;
+ $content =~ s/\b__OCL_/BOOST_/g;
+ $content =~ s/\bocl\//boost\//g;
+ $content =~ s/\bOCL_/BOOST_/g;
+
+ if ($content ne $original) {
+ my $reldir = substr($srcdir, length($ARGV[0]) + 1);
+ my $outdir = "boostified/include/boost/$reldir";
+ make_path($outdir) unless -d $outdir;
+
+ open(my $out, '>', "$outdir/$name") or die "Cannot write $outdir/$name: $!\n";
+ print $out $content;
+ close($out);
+ }
+}
diff --git a/include/ocl/tproc/detail/config.hpp b/include/ocl/tproc/detail/config.hpp
index 363ea5a..04d0eed 100644
--- a/include/ocl/tproc/detail/config.hpp
+++ b/include/ocl/tproc/detail/config.hpp
@@ -10,9 +10,6 @@
#include <boost/assert/source_location.hpp>
#include <ocl/detail/config.hpp>
-#include <ocl/equiv.hpp>
-#include <ocl/option.hpp>
-#include <ocl/smart_ptr.hpp>
#include <boost/core/detail/string_view.hpp>
namespace ocl::tproc