Skip to content

Fix build system for windows targets#38

Open
RobbieG15 wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
RobbieG15:rgreenslade-windows-fix
Open

Fix build system for windows targets#38
RobbieG15 wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
RobbieG15:rgreenslade-windows-fix

Conversation

@RobbieG15
Copy link
Copy Markdown

This will fix windows build systems.

There is a stricter usage of Chrono with windows and MSVC.

Thank you for all the work on this project.

Let me know if there is anything else I can do if this does not fix it for you all.

I verified that this works on my windows machine.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 6, 2026

Greptile Summary

Wraps the std::chrono::seconds + std::chrono::nanoseconds sum in duration_cast<std::chrono::system_clock::duration>() at line 459 to fix compilation on Windows/MSVC, where system_clock::duration uses 100-nanosecond ticks and MSVC rejects the implicit lossy conversion. The fix is correct and on Linux/macOS (where system_clock::duration is already std::chrono::nanoseconds) the cast is a no-op.

Confidence Score: 5/5

Safe to merge — minimal, correct compatibility fix with no logic impact on non-Windows platforms

Single targeted change, no P0/P1 findings, fix is well-understood and correct per C++ standard

No files require special attention

Important Files Changed

Filename Overview
greenwave_monitor/src/greenwave_monitor.cpp Adds duration_cast for MSVC compatibility when constructing system_clock time_point from nanoseconds sum

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[GetTimestampFromSerializedMessage] --> B[Read sec bytes from buffer]
    B --> C[Read nanosec bytes from buffer]
    C --> D[chrono::seconds + chrono::nanoseconds]
    D --> E{Platform system_clock::duration}
    E -->|Linux/macOS - nanoseconds| F[No-op cast]
    E -->|Windows/MSVC - 100ns ticks| G[Truncating cast via duration_cast]
    F --> H[Construct time_point]
    G --> H
Loading

Reviews (1): Last reviewed commit: "Fix build system for windows targets" | Re-trigger Greptile

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