Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation failure in compiler: command_line_interface.cc #423

Closed
gdamore opened this issue May 25, 2015 · 3 comments
Closed

compilation failure in compiler: command_line_interface.cc #423

gdamore opened this issue May 25, 2015 · 3 comments

Comments

@gdamore
Copy link

gdamore commented May 25, 2015

The compile fails due to undefined PATH_MAX on smartos/illumos (Solaris derived) systems. POSIX says this symbol belongs in llimits.h, and adding that include allowed the compile to proceed. Diff below:

--- a/src/google/protobuf/compiler/command_line_interface.cc
+++ b/src/google/protobuf/compiler/command_line_interface.cc
@@ -38,6 +38,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <limits.h>
 #ifdef _MSC_VER
 #include <io.h>
 #include <direct.h>
@gdamore
Copy link
Author

gdamore commented May 25, 2015

A similar problem occurs in the objective C compiler, where INT_MIN and LLONG_MIN definitions are missing. Again, the solution is to supply limits.h.

@gyund
Copy link

gyund commented Aug 3, 2015

I can confirm this as well.

-bash-3.00$ uname -a
SunOS unknown 5.10 Generic_142910-17 i86pc i386 i86pc Solaris

Version: v3.0.0-alpha-3.1

Here's what I did to get it working:

-bash-3.00$ git diff
diff --git a/autogen.sh b/autogen.sh
index 08966c6..a027cf9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash -x

 # Run this script to generate the configure script and other files that will
 # be included in the distribution.  These files are not checked in because they
diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc
index 667b2b6..c2fd041 100644
--- a/src/google/protobuf/compiler/command_line_interface.cc
+++ b/src/google/protobuf/compiler/command_line_interface.cc
@@ -43,6 +43,7 @@
 #include <direct.h>
 #else
 #include <unistd.h>
+#include <limits.h>
 #endif
 #include <errno.h>
 #include <iostream>
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
index 6d6e595..f514279 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
@@ -32,6 +32,7 @@
 #include <iostream>
 #include <sstream>
 #include <vector>
+#include <limits.h>

 #include <google/protobuf/stubs/hash.h>
 #include <google/protobuf/compiler/objectivec/objectivec_helpers.h>

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jan 20, 2016

Should be fixed now.

@xfxyjwf xfxyjwf closed this as completed Jan 20, 2016
bithium pushed a commit to bithium/protobuf that referenced this issue Sep 4, 2023
Implemented support for MessageSet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants