diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-10-21 19:32:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-21 19:32:08 -0500 |
commit | 81d4a2a0e337e341ac1373de0be8762617372ffc (patch) | |
tree | eec38cb65373f9df09fde442fc69bd2088f7d005 /src/util/safe_print.h | |
parent | 638c0bfdc798116925f839118dffd86581a58d43 (diff) | |
parent | f9de5395d78bc5338ca800e539e91795730cbd29 (diff) |
Merge branch 'master' into fixErrorSetfixErrorSet
Diffstat (limited to 'src/util/safe_print.h')
-rw-r--r-- | src/util/safe_print.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/util/safe_print.h b/src/util/safe_print.h index e3280bb55..0bc2b0599 100644 --- a/src/util/safe_print.h +++ b/src/util/safe_print.h @@ -47,12 +47,17 @@ namespace cvc5 { +template <size_t N> +void CVC5_EXPORT safe_print(int fd, const char (&msg)[N]); +template <typename T> +void CVC5_EXPORT safe_print(int fd, const T& obj); + /** * Prints arrays of chars (e.g. string literals) of length N. Safe to use in a * signal handler. */ template <size_t N> -void CVC5_EXPORT safe_print(int fd, const char (&msg)[N]) +void safe_print(int fd, const char (&msg)[N]) { ssize_t nb = N - 1; if (write(fd, msg, nb) != nb) { @@ -96,7 +101,7 @@ auto toStringImpl(const T& obj, int) -> decltype(toString(obj)) * @param obj The object to print */ template <typename T> -void CVC5_EXPORT safe_print(int fd, const T& obj) +void safe_print(int fd, const T& obj) { const char* s = toStringImpl(obj, /* prefer the method that uses `toString()` */ 0); |