Skip to content

Conversation

@beniaminopozzan
Copy link
Member

The current implementation of the of the logic to use PX4-specific time function:

#if defined(__PX4_NUTTX) || defined(__PX4_POSIX) || defined(UCLIENT_PLATFORM_NUTTX) || defined(UCLIENT_PLATFORM_POSIX)

ended up always selecting PX4 variation through the defined(UCLIENT_PLATFORM_NUTTX) || defined(UCLIENT_PLATFORM_POSIX) checks.

This was spotted in eProsima#408 and its check: https://github.com/eProsima/Micro-XRCE-DDS-Client/actions/runs/19801939470/job/56760212846

This PR proposed to change the check to

#if defined(__PX4)

and then let PX4 uxrce_dds_client module CMakeList.txt to add __PX4 to the submodule.

@beniaminopozzan
Copy link
Member Author

@dagar , do you know of any better symbol (instead of __PX4)?

Initially I wanted to keep using __PX4_NUTTX and __PX4_POSIX but:

  • The PX4-specific behaviour does not change based on nuttx or posix, so only one unified symbol is required
  • Given the current way the this library is build in PX4: https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/CMakeLists.txt I couldn't see __PX4_NUTTX or __PX4_POSIX being autimatically included. If I just reduce the checks to #if defined(__PX4_NUTTX) || defined(__PX4_POSIX) and recompile without altering the CMakeLists.txt, then the PX4 specific logic won't be built.

So I settled for __PX4 and added it to https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/uxrce_dds_client/CMakeLists.txt in PX4/PX4-Autopilot#26045

@beniaminopozzan beniaminopozzan requested a review from dagar December 8, 2025 07:56
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.

2 participants