mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
configure.in: rb_cv_getcwd_malloc
* configure.in (rb_cv_getcwd_malloc): check if getcwd allocates buffer if NULL is given [ruby-core:62072] [Bug #9752] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2254fc650b
commit
f8d6453704
2 changed files with 36 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Apr 18 08:50:18 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in (rb_cv_getcwd_malloc): check if getcwd allocates
|
||||
buffer if NULL is given [ruby-core:62072] [Bug #9752]
|
||||
|
||||
Thu Apr 17 16:28:10 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
||||
|
||||
* prelude.rb: [DOC] Update Thread::exclusive docs by @stevenharman.
|
||||
|
|
31
configure.in
31
configure.in
|
@ -2008,6 +2008,37 @@ AC_CHECK_FUNCS(utimes)
|
|||
AC_CHECK_FUNCS(wait4)
|
||||
AC_CHECK_FUNCS(waitpid)
|
||||
|
||||
AS_IF([test "$ac_cv_func_getcwd" = yes], [
|
||||
AC_CACHE_CHECK(if getcwd allocates buffer if NULL is given, [rb_cv_getcwd_malloc],
|
||||
[AC_TRY_RUN([
|
||||
@%:@include <stddef.h>
|
||||
@%:@include <stdio.h>
|
||||
@%:@ifdef HAVE_UNISTD_H
|
||||
@%:@include <unistd.h>
|
||||
@%:@endif
|
||||
@%:@ifndef EXIT_SUCCESS
|
||||
@%:@define EXIT_SUCCESS 0
|
||||
@%:@endif
|
||||
@%:@ifndef EXIT_FAILURE
|
||||
@%:@define EXIT_FAILURE 1
|
||||
@%:@endif
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
if (!getcwd(NULL, 0)) return EXIT_FAILURE;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
],
|
||||
rb_cv_getcwd_malloc=yes,
|
||||
rb_cv_getcwd_malloc=no,
|
||||
AS_CASE($target_os,
|
||||
[linux*|darwin*|*bsd|cygwin*|mingw*|mswin*],
|
||||
[rb_cv_getcwd_malloc=yes],
|
||||
[rb_cv_getcwd_malloc=no]))])
|
||||
AS_IF([test "$rb_cv_getcwd_malloc" = no], [AC_DEFINE(NO_GETCWD_MALLOC, 1)])
|
||||
])
|
||||
|
||||
AC_DEFUN([RUBY_CHECK_BUILTIN_FUNC], [dnl
|
||||
AC_CACHE_CHECK([for $1], AS_TR_SH(rb_cv_builtin_$1),
|
||||
[AC_LINK_IFELSE(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue