]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/winapi/tools/gen_error_codes.pl
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / winapi / tools / gen_error_codes.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use warnings;
5
6 my $header = <<'END';
7 /*
8 * Copyright 2016-2018 Andrey Semashev
9 *
10 * Distributed under the Boost Software License, Version 1.0.
11 * See http://www.boost.org/LICENSE_1_0.txt
12 */
13
14 #ifndef BOOST_WINAPI_ERROR_CODES_HPP_INCLUDED_
15 #define BOOST_WINAPI_ERROR_CODES_HPP_INCLUDED_
16
17 #include <boost/winapi/basic_types.hpp>
18
19 #ifdef BOOST_HAS_PRAGMA_ONCE
20 #pragma once
21 #endif
22
23 namespace boost {
24 namespace winapi {
25
26 END
27
28 my $footer = <<'END';
29
30 } // namespace winapi
31 } // namespace boost
32
33 #endif // BOOST_WINAPI_ERROR_CODES_HPP_INCLUDED_
34 END
35
36 print $header;
37
38 while (<>)
39 {
40 my $line = $_;
41 chomp($line);
42 if ($line =~ /^\s*#\s*define\s+([a-zA-Z_\d]+)\s+(0[xX][[:xdigit:]]+|\d+|[a-zA-Z_\d]+)[lLuU]*\s*(\/\/.*|\/\*.*)?$/)
43 {
44 # We define some of the constants in other headers
45 if ($1 ne "FORCEINLINE" && $1 ne "WAIT_TIMEOUT")
46 {
47 my $value = $2;
48 print "BOOST_CONSTEXPR_OR_CONST DWORD_ ", $1 , "_ = ";
49 if ($value =~ /0[xX][[:xdigit:]]+|\d+/)
50 {
51 print $value;
52 }
53 else
54 {
55 print $value, "_";
56 }
57 print ";\n";
58 }
59 }
60 }
61
62 print $footer;