Commit Graph
8 Commits
Author SHA1 Message Date
Kevin Hellemun 0d0b62575f fix(gcc 4.9.4): compilation errors
The current build for v14.5.0 fails to compile on gcc 4.9.4 which is
used on embedded Kobo systems. 

Ref: https://github.com/OGKevin/cadmus/pull/1005

Change-Id: 7a4bec5b5418bd0921b273d8d4a1e79b
Change-Id-Short: spvolnuouvyr
2026-09-21 11:02:29 -06:00
Garret Rieger 2a6c6b9b90 Add test for hb_result_t::from() that moves the input. 2026-09-04 17:08:08 -06:00
Garret Rieger 18d0fd1a6c Rework TRY macro to work the MSVC:
Split into one macro for void results, and a new TRY_ASSIGN() for when the Ok() value needs to be assigned.
2026-09-04 17:08:08 -06:00
Garret Rieger 2f291a46ae Convert repacker and graph code to utilize to hb_result_t.
Converts all error handling in the repacker/graph code to use hb_result_t.
2026-09-04 17:08:08 -06:00
Garret Rieger 1b229922db Restrict direct value construction of hb_result_t to cases where neither T nor E can convert to the other.
This eliminates potential ambiguity in selecting the error or ok type.
2026-09-02 16:30:59 -06:00
Garret Rieger 5c5dad4659 Add value_or_default() 2026-09-02 16:30:59 -06:00
Garret Rieger 9d25eeab63 Add no discard to hb_result_t so that it must be used when returned.
- Also adds a helper to convert containers with in_error() into a hb_result_t's.
2026-09-02 16:30:59 -06:00
Garret Rieger eca9f9f910 Add hb_result_t<OkVal, ErrVal>
Error handling in repacker is in rough shape. Many of the methods are fallible, but often the return values aren't being checked for error state.

To help address this I thought it might be useful to introduce a result type similar to Result<> in rust (or std::expected) that would force callers to deal with errors in the returns.

This PR introduces hb_result_t<OkVal, ErrVal>.

Assisted by: Gemini
2026-09-02 16:30:59 -06:00