summaryrefslogtreecommitdiff
path: root/printf
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2002-11-20 00:20:46 +0100
committerKevin Ryde <user42@zip.com.au>2002-11-20 00:20:46 +0100
commited86f078c1b312b6353a1209207fa65b9857cdec (patch)
treeef30d1796836272d9ef485986e9f89c66c602cfb /printf
parent256c62b53e89a69e374784c281c2a13e19cca722 (diff)
downloadgmp-ed86f078c1b312b6353a1209207fa65b9857cdec.tar.gz
* printf/doprntf.c: Add decimal point parameter, remove localeconv use.
* cxx/osmpf.cc: Use this with ostream locale decimal_point facet. * printf/doprnt.c: Ditto, with GMP_DECIMAL_POINT.
Diffstat (limited to 'printf')
-rw-r--r--printf/doprnt.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/printf/doprnt.c b/printf/doprnt.c
index 9a26a350a..748a723d9 100644
--- a/printf/doprnt.c
+++ b/printf/doprnt.c
@@ -23,6 +23,8 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
+#define _GNU_SOURCE /* for DECIMAL_POINT in glibc langinfo.h */
+
#include "config.h"
#if HAVE_STDARG
@@ -45,6 +47,14 @@ MA 02111-1307, USA. */
# endif
#endif
+#if HAVE_LANGINFO_H
+#include <langinfo.h> /* for nl_langinfo */
+#endif
+
+#if HAVE_LOCALE_H
+#include <locale.h> /* for localeconv */
+#endif
+
#if HAVE_SYS_TYPES_H
#include <sys/types.h> /* for quad_t */
#endif
@@ -346,6 +356,7 @@ __gmp_doprnt (const struct doprnt_funs_t *funs, void *data,
case 'F':
FLUSH ();
DOPRNT_ACCUMULATE (__gmp_doprnt_mpf (funs, data, &param,
+ GMP_DECIMAL_POINT,
va_arg (ap, mpf_srcptr)));
va_copy (last_ap, ap);
last_fmt = fmt;