summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-26 15:30:27 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-26 15:30:27 +0000
commit3dcdfcf884479107efb1c4007a592a1f086a4ce9 (patch)
tree17b974d3a11814d15f11033e7bf1fd4752583999 /internal.h
parentbdc42b0ef3e92fb4a9467500a5af5fb662a35355 (diff)
* internal.h (TIMET_MAX_PLUS_ONE): Defined.
* thread.c (double2timeval): Saturate out-of-range values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 598b231a3d..3600fe17d6 100644
--- a/internal.h
+++ b/internal.h
@@ -22,6 +22,10 @@ extern "C" {
#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)
+#define TIMET_MAX_PLUS_ONE (~(time_t)0 <= 0 ? \
+ ((time_t)1 << (sizeof(time_t) * CHAR_BIT / 2)) * (double)((time_t)1 << (sizeof(time_t) * CHAR_BIT / 2 - 1)) : \
+ ((time_t)1 << (sizeof(time_t) * CHAR_BIT / 2)) * (double)((time_t)1 << (sizeof(time_t) * CHAR_BIT / 2)))
+
struct rb_deprecated_classext_struct {
char conflict[sizeof(VALUE) * 3];
};