Skip to content

Fix time_t typedef redefinition in tu_timer.cpp - #25

Merged
ClausValcaTD merged 4 commits into
mainfrom
fix-tu-timer-time-t-redefinition-16965233988673410312
Oct 4, 2026
Merged

ClausValcaTD merged 4 commits into
mainfrom
fix-tu-timer-time-t-redefinition-16965233988673410312

Conversation

@ClausValcaTD

Copy link
Copy Markdown
Contributor

Fixes time_t typedef redefinition in third_party/gameswf/base/tu_timer.cpp to prevent build failures on MSVC (Windows) and Emscripten (WebAssembly).


PR created automatically by Jules for task 16965233988673410312 started by @ClausValcaTD

Avoid redefining time_t on Windows (_WIN32), WebAssembly/Emscripten (__EMSCRIPTEN__),
or platforms where _TIME_T_DEFINED / __time_t_defined are set. This resolves MSVC
C3646/C2039 errors on Windows and type redefinition errors on WebAssembly.

Co-authored-by: ClausValcaTD <193546948+ClausValcaTD@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 3 commits October 4, 2026 01:54
Include system <time.h> before the time_t typedef check so system headers declare
time_t on Windows, Emscripten, macOS, and Linux platforms. Fixes time_t unknown
type errors on MSVC and WebAssembly.

Co-authored-by: ClausValcaTD <193546948+ClausValcaTD@users.noreply.github.com>
Include system <time.h> and <sys/time.h> before the time_t guard block to ensure
time_t is declared by standard headers across Windows, WebAssembly/Emscripten,
macOS, and Linux. Populate struct timeb members in ftime() to prevent uninitialized
garbage time values causing runtime assertion/SIGTRAP crashes.

Co-authored-by: ClausValcaTD <193546948+ClausValcaTD@users.noreply.github.com>
Include system <time.h> and <sys/time.h> in tu_timer.cpp so system definitions
for time_t are available on Windows, Emscripten, macOS, and Linux. Populate
struct timeb in ftime() and fallback s_start_time in get_ticks() to prevent
uninitialized memory arithmetic crashes.

Co-authored-by: ClausValcaTD <193546948+ClausValcaTD@users.noreply.github.com>
@ClausValcaTD
ClausValcaTD merged commit dfd7686 into main Oct 4, 2026
3 of 5 checks passed
@ClausValcaTD
ClausValcaTD deleted the fix-tu-timer-time-t-redefinition-16965233988673410312 branch October 4, 2026 09:53
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

Successfully merging this pull request may close these issues.

1 participant