From 301b17769b9831eb44b450c270f49926d463b52d Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 1 Mar 2006 21:20:20 +0000 Subject: [PATCH] added utility macro git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@654 9efc2488-bf62-4759-914b-345cdb29e865 --- src/utils/utils.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/utils.h b/src/utils/utils.h index f7226dd..01eb7aa 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -63,6 +63,14 @@ GNU General Public License for more details. snprintf(__b, __len - 1, "%lf", l); \ char* DOUBLESTR = __b; +#define LONG_DOUBLE_TO_STRING(l) \ + unsigned int __len = snprintf(NULL, 0, "%Lf", l) + 2; \ + char __b[__len]; \ + bzero(__b, __len); \ + snprintf(__b, __len - 1, "%Lf", l); \ + char* LONGDOUBLESTR = __b; + + #define INT_TO_STRING(l) \ unsigned int __len = snprintf(NULL, 0, "%d", l) + 2; \ char __b[__len]; \ -- 2.11.0