Skip to content

Commit

Permalink
posix: add missing HAVE_ALLOCA_H definition, fixes #272
Browse files Browse the repository at this point in the history
Without this, the build fails with:
```
/var/tmp/portage/net-nntp/nzbget-24.1/work/nzbget-24.1/lib/regex/regex.c: In function ‘set_regs’:
/var/tmp/portage/net-nntp/nzbget-24.1/work/nzbget-24.1/lib/regex/regex.c:7701:39: error: implicit declaration of function ‘alloca’; did you mean ‘calloc’? [-Wimplicit-function-declaration]                        7701 |         prev_idx_match = (regmatch_t*)alloca(nmatch * sizeof(regmatch_t));
      |                                       ^~~~~~
      |                                       calloc
```
  • Loading branch information
sbraz committed Jul 14, 2024
1 parent f223cdd commit 077d0db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/posix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ option(DISABLE_PARCHECK "Disable parcheck")
option(USE_OPENSSL "Use OpenSSL" ON)
option(USE_GNUTLS "Use GnuTLS" OFF)

include(CheckIncludeFile)
CHECK_INCLUDE_FILE(alloca.h HAVE_ALLOCA_H)
if(HAVE_ALLOCA_H)
add_definitions(-DHAVE_ALLOCA_H)
endif()

if(NOT DISABLE_TLS AND USE_GNUTLS)
set(USE_OPENSSL OFF)
endif()
Expand Down

0 comments on commit 077d0db

Please sign in to comment.