From 11f6fe1579a67377b5922338a72acaf348546fa3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 23 Feb 2024 10:01:53 -0500 Subject: Allow print() (also Debug) to be used even in normal viewer code. Since print() writes to cerr, we used to be able to use it only in test programs. Making the cerr writes conditional on LL_TEST allows us to use it for debugging the code under test as well, since in the normal viewer the cerr statements vanish. --- indra/test/print.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/test/print.h b/indra/test/print.h index 08e36caddf..749603907e 100644 --- a/indra/test/print.h +++ b/indra/test/print.h @@ -23,7 +23,9 @@ struct NONL_t {}; inline void print() { +#ifdef LL_TEST std::cerr << std::endl; +#endif } // print(NONL) is a no-op @@ -35,8 +37,10 @@ void print(NONL_t) template void print(T&& first, ARGS&&... rest) { +#ifdef LL_TEST std::cerr << first; print(std::forward(rest)...); +#endif } #endif /* ! defined(LL_PRINT_H) */ -- cgit v1.2.3