Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time_t is on windows 64-bit #490

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 34 additions & 10 deletions Lib/System/IdCTypes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,26 @@ interface
{$IFDEF HAS_TIME_T}
TIdC_TIMET = time_t;
{$ELSE}
{$IFDEF HAS_PtrInt}
TIdC_TIMET = PtrInt;
// On windows time_t is per default always 64-bit!
// https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/time-time32-time64?view=msvc-170
// time is a wrapper for _time64 and time_t is, by default, equivalent to __time64_t. If you
// need to force the compiler to interpret time_t as the old 32-bit time_t, you can define
// _USE_32BIT_TIME_T. We don't recommend _USE_32BIT_TIME_T, because your application may fail
// after January 18, 2038; the use of this macro isn't allowed on 64-bit platforms.
{$IFDEF WINDOWS}
TIdC_TIMET = TIdC_INT64;
// On Unix systems time_t is bit depended
// https://www.ibm.com/docs/en/ibm-mq/9.1?topic=platforms-standard-data-types-unix-linux-windows
{$ELSE}
{$IFDEF CPU32}
{$IFDEF HAS_PtrInt}
TIdC_TIMET = PtrInt;
{$ELSE}
{$IFDEF CPU32}
TIdC_TIMET = TIdC_INT32;
{$ENDIF}
{$IFDEF CPU64}
{$ENDIF}
{$IFDEF CPU64}
TIdC_TIMET = TIdC_INT64;
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
Expand Down Expand Up @@ -261,14 +273,26 @@ interface
{$IFDEF HAS_TIME_T}
TIdC_TIMET = time_t;
{$ELSE}
{$IFDEF HAS_NativeInt}
TIdC_TIMET = NativeInt;
// On windows time_t is per default always 64-bit!
// https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/time-time32-time64?view=msvc-170
// time is a wrapper for _time64 and time_t is, by default, equivalent to __time64_t. If you
// need to force the compiler to interpret time_t as the old 32-bit time_t, you can define
// _USE_32BIT_TIME_T. We don't recommend _USE_32BIT_TIME_T, because your application may fail
// after January 18, 2038; the use of this macro isn't allowed on 64-bit platforms.
{$IFDEF WINDOWS}
TIdC_TIMET = TIdC_INT64;
// On Unix systems time_t is bit depended
// https://www.ibm.com/docs/en/ibm-mq/9.1?topic=platforms-standard-data-types-unix-linux-windows
{$ELSE}
{$IFDEF CPU32}
{$IFDEF HAS_NativeInt}
TIdC_TIMET = NativeInt;
{$ELSE}
{$IFDEF CPU32}
TIdC_TIMET = TIdC_INT32;
{$ENDIF}
{$IFDEF CPU64}
{$ENDIF}
{$IFDEF CPU64}
TIdC_TIMET = TIdC_INT64;
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
Expand Down