Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
system_core
Commits
1a65d5b3
Commit
1a65d5b3
authored
10 years ago
by
Jean-Michel Trivi
Committed by
Android (Google) Code Review
10 years ago
Browse files
Options
Download
Plain Diff
Merge "Fix building on modern versions of Xcode and OS X." into lmp-mr1-dev
parents
0f86444b
017c97a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
adb/get_my_path_darwin.c
adb/get_my_path_darwin.c
+7
-7
fastboot/util_osx.c
fastboot/util_osx.c
+9
-8
No files found.
adb/get_my_path_darwin.c
View file @
1a65d5b3
...
...
@@ -19,12 +19,12 @@
void
get_my_path
(
char
*
s
,
size_t
maxLen
)
{
ProcessSerialNumber
psn
;
GetCurrentProcess
(
&
psn
);
CF
DictionaryRef
dict
;
dict
=
ProcessInformationCopyDictionary
(
&
psn
,
0xffffffff
);
CFStringRef
value
=
(
CFStringRef
)
CFDictionaryGetValue
(
dict
,
CFSTR
(
"CFBundleExecutable"
)
);
CF
StringGetCString
(
value
,
s
,
maxLen
,
kCFStringEncodingUTF8
);
CFBundleRef
mainBundle
=
CFBundleGetMainBundle
()
;
CFURLRef
bundleURL
=
CFBundleCopyBundleURL
(
mainBundle
);
CF
StringRef
bundlePathString
=
CFURLCopyFileSystemPath
(
bundleURL
,
kCFURLPOSIXPathStyle
)
;
CFRelease
(
bundleURL
);
CFStringGetCString
(
bundlePathString
,
s
,
maxLen
,
kCFStringEncodingASCII
);
CF
Release
(
bundlePathString
);
}
This diff is collapsed.
Click to expand it.
fastboot/util_osx.c
View file @
1a65d5b3
...
...
@@ -31,14 +31,15 @@
void
get_my_path
(
char
s
[
PATH_MAX
])
{
char
*
x
;
ProcessSerialNumber
psn
;
GetCurrentProcess
(
&
psn
);
CFDictionaryRef
dict
;
dict
=
ProcessInformationCopyDictionary
(
&
psn
,
0xffffffff
);
CFStringRef
value
=
(
CFStringRef
)
CFDictionaryGetValue
(
dict
,
CFSTR
(
"CFBundleExecutable"
));
CFStringGetCString
(
value
,
s
,
PATH_MAX
-
1
,
kCFStringEncodingUTF8
);
CFBundleRef
mainBundle
=
CFBundleGetMainBundle
();
CFURLRef
bundleURL
=
CFBundleCopyBundleURL
(
mainBundle
);
CFStringRef
bundlePathString
=
CFURLCopyFileSystemPath
(
bundleURL
,
kCFURLPOSIXPathStyle
);
CFRelease
(
bundleURL
);
CFStringGetCString
(
bundlePathString
,
s
,
PATH_MAX
-
1
,
kCFStringEncodingASCII
);
CFRelease
(
bundlePathString
);
char
*
x
;
x
=
strrchr
(
s
,
'/'
);
if
(
x
)
x
[
1
]
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
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