From 201d99cc5f0c5f9da671245befe12e4036ff0c99 Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 26 Jul 2010 03:05:25 +0000 Subject: * configure.in: define BROKEN_CLOSE on FreeBSD. This fixes build failure on MSVC. [ruby-core:31481] * include/ruby/ruby.h, include/ruby/missing.h: use BROKEN_CLOSE for replacing close(2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ configure.in | 5 ++++- include/ruby/missing.h | 2 +- include/ruby/ruby.h | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5edf7459e4..7a08141caf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Jul 26 11:51:01 2010 NARUSE, Yui + + * configure.in: define BROKEN_CLOSE on FreeBSD. + This fixes build failure on MSVC. [ruby-core:31481] + + * include/ruby/ruby.h, include/ruby/missing.h: + use BROKEN_CLOSE for replacing close(2). + Mon Jul 26 09:51:20 2010 Nobuyoshi Nakada * vm.c (rb_thread_mark): mark only self of normal iseqs, not diff --git a/configure.in b/configure.in index ebc62821ac..fd6a094cea 100644 --- a/configure.in +++ b/configure.in @@ -1155,7 +1155,10 @@ main() rb_cv_broken_glibc_ia64_erfc=no)]) AS_CASE([$rb_cv_broken_glibc_ia64_erfc],[yes],[ac_cv_func_erf=no]) -AS_CASE(["$target_os"],[freebsd],[],[AC_REPLACE_FUNCS(close)]) +AS_CASE(["$target_os"],[freebsd],[],[ + AC_DEFINE(BROKEN_CLOSE) + AC_REPLACE_FUNCS(close) + ]) AC_REPLACE_FUNCS(dup2 memmove strerror\ strchr strstr crypt flock\ isnan finite isinf hypot acosh erf tgamma lgamma_r cbrt \ diff --git a/include/ruby/missing.h b/include/ruby/missing.h index 327e0a847d..8e4ffae72a 100644 --- a/include/ruby/missing.h +++ b/include/ruby/missing.h @@ -175,7 +175,7 @@ RUBY_EXTERN int signbit(double x); RUBY_EXTERN int ffs(int); #endif -#ifndef HAVE_CLOSE +#ifdef BROKEN_CLOSE #include #include RUBY_EXTERN int ruby_getpeername(int, struct sockaddr *, socklen_t *); diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index c01d617ba3..11e3bb819a 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1440,7 +1440,7 @@ int ruby_vsnprintf(char *str, size_t n, char const *fmt, va_list ap); #define snprintf ruby_snprintf #define vsnprintf ruby_vsnprintf -#ifdef __FreeBSD__ +#ifdef BROKEN_CLOSE #undef getpeername #define getpeername ruby_getpeername #undef getsockname -- cgit v1.2.3