2 .TH compiler 3 "26 May 2018" "Straylight/Edgeware" "mLib utilities library"
4 compiler \- detect compiler version
9 .B "#include <mLib/compiler.h>"
11 .BI "int GCC_VERSION_P(" maj ", " min ");"
12 .BI "int CLANG_VERSION_P(" maj ", " min ");"
16 .BI GCC_VERSION_P( maj ", " min )
17 expands to a compile-time constant nonzero value if the present compiler
20 or better, or claims compatibility with it.
21 This is frequently imperfect, as many compilers claim compatibility
22 without implementing all of the necessary features, but it works
23 adequately if one takes care.
26 .BI CLANG_VERSION_P( maj ", " min )
27 expands to a compile-time constant nonzero value if the present compiler
30 or better (or claims compatibility with it, but this is less likely
35 Mark Wooding, <mdw@distorted.org.uk>