aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--cont.c2
-rw-r--r--dln.c10
-rw-r--r--ext/sdbm/_sdbm.c2
-rw-r--r--io.c10
5 files changed, 24 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e22a05f72..d9367a1979 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Oct 24 22:45:37 2011 Tanaka Akira <akr@fsij.org>
+
+ * io.c: use "__sun" instead of "sun" to detect SunOS.
+
+ * dln.c: ditto.
+
+ * cont.c: ditto.
+
+ * ext/sdbm/_sdbm.c: ditto.
+
+ [ruby-dev:44693]
+
Mon Oct 24 22:38:08 2011 Tanaka Akira <akr@fsij.org>
* ext/pty/pty.c (get_device_once): delay rb_fd_set_cloexec() until
diff --git a/cont.c b/cont.c
index c91cae6e9d..0ed1f2c032 100644
--- a/cont.c
+++ b/cont.c
@@ -15,7 +15,7 @@
#include "gc.h"
#include "eval_intern.h"
-#if ((defined(_WIN32) && _WIN32_WINNT >= 0x0400) || (defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT))) && !defined(__NetBSD__) && !defined(sun) && !defined(FIBER_USE_NATIVE)
+#if ((defined(_WIN32) && _WIN32_WINNT >= 0x0400) || (defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT))) && !defined(__NetBSD__) && !defined(__sun) && !defined(FIBER_USE_NATIVE)
#define FIBER_USE_NATIVE 1
/* FIBER_USE_NATIVE enables Fiber performance improvement using system
diff --git a/dln.c b/dln.c
index 7d5d6b8543..20eaa5e364 100644
--- a/dln.c
+++ b/dln.c
@@ -228,7 +228,7 @@ load_header(int fd, struct exec *hdrp, long disp)
#define RELOC_TARGET_SIZE(r) ((r)->r_length)
#endif
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(sparc)
/* Sparc (Sun 4) macros */
# undef relocation_info
# define relocation_info reloc_info_sparc
@@ -530,7 +530,7 @@ reloc_undef(int no, struct undef *undef, struct reloc_arg *arg)
{
int datum;
char *address;
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(sparc)
unsigned int mask = 0;
#endif
@@ -539,7 +539,7 @@ reloc_undef(int no, struct undef *undef, struct reloc_arg *arg)
datum = arg->value;
if (R_PCREL(&(undef->reloc))) datum -= undef->base;
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(sparc)
datum += undef->reloc.r_addend;
datum >>= R_RIGHTSHIFT(&(undef->reloc));
mask = (1 << R_BITSIZE(&(undef->reloc))) - 1;
@@ -763,7 +763,7 @@ load_1(int fd, long disp, const char *need_init)
while (rel < rel_end) {
char *address = (char*)(rel->r_address + block);
long datum = 0;
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(sparc)
unsigned int mask = 0;
#endif
@@ -798,7 +798,7 @@ load_1(int fd, long disp, const char *need_init)
} /* end .. is static */
if (R_PCREL(rel)) datum -= block;
-#if defined(sun) && defined(sparc)
+#if defined(__sun) && defined(sparc)
datum += rel->r_addend;
datum >>= R_RIGHTSHIFT(rel);
mask = (1 << R_BITSIZE(rel)) - 1;
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index 28e5b03b31..553190fe9c 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -110,7 +110,7 @@ static int duppair proto((char *, datum));
/*
* externals
*/
-#if !defined sun && !defined _WIN32 && !defined __CYGWIN__ && !defined(errno)
+#if !defined(__sun) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(errno)
extern int errno;
#endif
diff --git a/io.c b/io.c
index 15e2ec982b..35157ec6ff 100644
--- a/io.c
+++ b/io.c
@@ -35,7 +35,7 @@
# define NO_SAFE_RENAME
#endif
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(sun) || defined(_nec_ews)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun) || defined(_nec_ews)
# define USE_SETVBUF
#endif
@@ -4649,18 +4649,18 @@ rb_fdopen(int fd, const char *modestr)
{
FILE *file;
-#if defined(sun)
+#if defined(__sun)
errno = 0;
#endif
file = fdopen(fd, modestr);
if (!file) {
if (
-#if defined(sun)
+#if defined(__sun)
errno == 0 ||
#endif
errno == EMFILE || errno == ENFILE) {
rb_gc();
-#if defined(sun)
+#if defined(__sun)
errno = 0;
#endif
file = fdopen(fd, modestr);
@@ -4668,7 +4668,7 @@ rb_fdopen(int fd, const char *modestr)
if (!file) {
#ifdef _WIN32
if (errno == 0) errno = EINVAL;
-#elif defined(sun)
+#elif defined(__sun)
if (errno == 0) errno = EMFILE;
#endif
rb_sys_fail(0);