aboutsummaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-06-30 17:00:48 +0900
committerTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-06-30 17:00:48 +0900
commitc48f0176412f2c15fbb3cbc6052550959f581da9 (patch)
tree8d637080281f0b50f3a303e5a62ccb44e2201b21 /src/cli.c
parent46e6de294243e8dc593551bfe8c0e7090d03a159 (diff)
Add support for release compilation modeHEADmaster
Displays are not shared libraries, but object files that are part of the final executable.
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cli.c b/src/cli.c
index f357ed5..703d418 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -29,6 +29,7 @@ void
cli_display_calc(int x, int y)
{
printf("%d + %d = ", x, y);
+ fflush(stdout);
}
int
@@ -60,3 +61,14 @@ void cli_destroy(void) {}
void *cli_pre_reload(void) {return NULL;}
void cli_post_reload(void *) {}
#endif
+
+#ifdef NDEBUG
+static struct disp __cli_disp = {
+ .init = cli_init,
+ .display_calc = cli_display_calc,
+ .read_input = cli_read_input,
+ .display_res = cli_display_res,
+ .destroy = cli_destroy
+};
+struct disp *cli_disp = &__cli_disp;
+#endif