Skip to content

enhance scripted time library a bit#6725

Merged
Goober5000 merged 2 commits into
scp-fs2open:masterfrom
Goober5000:time_lib_stuff
Jun 6, 2025
Merged

enhance scripted time library a bit#6725
Goober5000 merged 2 commits into
scp-fs2open:masterfrom
Goober5000:time_lib_stuff

Conversation

@Goober5000

@Goober5000 Goober5000 commented May 18, 2025

Copy link
Copy Markdown
Contributor

Some closely related changes:

  1. Add __tostring functions for both the l_Timestamp and l_TimeSpan types
  2. Add a getSeconds function for the l_Timestamp type

Tested with a local Scroll script. Also:

  1. Since __tostring requires printf support, add UINT64_T_ARG and INT64_T_ARG macros for printf arguments, similar to SIZE_T_ARG and PTRDIFF_T_ARG.

In the process, fix some issues with the toolchain: in certain CI runs the toolchain headers were being #included multiple times, and certain CI runs produced collisions between clang definitions and gcc definitions. Resolve these issues with #pragma once and preprocessor guards in the event of both gcc and clang being active.

Also remove toolchain.h from sexp_container.cpp since it is already #included via pstypes.h.

@Goober5000 Goober5000 added enhancement A new feature or upgrade of an existing feature to add additional functionality. scripting A feature or issue related to LUA scripting labels May 18, 2025
@Goober5000 Goober5000 force-pushed the time_lib_stuff branch 11 times, most recently from 350afc2 to c61734f Compare May 22, 2025 03:25
Add `UINT64_T_ARG` and `INT64_T_ARG` macros for printf arguments, similar to `SIZE_T_ARG` and `PTRDIFF_T_ARG`.

In the process, fix some issues with the toolchain: in certain CI runs the toolchain headers were being #included multiple times, and certain CI runs produced collisions between clang definitions and gcc definitions.  Resolve these issues with `#pragma once` and preprocessor guards in the event of both gcc and clang being active.

Also remove toolchain.h from sexp_container.cpp since it is already #included via pstypes.h.
1. Add __tostring functions for both the `l_Timestamp` and `l_TimeSpan` types
2. Add a `getSeconds` function for the `l_Timestamp` type

@wookieejedi wookieejedi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Straightforward and things worked as expected

@Goober5000 Goober5000 merged commit 0bf5714 into scp-fs2open:master Jun 6, 2025
16 checks passed
@Goober5000 Goober5000 deleted the time_lib_stuff branch June 6, 2025 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A new feature or upgrade of an existing feature to add additional functionality. scripting A feature or issue related to LUA scripting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants