mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
terminal: wrap UNITTEST block with #if guard to avoid linker errors
See also: https://libera.irclog.whitequark.org/foot/2021-10-09
This commit is contained in:
parent
0be711497d
commit
e1e28f98f9
1 changed files with 9 additions and 0 deletions
|
|
@ -2259,6 +2259,14 @@ term_erase_scrollback(struct terminal *term)
|
|||
term_damage_view(term);
|
||||
}
|
||||
|
||||
/*
|
||||
* This UNITTEST block uses functions that don't have PGO stubs; so it could
|
||||
* cause linker errors in PGO builds if the whole block isn't discarded by
|
||||
* the compiler (e.g. when no optimization flags are used). Doing a PGO build
|
||||
* without optimization usually makes very little sense, but we prevent such
|
||||
* errors from happening anyway, by using an #if guard.
|
||||
*/
|
||||
#if defined(_DEBUG)
|
||||
UNITTEST
|
||||
{
|
||||
const int scrollback_rows = 16;
|
||||
|
|
@ -2385,6 +2393,7 @@ UNITTEST
|
|||
free(term.normal.rows);
|
||||
fdm_destroy(fdm);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
term_row_rel_to_abs(const struct terminal *term, int row)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue