Skip to content

Commit 79ddb1f

Browse files
authored
Merge pull request #2407 from jwillemsen/jwi-timetsigned
Only platforms with a 32bit time_t signed will have problems in 2038,…
2 parents f18aa97 + 0dbaa60 commit 79ddb1f

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

ACE/tests/Time_Value_Test.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
#include "test_config.h"
1717
#include "ace/ACE.h"
1818
#include "ace/Time_Value.h"
19-
2019
#include "ace/Numeric_Limits.h"
21-
2220
#include <sstream>
21+
#include <type_traits>
2322

2423
int
2524
run_main (int, ACE_TCHAR *[])
@@ -210,9 +209,17 @@ run_main (int, ACE_TCHAR *[])
210209

211210
if (sizeof(time_t) < 8)
212211
{
213-
ACE_ERROR ((LM_ERROR,
214-
ACE_TEXT ("time_t not at least 64bit, this platform will have problems after 2038\n")));
215-
++ret;
212+
if (std::is_signed<time_t>::value)
213+
{
214+
ACE_ERROR ((LM_ERROR,
215+
ACE_TEXT ("time_t is 32bit signed, this platform will have problems after 2038\n")));
216+
++ret;
217+
}
218+
else
219+
{
220+
ACE_DEBUG ((LM_DEBUG,
221+
ACE_TEXT ("time_t is 32bit unsigned, this platform will have problems after 2106\n")));
222+
}
216223
}
217224
else
218225
{

0 commit comments

Comments
 (0)