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

Chet does not support tm time struct from time.h #32

Closed
michkowalczuk opened this issue Dec 14, 2023 · 1 comment
Closed

Chet does not support tm time struct from time.h #32

michkowalczuk opened this issue Dec 14, 2023 · 1 comment

Comments

@michkowalczuk
Copy link

michkowalczuk commented Dec 14, 2023

My header contains:
#include <time.h>
then uses the tm (c time struct) in the following method:
RESULT MyFunc(struct tm* load_time);
The output Delphi function is:

function MyFunc(load_time: Ptm): Result; cdecl;
  external MY_DLL name _PU + 'MyFunc';

but Ptm (pointer to tm is not defined anywhere) and I get [dcc64 Error] bindings.pas(5446): E2003 Undeclared identifier: 'Ptm' error in RAD Studio.

My workaround is to create a Delphi record and pointer to it in a helper unit:

  tm = record
   tm_sec: Integer;         // seconds,  range 0 to 59
   tm_min: Integer;         // minutes, range 0 to 59
   tm_hour: Integer;        // hours, range 0 to 23
   tm_mday: Integer;        // day of the month, range 1 to 31
   tm_mon: Integer;         // month, range 0 to 11
   tm_year: Integer;        // The number of years since 1900
   tm_wday: Integer;        // day of the week, range 0 to 6
   tm_yday: Integer;        // day in the year, range 0 to 365
   tm_isdst: Integer;       // daylight saving time
  end;

  Ptm = ^tm;  

Shouldn't Chet do it automatically?

@michkowalczuk
Copy link
Author

michkowalczuk commented Dec 18, 2023

Duplicated #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant