@@ -1355,7 +1355,7 @@ dnl DEALINGS IN THE SOFTWARE.
1355
1355
# See the "minimum version" comment for each macro you use to see what
1356
1356
# version you require.
1357
1357
m4_defun([ XORG_MACROS_VERSION] ,[
1358
- m4_define ( [ vers_have] , [ 1.20.0 ] )
1358
+ m4_define ( [ vers_have] , [ 1.20.2 ] )
1359
1359
m4_define ( [ maj_have] , m4_substr ( vers_have , 0 , m4_index ( vers_have , [ .] ) ) )
1360
1360
m4_define ( [ maj_needed] , m4_substr ( [ $1 ] , 0 , m4_index ( [ $1 ] , [ .] ) ) )
1361
1361
m4_if ( m4_cmp ( maj_have , maj_needed ) , 0 ,,
@@ -1402,10 +1402,10 @@ rm -f conftest.$ac_ext
1402
1402
1403
1403
AC_MSG_CHECKING ( [ if $RAWCPP requires -traditional] )
1404
1404
AC_LANG_CONFTEST ( [ AC_LANG_SOURCE ( [ [ Does cpp preserve "whitespace"?] ] ) ] )
1405
- if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \ "'` -eq 1 ; then
1405
+ if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve "'` -eq 1 ; then
1406
1406
AC_MSG_RESULT ( [ no] )
1407
1407
else
1408
- if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \ "'` -eq 1 ; then
1408
+ if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve "'` -eq 1 ; then
1409
1409
TRADITIONALCPPFLAGS="-traditional"
1410
1410
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1411
1411
AC_MSG_RESULT ( [ yes] )
@@ -2693,30 +2693,20 @@ AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2693
2693
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2694
2694
# malloc(0) returns NULL. Packages should add one of these cflags to
2695
2695
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2696
+ #
2697
+ # No longer actually tests since there is no guarantee applications will
2698
+ # run with the same malloc implementation we tested against, and the cost
2699
+ # of always ensuring the size passed to malloc is non-zero is minimal now.
2700
+ # Still allows builders to override when they have complete control over
2701
+ # which malloc implementation will be used.
2696
2702
AC_DEFUN ( [ XORG_CHECK_MALLOC_ZERO] ,[
2697
2703
AC_ARG_ENABLE ( malloc0returnsnull ,
2698
2704
AS_HELP_STRING ( [ --enable-malloc0returnsnull] ,
2699
- [ malloc(0) returns NULL (default: auto )] ) ,
2705
+ [ assume malloc(0) can return NULL (default: yes )] ) ,
2700
2706
[ MALLOC_ZERO_RETURNS_NULL=$enableval] ,
2701
- [ MALLOC_ZERO_RETURNS_NULL=auto] )
2702
-
2703
- AC_MSG_CHECKING ( [ whether malloc(0) returns NULL] )
2704
- if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2705
- AC_CACHE_VAL ( [ xorg_cv_malloc0_returns_null] ,
2706
- [ AC_RUN_IFELSE ( [ AC_LANG_PROGRAM ( [
2707
- #include <stdlib.h>
2708
- ] ,[
2709
- char *m0, *r0, *c0, *p;
2710
- m0 = malloc(0);
2711
- p = malloc(10);
2712
- r0 = realloc(p,0);
2713
- c0 = calloc(0,10);
2714
- exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2715
- ] ) ] ,
2716
- [ xorg_cv_malloc0_returns_null=yes] ,
2717
- [ xorg_cv_malloc0_returns_null=no] ) ] )
2718
- MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
2719
- fi
2707
+ [ MALLOC_ZERO_RETURNS_NULL=yes] )
2708
+
2709
+ AC_MSG_CHECKING ( [ whether to act as if malloc(0) can return NULL] )
2720
2710
AC_MSG_RESULT ( [ $MALLOC_ZERO_RETURNS_NULL] )
2721
2711
2722
2712
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
@@ -3013,7 +3003,6 @@ AC_LANG_CASE(
3013
3003
XORG_TESTSET_CFLAG([ [ BASE_] PREFIX[ FLAGS] ] , [ -Wnested-externs] )
3014
3004
XORG_TESTSET_CFLAG([ [ BASE_] PREFIX[ FLAGS] ] , [ -Wbad-function-cast] )
3015
3005
XORG_TESTSET_CFLAG([ [ BASE_] PREFIX[ FLAGS] ] , [ -Wold-style-definition] , [ -fd] )
3016
- XORG_TESTSET_CFLAG([ [ BASE_] PREFIX[ FLAGS] ] , [ -Wdeclaration-after-statement] )
3017
3006
]
3018
3007
)
3019
3008
0 commit comments