1// Copyright 2021 Peter Dimov
2// Distributed under the Boost Software License, Version 1.0.
3// https://www.boost.org/LICENSE_1_0.txt)
4
5#if !defined(__APPLE__)
6
7# define BOOST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__ % 100)
8
9#else
10# define BOOST_CLANG_REPORTED_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__ % 100)
11
12// https://en.wikipedia.org/wiki/Xcode#Toolchain_versions
13
14# if BOOST_CLANG_REPORTED_VERSION >= 140000
15# define BOOST_CLANG_VERSION 140000
16
17# elif BOOST_CLANG_REPORTED_VERSION >= 130100
18# define BOOST_CLANG_VERSION 130000
19
20# elif BOOST_CLANG_REPORTED_VERSION >= 130000
21# define BOOST_CLANG_VERSION 120000
22
23# elif BOOST_CLANG_REPORTED_VERSION >= 120005
24# define BOOST_CLANG_VERSION 110100
25
26# elif BOOST_CLANG_REPORTED_VERSION >= 120000
27# define BOOST_CLANG_VERSION 100000
28
29# elif BOOST_CLANG_REPORTED_VERSION >= 110003
30# define BOOST_CLANG_VERSION 90000
31
32# elif BOOST_CLANG_REPORTED_VERSION >= 110000
33# define BOOST_CLANG_VERSION 80000
34
35# elif BOOST_CLANG_REPORTED_VERSION >= 100001
36# define BOOST_CLANG_VERSION 70000
37
38# elif BOOST_CLANG_REPORTED_VERSION >= 100000
39# define BOOST_CLANG_VERSION 60001
40
41# elif BOOST_CLANG_REPORTED_VERSION >= 90100
42# define BOOST_CLANG_VERSION 50002
43
44# elif BOOST_CLANG_REPORTED_VERSION >= 90000
45# define BOOST_CLANG_VERSION 40000
46
47# elif BOOST_CLANG_REPORTED_VERSION >= 80000
48# define BOOST_CLANG_VERSION 30900
49
50# elif BOOST_CLANG_REPORTED_VERSION >= 70300
51# define BOOST_CLANG_VERSION 30800
52
53# elif BOOST_CLANG_REPORTED_VERSION >= 70000
54# define BOOST_CLANG_VERSION 30700
55
56# elif BOOST_CLANG_REPORTED_VERSION >= 60100
57# define BOOST_CLANG_VERSION 30600
58
59# elif BOOST_CLANG_REPORTED_VERSION >= 60000
60# define BOOST_CLANG_VERSION 30500
61
62# elif BOOST_CLANG_REPORTED_VERSION >= 50100
63# define BOOST_CLANG_VERSION 30400
64
65# elif BOOST_CLANG_REPORTED_VERSION >= 50000
66# define BOOST_CLANG_VERSION 30300
67
68# elif BOOST_CLANG_REPORTED_VERSION >= 40200
69# define BOOST_CLANG_VERSION 30200
70
71# elif BOOST_CLANG_REPORTED_VERSION >= 30100
72# define BOOST_CLANG_VERSION 30100
73
74# elif BOOST_CLANG_REPORTED_VERSION >= 20100
75# define BOOST_CLANG_VERSION 30000
76
77# else
78# define BOOST_CLANG_VERSION 20900
79
80# endif
81
82# undef BOOST_CLANG_REPORTED_VERSION
83#endif
84