From c1112f0063aeb3a07f18a062386950ef4efa50a9 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Sat, 8 Aug 2020 10:22:16 +0300 Subject: [PATCH] io: make options changable by user * this will help to disable colorful output because not all terminals can print colors. --- include/cglm/io.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/include/cglm/io.h b/include/cglm/io.h index db0c1a8..33aa10b 100644 --- a/include/cglm/io.h +++ b/include/cglm/io.h @@ -25,10 +25,21 @@ #include #include -#define CGLM_PRINT_PRECISION 5 -#define CGLM_PRINT_MAX_TO_SHORT 1e5 -#define CGLM_PRINT_COLOR "\033[36m" -#define CGLM_PRINT_COLOR_RESET "\033[0m" +#ifndef CGLM_PRINT_PRECISION +# define CGLM_PRINT_PRECISION 5 +#endif + +#ifndef CGLM_PRINT_MAX_TO_SHORT +# define CGLM_PRINT_MAX_TO_SHORT 1e5 +#endif + +#ifndef CGLM_PRINT_COLOR +# define CGLM_PRINT_COLOR "\033[36m" +#endif + +#ifndef CGLM_PRINT_COLOR_RESET +# define CGLM_PRINT_COLOR_RESET "\033[0m" +#endif CGLM_INLINE void