forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0008-mingw-use-X11-like-path-layout.patch
More file actions
57 lines (55 loc) · 2.09 KB
/
Copy path0008-mingw-use-X11-like-path-layout.patch
File metadata and controls
57 lines (55 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff -Naur blender-2.77a-orig/intern/ghost/intern/GHOST_SystemPathsWin32.cpp blender-2.77a/intern/ghost/intern/GHOST_SystemPathsWin32.cpp
--- blender-2.77a-orig/intern/ghost/intern/GHOST_SystemPathsWin32.cpp 2016-03-16 15:57:57.000000000 +0300
+++ blender-2.77a/intern/ghost/intern/GHOST_SystemPathsWin32.cpp 2016-07-12 13:40:38.182595000 +0300
@@ -69,6 +69,44 @@
{
}
+#if defined(__MINGW32__)
+
+const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const
+{
+ static char knownpath[MAX_PATH * 3 + 128] = {0};
+
+ char temppath[MAX_PATH + 1];
+ char temppath2[MAX_PATH + 1];
+ const GHOST_TUns8 *binary_dir = getBinaryDir();
+ strcpy(temppath2, reinterpret_cast<const char*>(binary_dir));
+ char* lastslash = strrchr(temppath2, '\\');
+ if (lastslash != NULL) {
+ *lastslash = '\0';
+ }
+ snprintf(temppath, sizeof(temppath), "%s\\..\\share\\blender\\%s", temppath2, versionstr);
+ temppath[MAX_PATH] = '\0';
+ GetFullPathNameA(temppath, sizeof(knownpath), knownpath, NULL);
+ return (GHOST_TUns8*)knownpath;
+}
+
+const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserDir(int, const char *versionstr) const
+{
+ static char knownpath[MAX_PATH * 3 + 128] = {0};
+
+ char temppath[MAX_PATH + 1];
+ char temppath2[MAX_PATH + 1];
+ const GHOST_TUns8 *binary_dir = getBinaryDir();
+ strcpy(temppath2, reinterpret_cast<const char*>(binary_dir));
+ char* lastslash = strrchr(temppath2, '\\');
+ if (lastslash != NULL) {
+ *lastslash = '\0';
+ }
+ snprintf(temppath, sizeof(temppath), "%s\\..\\..\\home\\%s\\.blender\\%s", temppath2, getenv("USERNAME") ?: "unknown", versionstr);
+ temppath[MAX_PATH] = '\0';
+ GetFullPathNameA(temppath, sizeof(knownpath), knownpath, NULL);
+ return (GHOST_TUns8*)knownpath;
+}
+#else
const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const
{
static char knownpath[MAX_PATH * 3 + 128] = {0}; /* 1 utf-16 might translante into 3 utf-8. 2 utf-16 translates into 4 utf-8*/
@@ -105,6 +143,8 @@
return NULL;
}
+#endif
+
const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const
{
GUID folderid;