mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04: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);
|
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
|
UNITTEST
|
||||||
{
|
{
|
||||||
const int scrollback_rows = 16;
|
const int scrollback_rows = 16;
|
||||||
|
|
@ -2385,6 +2393,7 @@ UNITTEST
|
||||||
free(term.normal.rows);
|
free(term.normal.rows);
|
||||||
fdm_destroy(fdm);
|
fdm_destroy(fdm);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
term_row_rel_to_abs(const struct terminal *term, int row)
|
term_row_rel_to_abs(const struct terminal *term, int row)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue