Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
0af3ed51
Commit
0af3ed51
authored
9 years ago
by
Dan Barry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add protoc path detection for Mac OS
parent
4644f99d
master
v3.11.4
v3.11.3
v3.11.2
v3.11.1
v3.11.0
v3.11.0-rc2
v3.11.0-rc1
v3.10.1
v3.10.0
v3.10.0-rc1
v3.9.2
v3.9.1
v3.9.0
v3.9.0-rc1
v3.8.0
v3.8.0-rc1
v3.7.1
v3.7.0
v3.7.0rc2
v3.7.0rc1
v3.7.0-rc.3
v3.7.0-rc.2
v3.6.1.3
v3.6.1.2
v3.6.1.1
v3.6.1
v3.6.0.1
v3.6.0
v3.6.0rc2
v3.6.0rc1
v3.5.2
v3.5.1.1
v3.5.1
v3.5.0.1
v3.5.0
v3.4.1
v3.4.0
v3.4.0rc3
v3.4.0rc2
v3.4.0rc1
v3.3.2
v3.3.1
v3.3.0
v3.3.0rc1
v3.2.1
v3.2.0
v3.2.0rc2
v3.2.0-rc.1
v3.2.0-alpha-1
v3.1.0
v3.1.0-alpha-1
v3.0.2
v3.0.1-javalite
v3.0.0
v3.0.0-javalite
v3.0.0-beta-4
v3.0.0-beta-3.3
v3.0.0-beta-3.2
v3.0.0-beta-3.1
v3.0.0-beta-3
v3.0.0-beta-3-pre-1
v3.0.0-beta-2
v3.0.0-beta-1.1
v3.0.0-beta-1
v3.0.0-beta-1-bzl-fix
v3.0.0-alpha-4.1
v3.0.0-alpha-4
conformance-build-tag
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
command_line_interface.cc
src/google/protobuf/compiler/command_line_interface.cc
+14
-0
No files found.
src/google/protobuf/compiler/command_line_interface.cc
View file @
0af3ed51
...
...
@@ -53,6 +53,10 @@
#include <google/protobuf/stubs/shared_ptr.h>
#endif
#ifdef __APPLE__
#include <mach-o/dyld.h>
#endif
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/stringprintf.h>
#include <google/protobuf/compiler/importer.h>
...
...
@@ -186,6 +190,16 @@ bool GetProtocAbsolutePath(string* path) {
#ifdef _WIN32
char
buffer
[
MAX_PATH
];
int
len
=
GetModuleFileName
(
NULL
,
buffer
,
MAX_PATH
);
#elif __APPLE__
char
buffer
[
PATH_MAX
];
int
len
=
0
;
char
dirtybuffer
[
PATH_MAX
];
uint32_t
size
=
sizeof
(
dirtybuffer
);
if
(
_NSGetExecutablePath
(
dirtybuffer
,
&
size
)
==
0
)
{
realpath
(
dirtybuffer
,
buffer
);
len
=
strlen
(
buffer
);
}
#else
char
buffer
[
PATH_MAX
];
int
len
=
readlink
(
"/proc/self/exe"
,
buffer
,
PATH_MAX
);
...
...
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