git: update to 2.43.0
[feed/packages.git] / libs / apr / patches / 000-071-backport-fix-APR_TRY_COMPILE_NO_WARNING.patch
1 From ea9344182b7559b12aa523548bb6d37d0e009028
2 From: Yann Ylavic <ylavic@apache.org>
3 Date: Wed, 24 Mar 2021 15:02:52 +0000
4 Subject: [PATCH] Follow up to r1887279: fix new APR_TRY_COMPILE_NO_WARNING.
5
6 AC_LANG_PROGRAM generates an "int main()" prototype which some compilers warn
7 about. Restore AC_LANG_SOURCE to manually set the correct main() but do not
8 #include "confdefs.h" if it is inlined already by AC_LANG_SOURCE (i.e.
9 check whether PACKAGE_NAME is already defined).
10
11 Github: closes #25
12
13
14 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1888017 13f79535-47bb-0310-9956-ffa450edef68
15 ---
16 build/apr_common.m4 | 11 +++++++++--
17 1 file changed, 9 insertions(+), 2 deletions(-)
18
19 --- a/build/apr_common.m4
20 +++ b/build/apr_common.m4
21 @@ -467,9 +467,16 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
22 CFLAGS="$CFLAGS -Werror"
23 fi
24 AC_COMPILE_IFELSE(
25 - [AC_LANG_PROGRAM(
26 - [[$1]],
27 + [AC_LANG_SOURCE(
28 + [
29 +#ifndef PACKAGE_NAME
30 +#include "confdefs.h"
31 +#endif
32 + ]
33 + [[$1]]
34 + [int main(int argc, const char *const *argv) {]
35 [[$2]]
36 + [ return 0; }]
37 )], [CFLAGS=$apr_save_CFLAGS
38 $3], [CFLAGS=$apr_save_CFLAGS
39 $4])