File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -125,10 +125,11 @@ fn make_dir(p: path, mode: int) -> bool {
125
125
ret mkdir ( p, mode) ;
126
126
127
127
#[ cfg( target_os = "win32" ) ]
128
- fn mkdir ( _p : path , _mode : int ) -> bool {
128
+ fn mkdir ( _p : path , _mode : int ) -> bool unsafe {
129
129
// FIXME: turn mode into something useful?
130
130
ret str:: as_buf ( _p, { |buf|
131
- os:: kernel32:: CreateDirectory ( buf, ptr:: null ( ) )
131
+ os:: kernel32:: CreateDirectoryA (
132
+ buf, unsafe :: reinterpret_cast ( 0 ) )
132
133
} ) ;
133
134
}
134
135
@@ -167,7 +168,7 @@ fn remove_dir(p: path) -> bool {
167
168
168
169
#[ cfg( target_os = "win32" ) ]
169
170
fn rmdir ( _p : path ) -> bool {
170
- ret str:: as_buf ( _p, { |buf| os:: kernel32:: RemoveDirectory ( buf) } ) ;
171
+ ret str:: as_buf ( _p, { |buf| os:: kernel32:: RemoveDirectoryA ( buf) } ) ;
171
172
}
172
173
173
174
#[ cfg( target_os = "linux" ) ]
Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ native mod kernel32 {
52
52
fn GetModuleFileNameA ( hModule : HMODULE ,
53
53
lpFilename : LPTSTR ,
54
54
nSize : DWORD ) -> DWORD ;
55
- fn CreateDirectory ( lpPathName : LPCTSTR ,
56
- lpSecurityAttributes : LPSECURITY_ATTRIBUTES ) -> bool ;
57
- fn RemoveDirectory ( lpPathName : LPCTSTR ) -> bool ;
55
+ fn CreateDirectoryA ( lpPathName : LPCTSTR ,
56
+ lpSecurityAttributes : LPSECURITY_ATTRIBUTES ) -> bool ;
57
+ fn RemoveDirectoryA ( lpPathName : LPCTSTR ) -> bool ;
58
58
}
59
59
60
60
// FIXME turn into constants
You can’t perform that action at this time.
0 commit comments