From 458d1dc75d75af2535bc533dba21f61f0b9ae8fe Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sun, 24 Jul 2005 18:41:30 +0000 Subject: Attempt to make 'localeconv()' part of the configuration process. VC6 works, but I'll need feedback for all other platforms... . Trying OS X in a few minutes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4454 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Input.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index 93f278bbb..4bf5ee2b5 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -33,13 +33,17 @@ #include #include -#include #include #include #include #include #include "flstring.h" +#ifdef HAVE_LOCALE_H +# include +#endif + + void Fl_Input::draw() { if (input_type() == FL_HIDDEN_INPUT) return; Fl_Boxtype b = box(); @@ -69,8 +73,12 @@ int Fl_Input::shift_up_down_position(int p) { // into account (for example, continental Europe uses a comma instead // of a decimal point). For back compatibility reasons, we always // allow the decimal point. +#ifdef HAVE_LOCALECONV static char *standard_fp_chars = ".eE+-"; static char *legal_fp_chars = 0L; +#else +static char *legal_fp_chars = ".eE+-"; +#endif int Fl_Input::handle_key() { @@ -86,6 +94,7 @@ int Fl_Input::handle_key() { Fl::compose_reset(); // ignore any foreign letters... // initialize the list of legal characters inside a floating point number +#ifdef HAVE_LOCALECONV if (!legal_fp_chars) { int len = strlen(standard_fp_chars); struct lconv *lc = localeconv(); @@ -106,6 +115,7 @@ int Fl_Input::handle_key() { if (lc->negative_sign) strcat(legal_fp_chars, lc->negative_sign); } } +#endif // This is complex to allow "0xff12" hex to be typed: if (!position() && (ascii == '+' || ascii == '-') || -- cgit v1.2.3