.\" -*-nroff-*- .TH compiler 3 "26 May 2018" "Straylight/Edgeware" "mLib utilities library" .SH NAME compiler \- detect compiler version .\" @GCC_VERSION_P .\" @CLANG_VERSION_P .SH SYNOPSIS .nf .B "#include " .BI "int GCC_VERSION_P(" maj ", " min ");" .BI "int CLANG_VERSION_P(" maj ", " min ");" .fi .SH DESCRIPTION The macro invocation .BI GCC_VERSION_P( maj ", " min ) expands to a compile-time constant nonzero value if the present compiler is GCC version .IR maj . min or better, or claims compatibility with it. This is frequently imperfect, as many compilers claim compatibility without implementing all of the necessary features, but it works adequately if one takes care. .PP The macro invocation .BI CLANG_VERSION_P( maj ", " min ) expands to a compile-time constant nonzero value if the present compiler is Clang version .IR maj . min or better (or claims compatibility with it, but this is less likely than for GCC. .SH "SEE ALSO" .BR mLib (3). .SH "AUTHOR" Mark Wooding,