summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Preprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/Preprocessor.cpp')
-rw-r--r--cpp/src/Slice/Preprocessor.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp
index 532ed8be9d6..c73765164a1 100644
--- a/cpp/src/Slice/Preprocessor.cpp
+++ b/cpp/src/Slice/Preprocessor.cpp
@@ -171,18 +171,26 @@ Slice::Preprocessor::checkInputFile()
string
Slice::Preprocessor::searchIceCpp()
{
+#ifndef WIN32
const char* icecpp = "icecpp";
+#else
+ const char* icecpp = "icecpp.exe";
+#endif
string::size_type pos = _path.find_last_of("/\\");
if(pos != string::npos)
{
string path = _path.substr(0, pos + 1);
path += icecpp;
-
+
struct stat st;
if(stat(path.c_str(), &st) == 0)
{
+#ifndef WIN32
if(st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))
+#else
+ if(st.st_mode & (S_IEXEC))
+#endif
{
return path;
}