NEWS: Fix misindented bullet point
[libvirt.git] / config.h
blobcc887db222cc277be4be28d5fde52085884ebb46
1 /*
2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library. If not, see
14 * <http://www.gnu.org/licenses/>.
17 #pragma once
19 #include <meson-config.h>
21 /* Enable compile-time and run-time bounds-checking, and some warnings,
22 * without upsetting newer glibc. */
24 #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
25 # define _FORTIFY_SOURCE 2
26 #endif
29 * Define __GNUC_PREREQ to a sane default if it isn't yet defined.
30 * This is done here so that it's included as early as possible;
32 #ifndef __GNUC_PREREQ
33 # define __GNUC_PREREQ(maj, min) \
34 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
35 #endif
37 #if defined(__clang_major__) && defined(__clang_minor__)
38 # ifdef __apple_build_version__
39 # if __clang_major__ < 10 || (__clang_major__ == 10 && __clang_minor__ < 0)
40 # error You need at least XCode Clang v10.0 to compile libvirt
41 # endif
42 # else
43 # if __clang_major__ < 6 || (__clang_major__ == 6 && __clang_minor__ < 4)
44 # error You need at least Clang v6.0 to compile libvirt
45 # endif
46 # endif
47 #elif defined(__GNUC__) && defined(__GNUC_MINOR__)
48 # if __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 4)
49 # error You need at least GCC v7.4.0 to compile libvirt
50 # endif
51 #else
52 # error You either need at least GCC 7.4.0 or Clang 6.0 or XCode Clang 10.0 to compile libvirt
53 #endif