summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingFile.c
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-07-15 18:48:14 +0000
committerXinliang David Li <davidxl@google.com>2016-07-15 18:48:14 +0000
commit35348defd48a63d784ae35b95ddd7bad382d6bea (patch)
treee55f3693fec6691853ff57e369b706f141fbc50e /lib/profile/InstrProfilingFile.c
parentaff36bd0df3a81e114f3e2d3a6c0b6d6225ebc1f (diff)
[Profile] instroduce portability macro for dir separator(s
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingFile.c')
-rw-r--r--lib/profile/InstrProfilingFile.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/profile/InstrProfilingFile.c b/lib/profile/InstrProfilingFile.c
index 1bd6c6339..b737baff4 100644
--- a/lib/profile/InstrProfilingFile.c
+++ b/lib/profile/InstrProfilingFile.c
@@ -229,7 +229,11 @@ static void truncateCurrentFile(void) {
return;
/* Create the directory holding the file, if needed. */
- if (strchr(Filename, '/') || strchr(Filename, '\\')) {
+ if (strchr(Filename, DIR_SEPARATOR)
+#if defined(DIR_SEPARATOR_2)
+ || strchr(Filename, DIR_SEPERATOR_2)
+#endif
+ ) {
char *Copy = (char *)COMPILER_RT_ALLOCA(Length + 1);
strncpy(Copy, Filename, Length + 1);
__llvm_profile_recursive_mkdir(Copy);