You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2021/03/24 15:05:52 UTC
svn commit: r1888018 - in /apr/apr/branches/1.7.x: ./ build/apr_common.m4
Author: ylavic
Date: Wed Mar 24 15:05:51 2021
New Revision: 1888018
URL: http://svn.apache.org/viewvc?rev=1888018&view=rev
Log:
Merge r1888017 from trunk:
Follow up to r1887279: fix new APR_TRY_COMPILE_NO_WARNING.
AC_LANG_PROGRAM generates an "int main()" prototype which some compilers warn
about. Restore AC_LANG_SOURCE to manually set the correct main() but do not
#include "confdefs.h" if it is inlined already by AC_LANG_SOURCE (i.e.
check whether PACKAGE_NAME is already defined).
Github: closes #25
Modified:
apr/apr/branches/1.7.x/ (props changed)
apr/apr/branches/1.7.x/build/apr_common.m4
Propchange: apr/apr/branches/1.7.x/
------------------------------------------------------------------------------
Merged /apr/apr/trunk:r1888017
Modified: apr/apr/branches/1.7.x/build/apr_common.m4
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.7.x/build/apr_common.m4?rev=1888018&r1=1888017&r2=1888018&view=diff
==============================================================================
--- apr/apr/branches/1.7.x/build/apr_common.m4 (original)
+++ apr/apr/branches/1.7.x/build/apr_common.m4 Wed Mar 24 15:05:51 2021
@@ -467,9 +467,16 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
CFLAGS="$CFLAGS -Werror"
fi
AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[$1]],
+ [AC_LANG_SOURCE(
+ [
+#ifndef PACKAGE_NAME
+#include "confdefs.h"
+#endif
+ ]
+ [[$1]]
+ [int main(int argc, const char *const *argv) {]
[[$2]]
+ [ return 0; }]
)], [CFLAGS=$apr_save_CFLAGS
$3], [CFLAGS=$apr_save_CFLAGS
$4])