Skip to content

Commit 11a3dd3

Browse files
committed
compat UPDATE include alloca.h
1 parent 56af7c9 commit 11a3dd3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CMakeModules/UseCompat.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ macro(USE_COMPAT)
5959
check_symbol_exists(mmap "sys/mman.h" HAVE_MMAP)
6060
check_symbol_exists(setenv "stdlib.h" HAVE_SETENV)
6161

62+
check_include_file("alloca.h" HAVE_ALLOCA_H)
63+
6264
list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=200809L)
6365
list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
6466
list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D__BSD_VISIBLE=1)

compat/compat.h.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Michal Vasko <[email protected]>
44
* @brief compatibility functions header
55
*
6-
* Copyright (c) 2021 - 2023 CESNET, z.s.p.o.
6+
* Copyright (c) 2021 - 2025 CESNET, z.s.p.o.
77
*
88
* This source code is licensed under BSD 3-Clause License (the "License").
99
* You may not use this file except in compliance with the License.
@@ -21,6 +21,11 @@
2121
# include <ws2tcpip.h>
2222
#endif
2323

24+
#cmakedefine HAVE_ALLOCA_H
25+
#ifdef HAVE_ALLOCA_H
26+
# include <alloca.h>
27+
#endif
28+
2429
#include <limits.h>
2530
#include <pthread.h>
2631
#include <stdarg.h>

0 commit comments

Comments
 (0)