Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
6532bfce
Commit
6532bfce
authored
Jan 06, 2016
by
Wouter van Oortmerssen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3493 from parnic/support-platforms-without-realpath
Fix build for platforms not supporting realpath
parents
56f9b2d1
a3363def
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
util.h
include/flatbuffers/util.h
+12
-8
No files found.
include/flatbuffers/util.h
View file @
6532bfce
...
@@ -219,15 +219,19 @@ inline void EnsureDirExists(const std::string &filepath) {
...
@@ -219,15 +219,19 @@ inline void EnsureDirExists(const std::string &filepath) {
// Obtains the absolute path from any other path.
// Obtains the absolute path from any other path.
// Returns the input path if the absolute path couldn't be resolved.
// Returns the input path if the absolute path couldn't be resolved.
inline
std
::
string
AbsolutePath
(
const
std
::
string
&
filepath
)
{
inline
std
::
string
AbsolutePath
(
const
std
::
string
&
filepath
)
{
#ifdef _WIN32
#ifdef FLATBUFFERS_NO_ABSOLUTE_PATH_RESOLUTION
char
abs_path
[
MAX_PATH
];
return
filepath
;
return
GetFullPathNameA
(
filepath
.
c_str
(),
MAX_PATH
,
abs_path
,
nullptr
)
#else
#else
char
abs_path
[
PATH_MAX
];
#ifdef _WIN32
return
realpath
(
filepath
.
c_str
(),
abs_path
)
char
abs_path
[
MAX_PATH
];
#endif
return
GetFullPathNameA
(
filepath
.
c_str
(),
MAX_PATH
,
abs_path
,
nullptr
)
?
abs_path
#else
:
filepath
;
char
abs_path
[
PATH_MAX
];
return
realpath
(
filepath
.
c_str
(),
abs_path
)
#endif
?
abs_path
:
filepath
;
#endif // FLATBUFFERS_NO_ABSOLUTE_PATH_RESOLUTION
}
}
// To and from UTF-8 unicode conversion functions
// To and from UTF-8 unicode conversion functions
...
...
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