diff --git a/libgweather/meson.build b/libgweather/meson.build index 07f657b992d809da913632275e820a0067b3ea7a..a32ae4c4acd90b5d680ce45c5d282982f2014a22 100644 --- a/libgweather/meson.build +++ b/libgweather/meson.build @@ -57,6 +57,10 @@ config_h.set_quoted('G_LOG_DOMAIN', 'GWeather') config_h.set_quoted('GWEATHER_BIN_LOCATION_DIR', pkglibdir) config_h.set_quoted('LIBGWEATHER_VERSION', meson.project_version()) +if c_compiler.has_header('alloca.h') + config_h.set('HAVE_ALLOCA_H', 1) +endif + if c_compiler.has_member('struct tm', 'tm_gmtoff', prefix: '#include ') config_h.set('HAVE_TM_TM_GMOFF', 1) endif diff --git a/libgweather/third-party/kdtree.c b/libgweather/third-party/kdtree.c index 6d329d8d317c47278c67b54720872789f3283891..c54bf2302ef96303beec30bbed8080f7be42629e 100644 --- a/libgweather/third-party/kdtree.c +++ b/libgweather/third-party/kdtree.c @@ -26,9 +26,7 @@ OF SUCH DAMAGE. */ /* single nearest neighbor search written by Tamas Nepusz */ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "config.h" #include #include @@ -36,6 +34,10 @@ OF SUCH DAMAGE. #include #include "kdtree.h" +#ifdef HAVE_ALLOCA_H +#include +#endif + #if defined(WIN32) || defined(__WIN32__) #include #endif