summaryrefslogtreecommitdiff
path: root/libs/pbd/pathscanner.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/pathscanner.cc')
-rw-r--r--libs/pbd/pathscanner.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/pbd/pathscanner.cc b/libs/pbd/pathscanner.cc
index fac2dcfd96..6d3cba8d77 100644
--- a/libs/pbd/pathscanner.cc
+++ b/libs/pbd/pathscanner.cc
@@ -18,11 +18,19 @@
$Id$
*/
+#ifdef COMPILER_MSVC
+#include <stdlib.h>
+#include <stdio.h>
+using PBD::readdir;
+using PBD::opendir;
+using PBD::closedir;
+#else
+#include <dirent.h>
#include <cstdlib>
#include <cstdio>
+#endif
#include <cstring>
#include <vector>
-#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -98,7 +106,7 @@ PathScanner::run_scan_internal (vector<string *> *result,
string *newstr;
long nfound = 0;
- if ((thisdir = strtok (pathcopy, ":")) == 0 ||
+ if ((thisdir = strtok (pathcopy, G_SEARCHPATH_SEPARATOR_S)) == 0 ||
strlen (thisdir) == 0) {
free (pathcopy);
return 0;
@@ -162,7 +170,7 @@ PathScanner::run_scan_internal (vector<string *> *result,
}
closedir (dir);
- } while ((limit < 0 || (nfound < limit)) && (thisdir = strtok (0, ":")));
+ } while ((limit < 0 || (nfound < limit)) && (thisdir = strtok (0, G_SEARCHPATH_SEPARATOR_S)));
free (pathcopy);
return result;