* Add patch for upstream broken release build
- isNotDirectory was hidden by ifdef
This commit is contained in:
parent
540406b6b6
commit
09a1da71c3
2 changed files with 65 additions and 1 deletions
60
3Depict-0.0.16-patch-debug-build.patch
Normal file
60
3Depict-0.0.16-patch-debug-build.patch
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
diff -r 084988518fe8 src/common/basics.cpp
|
||||
--- a/src/common/basics.cpp Sat Apr 26 09:27:35 2014 -0400
|
||||
+++ b/src/common/basics.cpp Sat Apr 26 09:42:07 2014 -0400
|
||||
@@ -1115,6 +1115,28 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+//FIXME: Why negative?
|
||||
+bool isNotDirectory(const char *filename)
|
||||
+{
|
||||
+#if !defined(__WIN32__) && !defined(__WIN64__)
|
||||
+ struct stat statbuf;
|
||||
+
|
||||
+ if(stat(filename,&statbuf) == -1)
|
||||
+ return false;
|
||||
+
|
||||
+ return (statbuf.st_mode !=S_IFDIR);
|
||||
+#else
|
||||
+
|
||||
+ WARN(false, "Untested function. calling win api");
|
||||
+ DWORD fileAttribs;
|
||||
+ fileAttribs=GetFileAttributes((LPCWSTR)filename);
|
||||
+ if(fileAttribs == INVALID_FILE_ATTRIBUTES)
|
||||
+ return false;
|
||||
+
|
||||
+ return !(fileAttribs & FILE_ATTRIBUTE_DIRECTORY);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
#ifdef DEBUG
|
||||
bool isValidXML(const char *filename)
|
||||
{
|
||||
@@ -1148,27 +1170,6 @@
|
||||
}
|
||||
|
||||
|
||||
-//FIXME: Why negative?
|
||||
-bool isNotDirectory(const char *filename)
|
||||
-{
|
||||
-#if !defined(__WIN32__) && !defined(__WIN64__)
|
||||
- struct stat statbuf;
|
||||
-
|
||||
- if(stat(filename,&statbuf) == -1)
|
||||
- return false;
|
||||
-
|
||||
- return (statbuf.st_mode !=S_IFDIR);
|
||||
-#else
|
||||
-
|
||||
- WARN(false, "Untested function. calling win api");
|
||||
- DWORD fileAttribs;
|
||||
- fileAttribs=GetFileAttributes((LPCWSTR)filename);
|
||||
- if(fileAttribs == INVALID_FILE_ATTRIBUTES)
|
||||
- return false;
|
||||
-
|
||||
- return !(fileAttribs & FILE_ATTRIBUTE_DIRECTORY);
|
||||
-#endif
|
||||
-}
|
||||
|
||||
bool rmFile(const std::string &filename)
|
||||
{
|
||||
Reference in a new issue