Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
ad713702
Kaydet (Commit)
ad713702
authored
Tem 10, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added check whether malloc(0) returns NULL or not.
üst
4b11c74f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
1 deletion
+81
-1
configure
configure
+55
-1
configure.in
configure.in
+26
-0
No files found.
configure
Dosyayı görüntüle @
ad713702
#! /bin/sh
# From configure.in Revision: 1.5
3
# From configure.in Revision: 1.5
4
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.12
...
...
@@ -3666,6 +3666,59 @@ fi
echo
"
$ac_t
""
$ac_cv_func_getopt
"
1>&6
test
$ac_cv_func_getopt
=
no
&&
LIBOBJS
=
"
$LIBOBJS
getopt.o"
# check whether malloc(0) returns NULL or not
echo
$ac_n
"checking what malloc(0) returns""...
$ac_c
"
1>&6
echo
"configure:3673: checking what malloc(0) returns"
>
&5
if
eval
"test
\"
`
echo
'$''{'
ac_cv_malloc_zero
'+set}'
`
\"
= set"
;
then
echo
$ac_n
"(cached)
$ac_c
"
1>&6
else
if
test
"
$cross_compiling
"
=
yes
;
then
{
echo
"configure: error: can not run test program while cross compiling"
1>&2
;
exit
1
;
}
else
cat
>
conftest.
$ac_ext
<<
EOF
#line 3681 "configure"
#include "confdefs.h"
#include <stdio.h>
#ifdef HAVE_STDLIB
#include <stdlib.h>
#else
char *malloc(), *realloc();
int *free();
#endif
main() {
char *p;
p = malloc(0);
if (p == NULL) exit(1);
p = realloc(p, 0);
if (p == NULL) exit(1);
free(p);
exit(0);
}
EOF
if
{
(
eval echo
configure:3700:
\"
$ac_link
\"
)
1>&5
;
(
eval
$ac_link
)
2>&5
;
}
&&
test
-s
conftest
&&
(
./conftest
;
exit
)
2>/dev/null
then
ac_cv_malloc_zero
=
nonnull
else
echo
"configure: failed program was:"
>
&5
cat
conftest.
$ac_ext
>
&5
rm
-fr
conftest
*
ac_cv_malloc_zero
=
null
fi
rm
-fr
conftest
*
fi
fi
echo
"
$ac_t
""
$ac_cv_malloc_zero
"
1>&6
if
test
"
$ac_cv_malloc_zero
"
=
null
then
cat
>>
confdefs.h
<<
\
EOF
#define MALLOC_ZERO_RETURNS_NULL 1
EOF
fi
# generate output files
trap
''
1 2 15
cat
>
confcache
<<
\
EOF
...
...
@@ -3820,6 +3873,7 @@ s%@LIBOBJS@%$LIBOBJS%g
s%@WANT_SIGFPE_HANDLER@%
$WANT_SIGFPE_HANDLER
%g
s%@LIBM@%
$LIBM
%g
s%@LIBC@%
$LIBC
%g
s%@MALLOC_ZERO_RETURNS_NULL@%
$MALLOC_ZERO_RETURNS_NULL
%g
CEOF
EOF
...
...
configure.in
Dosyayı görüntüle @
ad713702
...
...
@@ -582,6 +582,32 @@ AC_MSG_RESULT($ac_cv_func_getopt)
test $ac_cv_func_getopt = no && LIBOBJS="$LIBOBJS getopt.o"
AC_SUBST(LIBOBJS)dnl
# check whether malloc(0) returns NULL or not
AC_SUBST(MALLOC_ZERO_RETURNS_NULL)
AC_MSG_CHECKING(what malloc(0) returns)
AC_CACHE_VAL(ac_cv_malloc_zero,
[AC_TRY_RUN([#include <stdio.h>
#ifdef HAVE_STDLIB
#include <stdlib.h>
#else
char *malloc(), *realloc();
int *free();
#endif
main() {
char *p;
p = malloc(0);
if (p == NULL) exit(1);
p = realloc(p, 0);
if (p == NULL) exit(1);
free(p);
exit(0);
}], ac_cv_malloc_zero=nonnull, ac_cv_malloc_zero=null)])
AC_MSG_RESULT($ac_cv_malloc_zero)
if test "$ac_cv_malloc_zero" = null
then
AC_DEFINE(MALLOC_ZERO_RETURNS_NULL)
fi
# generate output files
AC_OUTPUT(Makefile \
Objects/Makefile \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment