Skip to content

Commit ac45330

Browse files
authored
Merge pull request #2408 from DOCGroup/mergify/bp/ace6tao2/pr-2407
[ace6tao2] Only platforms with a 32bit time_t signed will have problems in 2038,… (backport #2407)
2 parents cca3c2c + 1fa0db6 commit ac45330

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

ACE/tests/Time_Value_Test.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
#include "test_config.h"
1717
#include "ace/ACE.h"
1818
#include "ace/Time_Value.h"
19-
2019
#include "ace/Numeric_Limits.h"
2120

2221
#ifdef ACE_HAS_CPP98_IOSTREAMS
2322
#include <sstream>
2423
#endif
2524

25+
#include <type_traits>
26+
2627
int
2728
run_main (int, ACE_TCHAR *[])
2829
{
@@ -214,9 +215,17 @@ run_main (int, ACE_TCHAR *[])
214215

215216
if (sizeof(time_t) < 8)
216217
{
217-
ACE_ERROR ((LM_ERROR,
218-
ACE_TEXT ("time_t not at least 64bit, this platform will have problems after 2038\n")));
219-
++ret;
218+
if (std::is_signed<time_t>::value)
219+
{
220+
ACE_ERROR ((LM_ERROR,
221+
ACE_TEXT ("time_t is 32bit signed, this platform will have problems after 2038\n")));
222+
++ret;
223+
}
224+
else
225+
{
226+
ACE_DEBUG ((LM_DEBUG,
227+
ACE_TEXT ("time_t is 32bit unsigned, this platform will have problems after 2106\n")));
228+
}
220229
}
221230
else
222231
{

0 commit comments

Comments
 (0)