ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/utility.h in xlsxwriter-0.0.4 vs ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/utility.h in xlsxwriter-0.0.5

- old
+ new

@@ -1,25 +1,26 @@ /* * libxlsxwriter * - * Copyright 2014-2017, John McNamara, jmcnamara@cpan.org. See LICENSE.txt. + * Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt. */ /** * @file utility.h * * @brief Utility functions for libxlsxwriter. * - * <!-- Copyright 2014-2017, John McNamara, jmcnamara@cpan.org --> + * <!-- Copyright 2014-2018, John McNamara, jmcnamara@cpan.org --> * */ #ifndef __LXW_UTILITY_H__ #define __LXW_UTILITY_H__ #include <stdint.h> #include "common.h" +#include "xmlwriter.h" /** * @brief Convert an Excel `A1` cell string into a `(row, col)` pair. * * Convert an Excel `A1` cell string into a `(row, col)` pair. @@ -151,12 +152,16 @@ void lxw_str_tolower(char *str); FILE *lxw_tmpfile(char *tmpdir); -/* Declarations required for unit testing. */ -#ifdef TESTING - +/* Use a user defined function to format doubles in sprintf or else a simple + * macro (the default). */ +#ifdef USE_DOUBLE_FUNCTION +int lxw_sprintf_dbl(char *data, double number); +#else +#define lxw_sprintf_dbl(data, number) \ + lxw_snprintf(data, LXW_ATTR_32, "%.16g", number) #endif /* *INDENT-OFF* */ #ifdef __cplusplus }