summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/typeof/tools
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/boost/libs/typeof/tools
parentInitial commit. (diff)
downloadceph-upstream.tar.xz
ceph-upstream.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/typeof/tools')
-rw-r--r--src/boost/libs/typeof/tools/preprocess.pl122
1 files changed, 122 insertions, 0 deletions
diff --git a/src/boost/libs/typeof/tools/preprocess.pl b/src/boost/libs/typeof/tools/preprocess.pl
new file mode 100644
index 000000000..56f50c57c
--- /dev/null
+++ b/src/boost/libs/typeof/tools/preprocess.pl
@@ -0,0 +1,122 @@
+# // (C) Copyright Tobias Schwinger
+# //
+# // Use modification and distribution are subject to the boost Software License
+# // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
+
+# // Preprocess and run this script.
+# //
+# // Invocation example using the GNU preprocessor:
+# //
+# // g++ -I$BOOST_ROOT -x c++ preprocess.pl -E |perl
+# //
+# // or in two steps:
+# //
+# // g++ -I$BOOST_ROOT -x c++ preprocess.pl -E >temp.pl
+# // perl temp.pl
+
+#define die(x) 1
+die("ERROR: this script has to be preprocessed, stopped");
+#undef die
+
+use strict vars;
+use File::Spec updir,curdir,catfile,canonpath,splitpath,file_name_is_absolute;
+
+# // --- Settings
+my $up = File::Spec->updir();
+
+# // Relative path to the destination directory.
+my $path = File::Spec->catdir($up,$up,$up,'boost','typeof');
+
+my $license = qq@
+/\/ Copyright (C) 2005 Arkadiy Vertleyb
+/\/ Copyright (C) 2005 Peder Holt
+/\/
+/\/ Use modification and distribution are subject to the boost Software License,
+/\/ Version 1.0. (See http:/\/www.boost.org/LICENSE_1_0.txt).
+
+/\/ Preprocessed code, do not edit manually !
+
+@;
+# //---
+
+# // Find this script's directory if run directly from the shell (not piped)
+$path = File::Spec->canonpath
+( File::Spec->catfile
+ ( File::Spec->file_name_is_absolute($0)
+ ? $0 : (File::Spec->curdir(),$0)
+ , $up
+ , File::Spec->splitpath($path)
+ )
+) unless ($0 eq '-');
+die
+( ($0 eq '-')
+ ? "ERROR: please run from this script's directory, stopped"
+ : "ERROR: target directoty not found, stopped"
+) unless (-d $path);
+
+# // Tidy up the contents and write it to a file
+sub write_down(name,contents)
+{
+ my($name,$contents) = @_;
+ my $filename = $name;
+
+ my $fqfname = File::Spec->catfile($path,$filename);
+ $contents =~ s"(((\n|^)\s*\#[^\n]+)|(\s*\n)){2,}"\n"g; # "
+ print STDERR "Writing file: '$filename'\n";
+ open my($file),">$fqfname"
+ or die "ERROR: unable to open file '$filename' for writing, stopped";
+ print $file $license;
+ print $file $contents;
+ close $file;
+}
+
+# // Include external components to ensure they don't end up in the recorded
+# // output
+#define BOOST_TYPEOF_PP_INCLUDE_EXTERNAL
+my $sewer = <<'%--%-EOF-%--%'
+#include <boost/typeof/vector.hpp>
+#undef BOOST_TYPEOF_VECTOR_HPP_INCLUDED
+%--%-EOF-%--%
+; $sewer = '';
+
+
+#define BOOST_TYPEOF_PREPROCESSING_MODE
+#define BOOST_TYPEOF_LIMIT_SIZE 50
+#define BOOST_TYPEOF_PP_NEXT_SIZE 100
+
+&write_down('vector50.hpp',<<'%--%-EOF-%--%'
+#include <boost/typeof/vector.hpp>
+%--%-EOF-%--%
+);
+#undef BOOST_TYPEOF_VECTOR_HPP_INCLUDED
+
+#undef BOOST_TYPEOF_LIMIT_SIZE
+#define BOOST_TYPEOF_LIMIT_SIZE 100
+#define BOOST_TYPEOF_PP_NEXT_SIZE 149
+
+&write_down('vector100.hpp',<<'%--%-EOF-%--%'
+#include <boost/typeof/vector.hpp>
+%--%-EOF-%--%
+);
+#undef BOOST_TYPEOF_VECTOR_HPP_INCLUDED
+
+#undef BOOST_TYPEOF_LIMIT_SIZE
+#define BOOST_TYPEOF_LIMIT_SIZE 150
+#define BOOST_TYPEOF_PP_NEXT_SIZE 199
+
+
+&write_down('vector150.hpp',<<'%--%-EOF-%--%'
+#include <boost/typeof/vector.hpp>
+%--%-EOF-%--%
+);
+#undef BOOST_TYPEOF_VECTOR_HPP_INCLUDED
+
+#undef BOOST_TYPEOF_LIMIT_SIZE
+#define BOOST_TYPEOF_LIMIT_SIZE 200
+#define BOOST_TYPEOF_PP_NEXT_SIZE 250
+
+&write_down('vector200.hpp',<<'%--%-EOF-%--%'
+#include <boost/typeof/vector.hpp>
+%--%-EOF-%--%
+);
+