Next: , Previous: , Up: The Macros  





This macro checks if the compiler supports one of GCC’s built-in functions; many other compilers also provide those same built-ins.

The BUILTIN parameter is the name of the built-in function.

If BUILTIN is supported define HAVE_<BUILTIN>. Keep in mind that since builtins usually start with two underscores they will be copied over into the HAVE_<BUILTIN> definition (e.g. HAVE___BUILTIN_EXPECT for __builtin_expect()).

The macro caches its result in the ax_cv_have_<BUILTIN> variable (e.g. ax_cv_have___builtin_expect).

The macro currently supports the following built-in functions:


Unsupported built-ins will be tested with an empty parameter set and the result of the check might be wrong or meaningless so use with care.

Source Code

Download the latest version of ax_gcc_builtin.m4 or browse the macro’s revision history.


Copyright © 2013 Gabriele Svelto

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.