Skip to content

Commit 6c8240c

Browse files
committed
FIX: use a macro within the preprocessor to avoid compiler warnings
1 parent f1cab27 commit 6c8240c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/core/n-io.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -504,18 +504,18 @@ static REBSER *Read_All_File(char *fname)
504504
if (!tmp) return R_NONE;
505505

506506
// Convert OS native wide string back to Rebol file type
507-
if (OS_WIDE) {
508-
new = To_REBOL_Path(tmp, 0, OS_WIDE, FALSE);
507+
#ifdef OS_WIDE == TRUE
508+
new = To_REBOL_Path(tmp, 0, OS_WIDE, FALSE);
509+
#else
510+
REBLEN len = LEN_BYTES(tmp);
511+
if (Is_Not_ASCII(tmp, len)) {
512+
// Result from the native call contains Unicode chars...
513+
new = Decode_UTF_String(tmp, len, 8, FALSE, FALSE);
514+
new = To_REBOL_Path(SERIES_DATA(new), SERIES_TAIL(new), -1, FALSE);
509515
} else {
510-
REBLEN len = LEN_BYTES(tmp);
511-
if (Is_Not_ASCII(tmp, len)) {
512-
// Result from the native call contains Unicode chars...
513-
new = Decode_UTF_String(tmp, len, 8, FALSE, FALSE);
514-
new = To_REBOL_Path(SERIES_DATA(new), SERIES_TAIL(new), -1, FALSE);
515-
} else {
516-
new = To_REBOL_Path(tmp, len, 0, FALSE);
517-
}
516+
new = To_REBOL_Path(tmp, len, 0, FALSE);
518517
}
518+
#endif
519519
if (!new) return R_NONE;
520520

521521
Set_Series(REB_FILE, D_RET, new);

0 commit comments

Comments
 (0)