Swatantra-66 opened a new pull request, #21115:
URL: https://github.com/apache/nuttx/pull/21115

   ## Summary
   `<sys/time.h>` defines standard BSD/Linux convenience macros `timeradd`, 
`timersub`, `timerclear`, `timerisset`, and `timercmp` for operations on 
`struct timeval`.
   
   Most standard C libraries (glibc, musl, FreeBSD, NetBSD, OpenBSD) provide 
the corresponding operations for `struct timespec`: `timespecadd`, 
`timespecsub`, `timespecclear`, `timespecisset`, and `timespeccmp`.
   
   This patch implements these standard convenience macros in 
`include/sys/time.h` mirroring the existing `timeval` implementations, 
improving BSD/POSIX portability and compatibility.
   
   ## Impact
   - **Users/Developers:** Adds standard `timespec` arithmetic and comparison 
macros in `<sys/time.h>`.
   - **Compatibility:** Backward compatible. No existing APIs, ABI, or 
behaviors modified.
   - **Build/Hardware:** No impact on existing builds.
   
   ## Testing
   - Verified syntax, header inclusion (`<time.h>` is already included in 
`include/sys/time.h`), and clean compilation.
   - Verified style adherence via `tools/checkpatch.sh`:
     - 0 errors, 0 warnings.
     - All lines within standard 78-column limit.
     - No trailing whitespace.
   - Verified macro behavior across edge cases (carry on addition at boundary 
$10^9\text{ ns}$, borrow on subtraction, equality, zero clearing, relational 
comparison operators).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to