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

Commitd8e0921

Browse files
committed
Merge pull request#1398 from nojb/do_not_use_%S
One more Windows Unicode PR: do not use %S(cherry picked from commit6aae29d)
1 parent25b4ef1 commitd8e0921

File tree

6 files changed

+27
-21
lines changed

6 files changed

+27
-21
lines changed

‎Changes

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,10 @@ Release branch for 4.06:
373373

374374
### Runtime system:
375375

376-
* MPR#3771, GPR#153, GPR#1200, GPR#1357, GPR#1362, GPR#1363: Unicode support for
377-
the Windows runtime.
378-
(ygrek,Clement Franchini,Nicolas Ojeda Bar, review by Alain Frisch, David
379-
Allsopp, DamienDoligez)
376+
* MPR#3771, GPR#153, GPR#1200, GPR#1357, GPR#1362, GPR#1363, GPR#1398: Unicode
377+
support forthe Windows runtime.
378+
(ygrek, Nicolas Ojeda Bar, review by Alain Frisch, David Allsopp, Damien
379+
Doligez)
380380

381381
- GPR#1070, GPR#1295: enable gcc typechecking for caml_alloc_sprintf,
382382
caml_gc_message. Make caml_gc_message a variadic function. Fix many

‎byterun/caml/config.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@
3737
#defineARCH_SIZET_PRINTF_FORMAT "z"
3838
#endif
3939

40-
/* Types for Windows wide strings */
41-
42-
#ifdef_WIN32
43-
#defineARCH_CHARNATSTR_PRINTF_FORMAT "S"
44-
#else
45-
#defineARCH_CHARNATSTR_PRINTF_FORMAT "s"
46-
#endif
47-
4840
/* Types for 32-bit integers, 64-bit integers, and
4941
native integers (as wide as a pointer type) */
5042

‎byterun/dynlink.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,13 @@ static char_os * parse_ld_conf(void)
127127
staticvoidopen_shared_lib(char_os*name)
128128
{
129129
char_os*realname;
130+
char*u8;
130131
void*handle;
131132

132133
realname=caml_search_dll_in_path(&caml_shared_libs_path,name);
133-
caml_gc_message(0x100,"Loading shared library %"
134-
ARCH_CHARNATSTR_PRINTF_FORMAT"\n",realname);
134+
u8=caml_stat_strdup_of_os(realname);
135+
caml_gc_message(0x100,"Loading shared library %s\n",u8);
136+
caml_stat_free(u8);
135137
caml_enter_blocking_section();
136138
handle=caml_dlopen(realname,1,1);
137139
caml_leave_blocking_section();

‎byterun/startup.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,12 @@ int caml_attempt_open(char_os **name, struct exec_trailer *trail,
9494
char_os*truename;
9595
intfd;
9696
interr;
97-
charbuf [2];
97+
charbuf [2],*u8;
9898

9999
truename=caml_search_exe_in_path(*name);
100-
caml_gc_message(0x100,"Opening bytecode executable %"
101-
ARCH_CHARNATSTR_PRINTF_FORMAT"\n",truename);
100+
u8=caml_stat_strdup_of_os(truename);
101+
caml_gc_message(0x100,"Opening bytecode executable %s\n",u8);
102+
caml_stat_free(u8);
102103
fd=open_os(truename,O_RDONLY |O_BINARY);
103104
if (fd==-1) {
104105
caml_stat_free(truename);

‎byterun/sys.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ static struct cplugin_context cplugin_context;
634634
voidcaml_load_plugin(char_os*plugin)
635635
{
636636
void*dll_handle=NULL;
637+
char*u8;
637638

638639
dll_handle=caml_dlopen(plugin,DLL_EXECUTABLE,DLL_NOT_GLOBAL);
639640
if(dll_handle!=NULL ){
@@ -646,8 +647,10 @@ void caml_load_plugin(char_os *plugin)
646647
caml_dlclose(dll_handle);
647648
}
648649
}else {
650+
u8=caml_stat_strdup_of_os(plugin);
649651
fprintf(stderr,"Cannot load C plugin %s\nReason: %s\n",
650-
caml_stat_strdup_of_os(plugin),caml_dlerror());
652+
u8,caml_dlerror());
653+
caml_stat_free(u8);
651654
}
652655
}
653656

‎byterun/win32.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ wchar_t * caml_decompose_path(struct ext_table * tbl, wchar_t * path)
149149
wchar_t*caml_search_in_path(structext_table*path,constwchar_t*name)
150150
{
151151
wchar_t*dir,*fullname;
152+
char*u8;
152153
constwchar_t*p;
153154
inti;
154155
struct_stati64st;
@@ -161,19 +162,24 @@ wchar_t * caml_search_in_path(struct ext_table * path, const wchar_t * name)
161162
if (dir[0]==0)continue;
162163
/* not sure what empty path components mean under Windows */
163164
fullname=caml_stat_wcsconcat(3,dir,L"\\",name);
164-
caml_gc_message(0x100,"Searching %"ARCH_CHARNATSTR_PRINTF_FORMAT"\n",fullname);
165+
u8=caml_stat_strdup_of_utf16(fullname);
166+
caml_gc_message(0x100,"Searching %s\n",u8);
167+
caml_stat_free(u8);
165168
if (_wstati64(fullname,&st)==0&&S_ISREG(st.st_mode))
166169
returnfullname;
167170
caml_stat_free(fullname);
168171
}
169172
not_found:
170-
caml_gc_message(0x100,"%"ARCH_CHARNATSTR_PRINTF_FORMAT" not found in search path\n",name);
173+
u8=caml_stat_strdup_of_utf16(name);
174+
caml_gc_message(0x100,"%s not found in search path\n",u8);
175+
caml_stat_free(u8);
171176
returncaml_stat_wcsdup(name);
172177
}
173178

174179
CAMLexportwchar_t*caml_search_exe_in_path(constwchar_t*name)
175180
{
176181
wchar_t*fullname,*filepart;
182+
char*u8;
177183
size_tfullnamelen;
178184
DWORDretcode;
179185

@@ -188,7 +194,9 @@ CAMLexport wchar_t * caml_search_exe_in_path(const wchar_t * name)
188194
fullname,
189195
&filepart);
190196
if (retcode==0) {
191-
caml_gc_message(0x100,"%"ARCH_CHARNATSTR_PRINTF_FORMAT" not found in search path\n",name);
197+
u8=caml_stat_strdup_of_utf16(name);
198+
caml_gc_message(0x100,"%s not found in search path\n",u8);
199+
caml_stat_free(u8);
192200
caml_stat_free(fullname);
193201
returncaml_stat_strdup_os(name);
194202
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp