Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
EDuke32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
92
Issues
92
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Richard Gobeille
EDuke32
Commits
f665a1c7
Commit
f665a1c7
authored
Dec 17, 2020
by
Evan Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macOS: Add osx_getdocumentsdir
Needed because GOG .pkg installers default to the Documents folder
parent
74aceda6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
source/build/include/osxbits.h
source/build/include/osxbits.h
+1
-0
source/build/src/osxbits.mm
source/build/src/osxbits.mm
+18
-0
No files found.
source/build/include/osxbits.h
View file @
f665a1c7
...
...
@@ -20,6 +20,7 @@ char *osx_gethomedir(void);
char
*
osx_getsupportdir
(
int32_t
local
);
char
*
osx_getappdir
(
void
);
char
*
osx_getapplicationsdir
(
int32_t
local
);
char
*
osx_getdocumentsdir
(
int32_t
local
);
#ifdef __cplusplus
}
...
...
source/build/src/osxbits.mm
View file @
f665a1c7
...
...
@@ -177,3 +177,21 @@ char *osx_getapplicationsdir(int32_t local)
return
returnpath
;
}
char
*
osx_getdocumentsdir
(
int32_t
local
)
{
NSArray
*
paths
=
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
local
?
NSUserDomainMask
:
NSLocalDomainMask
,
YES
);
char
*
returnpath
=
NULL
;
if
([
paths
count
]
>
0
)
{
const
char
*
Cpath
=
[[
paths
objectAtIndex
:
0
]
UTF8String
];
if
(
Cpath
)
returnpath
=
Bstrdup
(
Cpath
);
}
[
paths
release
];
return
returnpath
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment