mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Fix for issue #202, regarding the lack of implementation of the localeconv method in some SDK's.
A macro named `ENABLE_LOCALES` was added and an option with the same name too in the CMakeLists.txt
This commit is contained in:
4
cJSON.c
4
cJSON.c
@ -193,8 +193,12 @@ CJSON_PUBLIC(void) cJSON_Delete(cJSON *item)
|
||||
/* get the decimal point character of the current locale */
|
||||
static unsigned char get_decimal_point(void)
|
||||
{
|
||||
#ifdef ENABLE_LOCALES
|
||||
struct lconv *lconv = localeconv();
|
||||
return (unsigned char) lconv->decimal_point[0];
|
||||
#else
|
||||
return '.';
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
Reference in New Issue
Block a user