Skip to content

Commit e759399

Browse files
nobusamuel-williams-shopify
authored andcommitted
Use macros for specific purposes
1 parent 75e7b91 commit e759399

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

file.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3921,7 +3921,7 @@ copy_home_path(VALUE result, const char *dir)
39213921
memcpy(buf = RSTRING_PTR(result), dir, dirlen);
39223922
encidx = rb_filesystem_encindex();
39233923
rb_enc_associate_index(result, encidx);
3924-
#if defined DOSISH || defined __CYGWIN__
3924+
#if defined FILE_ALT_SEPARATOR
39253925
rb_encoding *enc = rb_enc_from_index(encidx);
39263926
bool mb_enc = enc_mbclen_needed(enc);
39273927
for (char *p = buf, *bend = p + dirlen; p < bend; Inc(p, bend, mb_enc, enc)) {
@@ -4169,14 +4169,14 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
41694169
BUFINIT();
41704170
p = e;
41714171
}
4172-
#if defined DOSISH || defined __CYGWIN__
4172+
#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
41734173
if (s < fend && isdirsep(*s)) {
41744174
/* specified full path, but not drive letter nor UNC */
41754175
/* we need to get the drive letter or UNC share name */
41764176
p = skipprefix(buf, p, mb_enc, enc);
41774177
}
41784178
else
4179-
#endif /* defined DOSISH || defined __CYGWIN__ */
4179+
#endif /* defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC */
41804180
p = chompdirsep(skiproot(buf, p), p, mb_enc, enc);
41814181
}
41824182
else {
@@ -4233,8 +4233,8 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
42334233
#endif /* USE_NTFS */
42344234
break;
42354235
case '/':
4236-
#if defined DOSISH || defined __CYGWIN__
4237-
case '\\':
4236+
#if defined FILE_ALT_SEPARATOR
4237+
case FILE_ALT_SEPARATOR:
42384238
#endif
42394239
b = ++s;
42404240
break;
@@ -4258,8 +4258,8 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
42584258
#endif /* USE_NTFS */
42594259
break;
42604260
case '/':
4261-
#if defined DOSISH || defined __CYGWIN__
4262-
case '\\':
4261+
#if defined FILE_ALT_SEPARATOR
4262+
case FILE_ALT_SEPARATOR:
42634263
#endif
42644264
if (s > b) {
42654265
WITH_ROOTDIFF(BUFCOPY(b, s-b));

0 commit comments

Comments
 (0)