summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--internal.h3
-rw-r--r--thread.c3
-rw-r--r--thread_pthread.c2
-rw-r--r--thread_win32.c2
-rw-r--r--time.c3
6 files changed, 15 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index dcab50d83b6..3fededb9f9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Tue Mar 26 23:41:18 2013 Tanaka Akira <akr@fsij.org>
+
+ * internal.h: Define TIMET_MAX and TIMET_MIN here.
+
+ * time.c: Remove TIMET_MAX and TIMET_MIN definitions.
+
+ * thread.c: Ditto.
+
+ * thread_pthread.c: Remove TIMET_MAX definition.
+
+ * thread_win32.c: Ditto.
+
Tue Mar 26 22:31:10 2013 Tanaka Akira <akr@fsij.org>
* ext/socket/socket.c (sockaddr_len): return the shortest length for
diff --git a/internal.h b/internal.h
index 3fa07b41a00..598b231a3d2 100644
--- a/internal.h
+++ b/internal.h
@@ -19,6 +19,9 @@ extern "C" {
#endif
#endif
+#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
+#define TIMET_MIN (~(time_t)0 <= 0 ? (time_t)(((unsigned_time_t)1) << (sizeof(time_t) * CHAR_BIT - 1)) : (time_t)0)
+
struct rb_deprecated_classext_struct {
char conflict[sizeof(VALUE) * 3];
};
diff --git a/thread.c b/thread.c
index 189a563c449..9c149928d0f 100644
--- a/thread.c
+++ b/thread.c
@@ -73,9 +73,6 @@
#define THREAD_DEBUG 0
#endif
-#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
-#define TIMET_MIN (~(time_t)0 <= 0 ? (time_t)(((unsigned_time_t)1) << (sizeof(time_t) * CHAR_BIT - 1)) : (time_t)0)
-
VALUE rb_cMutex;
VALUE rb_cThreadShield;
diff --git a/thread_pthread.c b/thread_pthread.c
index 201cb7423ea..78e662ec6e1 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -376,8 +376,6 @@ typedef unsigned LONG_LONG unsigned_time_t;
# error cannot find integer type which size is same as time_t.
#endif
-#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
-
static struct timespec
native_cond_timeout(rb_thread_cond_t *cond, struct timespec timeout_rel)
{
diff --git a/thread_win32.c b/thread_win32.c
index d5858692e96..29700c84f46 100644
--- a/thread_win32.c
+++ b/thread_win32.c
@@ -516,8 +516,6 @@ typedef unsigned LONG_LONG unsigned_time_t;
# error cannot find integer type which size is same as time_t.
#endif
-#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
-
static struct timespec
native_cond_timeout(rb_thread_cond_t *cond, struct timespec timeout_rel)
{
diff --git a/time.c b/time.c
index f5cc691a613..b89665ccda5 100644
--- a/time.c
+++ b/time.c
@@ -736,9 +736,6 @@ typedef unsigned LONG_LONG unsigned_time_t;
# error cannot find integer type which size is same as time_t.
#endif
-#define TIMET_MAX (~(time_t)0 <= 0 ? (time_t)((~(unsigned_time_t)0) >> 1) : (time_t)(~(unsigned_time_t)0))
-#define TIMET_MIN (~(time_t)0 <= 0 ? (time_t)(((unsigned_time_t)1) << (sizeof(time_t) * CHAR_BIT - 1)) : (time_t)0)
-
static wideval_t
rb_time_magnify(wideval_t w)
{