Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
6887d5d3
Commit
6887d5d3
authored
Mar 05, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/Traits: use TCHAR on Windows
parent
39c96694
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
FileSystem.hxx
src/fs/FileSystem.hxx
+16
-0
Traits.hxx
src/fs/Traits.hxx
+5
-0
No files found.
src/fs/FileSystem.hxx
View file @
6887d5d3
...
...
@@ -55,7 +55,11 @@ namespace FOpenMode {
static
inline
FILE
*
FOpen
(
Path
file
,
PathTraitsFS
::
const_pointer
mode
)
{
#ifdef WIN32
return
_tfopen
(
file
.
c_str
(),
mode
);
#else
return
fopen
(
file
.
c_str
(),
mode
);
#endif
}
/**
...
...
@@ -64,7 +68,11 @@ FOpen(Path file, PathTraitsFS::const_pointer mode)
static
inline
int
OpenFile
(
Path
file
,
int
flags
,
int
mode
)
{
#ifdef WIN32
return
_topen
(
file
.
c_str
(),
flags
,
mode
);
#else
return
open_cloexec
(
file
.
c_str
(),
flags
,
mode
);
#endif
}
/**
...
...
@@ -73,7 +81,11 @@ OpenFile(Path file, int flags, int mode)
static
inline
bool
RenameFile
(
Path
oldpath
,
Path
newpath
)
{
#ifdef WIN32
return
_trename
(
oldpath
.
c_str
(),
newpath
.
c_str
())
==
0
;
#else
return
rename
(
oldpath
.
c_str
(),
newpath
.
c_str
())
==
0
;
#endif
}
#ifndef WIN32
...
...
@@ -98,7 +110,11 @@ StatFile(Path file, struct stat &buf, bool follow_symlinks = true)
static
inline
bool
RemoveFile
(
Path
file
)
{
#ifdef WIN32
return
_tunlink
(
file
.
c_str
())
==
0
;
#else
return
unlink
(
file
.
c_str
())
==
0
;
#endif
}
/**
...
...
src/fs/Traits.hxx
View file @
6887d5d3
...
...
@@ -26,13 +26,18 @@
#ifdef WIN32
#include "util/CharUtil.hxx"
#include <tchar.h>
#endif
#include <string>
#include <assert.h>
#ifdef WIN32
#define PATH_LITERAL(s) _T(s)
#else
#define PATH_LITERAL(s) (s)
#endif
/**
* This class describes the nature of a native filesystem path.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment