summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-09 15:52:49 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-09 15:52:49 +0000
commit3e1d8aab1731e671b8daf266bbdb99196ff95421 (patch)
tree8799c74bdd5f62ca9cd059b374cdda6ef59272bf
parentf40412e258012af48595fab97ac23365b9b117ec (diff)
downloadruby-3e1d8aab1731e671b8daf266bbdb99196ff95421.tar.gz
* dln.c: Simplify and make consistent an ifdef for Mac OS X.
* ext/socket/rubysocket.h: ditto. * ext/tk/stubs.c: ditto. * io.c: ditto. * process.c: ditto. * signal.c: ditto. * vm_dump.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--dln.c2
-rw-r--r--ext/socket/rubysocket.h2
-rw-r--r--ext/tk/stubs.c4
-rw-r--r--io.c3
-rw-r--r--process.c8
-rw-r--r--signal.c2
-rw-r--r--vm_dump.c2
8 files changed, 19 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 37ca07ee59..672ce70284 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Mon Jul 9 23:59:36 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * dln.c: Simplify and make consistent an ifdef for Mac OS X.
+ * ext/socket/rubysocket.h: ditto.
+ * ext/tk/stubs.c: ditto.
+ * io.c: ditto.
+ * process.c: ditto.
+ * signal.c: ditto.
+ * vm_dump.c: ditto.
+
Mon Jul 9 17:37:35 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (win95_stat): remove unnecessary macro.
diff --git a/dln.c b/dln.c
index cc15370fbc..ed107551c7 100644
--- a/dln.c
+++ b/dln.c
@@ -75,7 +75,7 @@ void *xrealloc();
char *getenv();
#endif
-#if defined(__APPLE__) && defined(__MACH__) /* Mac OS X */
+#ifdef __APPLE__
# if defined(HAVE_DLOPEN)
/* Mac OS X with dlopen (10.3 or later) */
# define MACOSX_DLOPEN
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index 16403160ec..3b6f51f376 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -139,7 +139,7 @@ struct sockaddr_storage {
};
#endif
-#if defined __APPLE__ && defined __MACH__
+#ifdef __APPLE__
/*
* CMSG_ macros are broken on 64bit darwin, because __DARWIN_ALIGN
* aligns up to __darwin_size_t which is 64bit, but CMSG_DATA is
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
index dd475c3455..7398a79ae3 100644
--- a/ext/tk/stubs.c
+++ b/ext/tk/stubs.c
@@ -96,7 +96,7 @@ _nativethread_consistency_check(ip)
# define TK_INDEX 7
# define TCL_NAME "libtcl8.9%s"
# define TK_NAME "libtk8.9%s"
-# if defined(__APPLE__) && defined(__MACH__) /* Mac OS X */
+# ifdef __APPLE__
# undef DLEXT
# define DLEXT ".dylib"
# endif
@@ -329,7 +329,7 @@ ruby_tk_stubs_init(tcl_ip)
if (!p_Tk_Init)
return NO_Tk_Init;
-#if defined USE_TK_STUBS && defined TK_FRAMEWORK && defined(__APPLE__) && defined(__MACH__)
+#if defined USE_TK_STUBS && defined TK_FRAMEWORK && defined(__APPLE__)
/*
FIX ME : dirty hack for Mac OS X frameworks.
With stubs, fails to find Resource/Script directory of Tk.framework.
diff --git a/io.c b/io.c
index d218e8ce22..9f37e03909 100644
--- a/io.c
+++ b/io.c
@@ -4010,8 +4010,7 @@ rb_io_close(VALUE io)
if (fptr->fd < 0) return Qnil;
fd = fptr->fd;
-#if defined __APPLE__ && defined(__MACH__) && \
- (!defined(MAC_OS_X_VERSION_MIN_ALLOWED) || MAC_OS_X_VERSION_MIN_ALLOWED <= 1050)
+#if defined __APPLE__ && (!defined(MAC_OS_X_VERSION_MIN_ALLOWED) || MAC_OS_X_VERSION_MIN_ALLOWED <= 1050)
/* close(2) on a fd which is being read by another thread causes
* deadlock on Mac OS X 10.5 */
rb_thread_fd_close(fd);
diff --git a/process.c b/process.c
index 62520fc318..f6badfae1a 100644
--- a/process.c
+++ b/process.c
@@ -104,10 +104,6 @@ static VALUE rb_cProcessTms;
#define WSTOPSIG WEXITSTATUS
#endif
-#if defined(__APPLE__) && ( defined(__MACH__) || defined(__DARWIN__) ) && !defined(__MacOS_X__)
-#define __MacOS_X__ 1
-#endif
-
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
#define HAVE_44BSD_SETUID 1
#define HAVE_44BSD_SETGID 1
@@ -127,7 +123,7 @@ int setreuid(rb_uid_t ruid, rb_uid_t euid);
int setregid(rb_gid_t rgid, rb_gid_t egid);
#endif
-#if defined(HAVE_44BSD_SETUID) || defined(__MacOS_X__)
+#if defined(HAVE_44BSD_SETUID) || defined(__APPLE__)
#if !defined(USE_SETREUID) && !defined(BROKEN_SETREUID)
#define OBSOLETE_SETREUID 1
#endif
@@ -2305,7 +2301,7 @@ rb_f_exec(int argc, VALUE *argv)
rb_execarg_fixup(execarg_obj);
fail_str = eargp->use_shell ? eargp->invoke.sh.shell_script : eargp->invoke.cmd.command_name;
-#ifdef __MacOS_X__
+#ifdef __APPLE__
rb_exec_without_timer_thread(eargp, errmsg, sizeof(errmsg));
#else
rb_exec_async_signal_safe(eargp, errmsg, sizeof(errmsg));
diff --git a/signal.c b/signal.c
index e946337ae7..bd0313bfdd 100644
--- a/signal.c
+++ b/signal.c
@@ -567,7 +567,7 @@ sigbus(int sig SIGINFO_ARG)
* and it's delivered as SIGBUS instaed of SIGSEGV to userland. It's crazy
* wrong IMHO. but anyway we have to care it. Sigh.
*/
-#if defined __MACH__ && defined __APPLE__ && defined USE_SIGALTSTACK
+#if defined __APPLE__ && defined USE_SIGALTSTACK
int ruby_stack_overflowed_p(const rb_thread_t *, const void *);
NORETURN(void ruby_thread_stack_overflow(rb_thread_t *th));
rb_thread_t *th = GET_THREAD();
diff --git a/vm_dump.c b/vm_dump.c
index 68b380b49c..f5081116a8 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -761,7 +761,7 @@ rb_vm_bugreport(void)
"-------------------------------------------\n");
{
-#if defined __MACH__ && defined __APPLE__
+#if defined __APPLE__
fprintf(stderr, "\n");
fprintf(stderr, " See Crash Report log file under "
"~/Library/Logs/CrashReporter or\n");