Fix missing prototype error, void end of function error on Windows.

MinGW64 gcc silently ignores C prototype with no arguments, issuing
a missing prototype error instead. set_platform_locale must return
a free-able char* even if all of LC_ALL, LC_MESSAGES, and LANG are
unset.
This commit is contained in:
John Ralls 2021-03-25 13:31:19 -07:00
parent db4417b212
commit f3c2d1e145
2 changed files with 3 additions and 2 deletions

View File

@ -25,6 +25,6 @@
#ifndef GNUCASH_LOCALE_PLATFORM_H #ifndef GNUCASH_LOCALE_PLATFORM_H
#define GNUCASH_LOCALE_PLATFORM_H #define GNUCASH_LOCALE_PLATFORM_H
char *set_platform_locale(); char *set_platform_locale(void);
#endif #endif

View File

@ -33,7 +33,7 @@
* retrieve the Windows locale and set POSIX to match. * retrieve the Windows locale and set POSIX to match.
*/ */
char * char *
set_platform_locale() set_platform_locale(void)
{ {
WCHAR lpLocaleName[LOCALE_NAME_MAX_LENGTH]; WCHAR lpLocaleName[LOCALE_NAME_MAX_LENGTH];
char *locale = NULL; char *locale = NULL;
@ -68,4 +68,5 @@ set_platform_locale()
setlocale (LC_ALL, locale); setlocale (LC_ALL, locale);
return locale; return locale;
} }
return g_strdup("C");
} }