I am working on “pg_locale compilation error with Visual Studio 2017”, Related threads[1],[2]. We are getting compilation error in static char *IsoLocaleName(const char *winlocname) function in pg_locale.c file. This function is trying to convert the locale name into the Unix style. For example, it will change the locale name "en-US" into "en_US".
How do you reproduce this issue with Visual Studio? I see there is an ifdef directive above IsoLocaleName():
#if defined(WIN32) && defined(LC_MESSAGES)
I would expect defined(LC_MESSAGES) to be false in MSVC.