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
4410396f
Commit
4410396f
authored
Sep 19, 2008
by
kenton@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around absence of hash_map.
Also, update version numbers to 2.0.2-SNAPSHOT.
parent
4014b9f8
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
15 deletions
+62
-15
configure.ac
configure.ac
+1
-1
pom.xml
java/pom.xml
+1
-1
setup.py
python/setup.py
+1
-1
Makefile.am
src/Makefile.am
+1
-1
descriptor.pb.h
src/google/protobuf/descriptor.pb.h
+2
-2
common.h
src/google/protobuf/stubs/common.h
+5
-5
hash.h
src/google/protobuf/stubs/hash.h
+51
-4
No files found.
configure.ac
View file @
4410396f
...
@@ -7,7 +7,7 @@ AC_PREREQ(2.59)
...
@@ -7,7 +7,7 @@ AC_PREREQ(2.59)
# * java/pom.xml
# * java/pom.xml
# * python/setup.py
# * python/setup.py
# * src/google/protobuf/stubs/common.h
# * src/google/protobuf/stubs/common.h
AC_INIT(protobuf, 2.0.
1
, protobuf@googlegroups.com)
AC_INIT(protobuf, 2.0.
2-SNAPSHOT
, protobuf@googlegroups.com)
AC_CONFIG_SRCDIR(src/google/protobuf/message.cc)
AC_CONFIG_SRCDIR(src/google/protobuf/message.cc)
AM_CONFIG_HEADER(config.h)
AM_CONFIG_HEADER(config.h)
...
...
java/pom.xml
View file @
4410396f
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</parent>
</parent>
<groupId>
com.google.protobuf
</groupId>
<groupId>
com.google.protobuf
</groupId>
<artifactId>
protobuf-java
</artifactId>
<artifactId>
protobuf-java
</artifactId>
<version>
2.0.
1
</version>
<version>
2.0.
2-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<name>
Protocol Buffer Java API
</name>
<name>
Protocol Buffer Java API
</name>
<description>
<description>
...
...
python/setup.py
View file @
4410396f
...
@@ -102,7 +102,7 @@ if __name__ == '__main__':
...
@@ -102,7 +102,7 @@ if __name__ == '__main__':
generate_proto
(
"../src/google/protobuf/descriptor.proto"
)
generate_proto
(
"../src/google/protobuf/descriptor.proto"
)
setup
(
name
=
'protobuf'
,
setup
(
name
=
'protobuf'
,
version
=
'2.0.
1
'
,
version
=
'2.0.
2-SNAPSHOT
'
,
packages
=
[
'google'
],
packages
=
[
'google'
],
namespace_packages
=
[
'google'
],
namespace_packages
=
[
'google'
],
test_suite
=
'setup.MakeTestSuite'
,
test_suite
=
'setup.MakeTestSuite'
,
...
...
src/Makefile.am
View file @
4410396f
...
@@ -55,7 +55,7 @@ nobase_include_HEADERS = \
...
@@ -55,7 +55,7 @@ nobase_include_HEADERS = \
lib_LTLIBRARIES
=
libprotobuf.la libprotoc.la
lib_LTLIBRARIES
=
libprotobuf.la libprotoc.la
libprotobuf_la_LIBADD
=
$(PTHREAD_LIBS)
libprotobuf_la_LIBADD
=
$(PTHREAD_LIBS)
libprotobuf_la_LDFLAGS
=
-version-info
0
:0:0
libprotobuf_la_LDFLAGS
=
-version-info
2
:0:0
libprotobuf_la_SOURCES
=
\
libprotobuf_la_SOURCES
=
\
google/protobuf/stubs/common.cc
\
google/protobuf/stubs/common.cc
\
google/protobuf/stubs/hash.cc
\
google/protobuf/stubs/hash.cc
\
...
...
src/google/protobuf/descriptor.pb.h
View file @
4410396f
...
@@ -7,12 +7,12 @@
...
@@ -7,12 +7,12 @@
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 200000
1
#if GOOGLE_PROTOBUF_VERSION < 200000
2
#error This file was generated by a newer version of protoc which is
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#error your headers.
#endif
#endif
#if 200000
1
< GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#if 200000
2
< GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
...
...
src/google/protobuf/stubs/common.h
View file @
4410396f
...
@@ -65,24 +65,24 @@ namespace internal {
...
@@ -65,24 +65,24 @@ namespace internal {
// The current version, represented as a single integer to make comparison
// The current version, represented as a single integer to make comparison
// easier: major * 10^6 + minor * 10^3 + micro
// easier: major * 10^6 + minor * 10^3 + micro
#define GOOGLE_PROTOBUF_VERSION 200000
1
#define GOOGLE_PROTOBUF_VERSION 200000
2
// The minimum library version which works with the current version of the
// The minimum library version which works with the current version of the
// headers.
// headers.
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 200000
1
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 200000
2
// The minimum header version which works with the current version of
// The minimum header version which works with the current version of
// the library. This constant should only be used by protoc's C++ code
// the library. This constant should only be used by protoc's C++ code
// generator.
// generator.
static
const
int
kMinHeaderVersionForLibrary
=
200000
1
;
static
const
int
kMinHeaderVersionForLibrary
=
200000
2
;
// The minimum protoc version which works with the current version of the
// The minimum protoc version which works with the current version of the
// headers.
// headers.
#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 200000
1
#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 200000
2
// The minimum header version which works with the current version of
// The minimum header version which works with the current version of
// protoc. This constant should only be used in VerifyVersion().
// protoc. This constant should only be used in VerifyVersion().
static
const
int
kMinHeaderVersionForProtoc
=
200000
1
;
static
const
int
kMinHeaderVersionForProtoc
=
200000
2
;
// Verifies that the headers and libraries are compatible. Use the macro
// Verifies that the headers and libraries are compatible. Use the macro
// below to call this.
// below to call this.
...
...
src/google/protobuf/stubs/hash.h
View file @
4410396f
...
@@ -29,15 +29,62 @@
...
@@ -29,15 +29,62 @@
#include HASH_MAP_H
#include HASH_MAP_H
#include HASH_SET_H
#include HASH_SET_H
#else
#else
// TODO(kenton): Deal with non-existence of hash_map somehow. Maybe emulate
#define MISSING_HASH
// it with map?
#include <map>
#
error "Your STL implementation lacks hash_map and/or hash_set."
#
include <set>
#endif
#endif
namespace
google
{
namespace
google
{
namespace
protobuf
{
namespace
protobuf
{
#ifdef _MSC_VER
#ifdef MISSING_HASH
// This system doesn't have hash_map or hash_set. Emulate them using map and
// set.
// Make hash<T> be the same as less<T>. Note that everywhere where custom
// hash functions are defined in the protobuf code, they are also defined such
// that they can be used as "less" functions, which is required by MSVC anyway.
template
<
typename
Key
>
struct
hash
{
// Dummy, just to make derivative hash functions compile.
int
operator
()(
const
Key
&
key
)
{
GOOGLE_LOG
(
FATAL
)
<<
"Should never be called."
;
return
0
;
}
inline
bool
operator
()(
const
Key
&
a
,
const
Key
&
b
)
const
{
return
a
<
b
;
}
};
// Make sure char* is compared by value.
template
<>
struct
hash
<
const
char
*>
{
// Dummy, just to make derivative hash functions compile.
int
operator
()(
const
char
*
key
)
{
GOOGLE_LOG
(
FATAL
)
<<
"Should never be called."
;
return
0
;
}
inline
bool
operator
()(
const
char
*
a
,
const
char
*
b
)
const
{
return
strcmp
(
a
,
b
)
<
0
;
}
};
template
<
typename
Key
,
typename
Data
,
typename
HashFcn
=
hash
<
Key
>
,
typename
EqualKey
=
int
>
class
hash_map
:
public
std
::
map
<
Key
,
Data
,
HashFcn
>
{
};
template
<
typename
Key
,
typename
HashFcn
=
hash
<
Key
>
,
typename
EqualKey
=
int
>
class
hash_set
:
public
std
::
set
<
Key
,
HashFcn
>
{
};
#elif defined(_MSC_VER)
template
<
typename
Key
>
template
<
typename
Key
>
struct
hash
:
public
HASH_NAMESPACE
::
hash_compare
<
Key
>
{
struct
hash
:
public
HASH_NAMESPACE
::
hash_compare
<
Key
>
{
...
...
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