Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2aee16c

Browse files
author
Daniel Shelepanov
committed
[PBCKP-216] win32 support added
1 parent6ea25c7 commit2aee16c

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

‎src/show.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,16 +1046,35 @@ show_archive_json(const char *instance_name, uint32 xlog_seg_size,
10461046
appendPQExpBuffer(buf,"%lu",tlinfo->size);
10471047

10481048
json_add_key(buf,"zratio",json_level);
1049+
10491050
// forcing comma-based floating point representation
1050-
locale_tnewloc=newlocale(LC_NUMERIC_MASK,"POSIX", (locale_t)0);
1051-
locale_tsaveloc=uselocale(newloc);
1051+
locale_tsaveloc;
1052+
#ifdefHAVE_USELOCALE
1053+
locale_tnewloc=newlocale(LC_NUMERIC_MASK,"C", (locale_t)0);
1054+
saveloc=uselocale(newloc);
1055+
#else
1056+
#ifdefHAVE__CONFIGTHREADLOCALE
1057+
locale_toldthreadlocale=_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
1058+
#endif
1059+
saveloc=setlocale(LC_NUMERIC,NULL);
1060+
setlocale(LC_NUMERIC,"C");
1061+
#endif
10521062
if (tlinfo->size!=0)
10531063
zratio= ((float)xlog_seg_size*tlinfo->n_xlog_files) /tlinfo->size;
10541064
appendPQExpBuffer(buf,"%.2f",zratio);
1065+
10551066
// restoring previous locale
1067+
#ifdefHAVE_USELOCALE
10561068
if(saveloc!= (locale_t)0)
10571069
uselocale(saveloc);
10581070
freelocale(newloc);
1071+
#else
1072+
setlocale(LC_NUMERIC,saveloc);
1073+
#ifdefHAVE__CONFIGTHREADLOCALE
1074+
if(oldthreadlocale!=-1)
1075+
_configthreadlocale(oldthreadlocale);
1076+
#endif
1077+
#endif
10591078

10601079
if (tlinfo->closest_backup!=NULL)
10611080
snprintf(tmp_buf,lengthof(tmp_buf),"%s",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp