Commit Graph

1128 Commits

Author SHA1 Message Date
William Orr
195f01719e Update CONTRIBUTORS.txt 2014-09-22 22:20:36 -07:00
William Orr
a27b329084 Update copyright notice and remove first line 2014-09-22 11:53:54 -07:00
xfxyjwf
a48c08aa9a Merge pull request #31 from worr/bug/autoconf-sched-yield
Add check for sched_yield in librt
2014-09-22 10:02:11 -07:00
William Orr
2d7786cfc3 Add support for solaris atomicops
This patch adds support for atomic operations on Solaris, on any platform.
It makes use of the atomic functions made available in Solaris' atomic.h
header.
2014-09-19 22:04:23 -07:00
William Orr
38b8494647 Add check for sched_yield in librt
In Solaris, sched_yield lives in librt, rather than libc. This patch adds a
check which will link in librt if necessary.
2014-09-19 21:54:27 -07:00
xfxyjwf
7d50120316 Merge pull request #30 from edmonds/branches/fix_generic_atomicops_memory_models
generic atomicops: promote Acquire_Store() and Release_Load() to use SEQ_CST fence
2014-09-19 12:00:58 -07:00
Robert Edmonds
cc0a047384 generic atomicops: promote Acquire_Store() and Release_Load() to use SEQ_CST fence
__atomic_store_n() cannot take a memory model argument of
__ATOMIC_ACQUIRE, and __atomic_load_n() cannot take a memory model
argument of __ATOMIC_RELEASE, per the GCC documentation:

    https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/_005f_005fatomic-Builtins.html

On Clang this generates a -Watomic-memory-ordering warning.

Promote the fences in Acquire_Store() and Release_Load() to the stronger
__ATOMIC_SEQ_CST memory model, which ought to be safe.

Note that there are no actual uses of Acquire_Store() or Release_Load()
in protobuf, though.

This follows the TSAN atomicops implementation, which also uses SEQ_CST
fences for these functions.

(Fixes #25.)
2014-09-18 20:36:42 -04:00
xfxyjwf
dce98a8d4c Merge pull request #29 from edmonds/branches/undef_GOOGLE_PROTOBUF_PLATFORM_ERROR
platform_macros.h: #undef GOOGLE_PROTOBUF_PLATFORM_ERROR once it's no longer needed
2014-09-18 17:31:23 -07:00
Robert Edmonds
0a3e36f1bf platform_macros.h: #undef GOOGLE_PROTOBUF_PLATFORM_ERROR once it's no longer needed 2014-09-18 20:24:30 -04:00
xfxyjwf
8d5f1e1efb Merge pull request #27 from edmonds/branches/fix_generic_atomicops_non_clang
Fix atomicops build failure on non-Clang
2014-09-18 17:19:19 -07:00
Robert Edmonds
7432af823a Fix atomicops build failure on non-Clang
We cannot use Clang's __has_extension macro unless we really are
compiling on Clang, which means we cannot use this expression:

    #if (defined(__clang__) && __has_extension(c_atomic)))
    // ...
    #endif

On GCC, this generates the following errors:

    In file included from ./google/protobuf/stubs/atomicops.h:59:0,
                     from google/protobuf/stubs/atomicops_internals_x86_gcc.cc:36:
    ./google/protobuf/stubs/platform_macros.h:67:41: error: missing binary operator before token "("
       (defined(__clang__) && __has_extension(c_atomic)))
                                             ^
    In file included from google/protobuf/stubs/atomicops_internals_x86_gcc.cc:36:0:
    ./google/protobuf/stubs/atomicops.h:196:40: error: missing binary operator before token "("
      (defined(__clang__) && __has_extension(c_atomic))
                                            ^

Instead, we have to protect the __has_extension expression by only
executing it when __clang__ is defined:

    #if defined(__clang__)
    # if __has_extension(c_atomic)
    // ...
    # endif
    #endif
2014-09-18 18:36:00 -04:00
xfxyjwf
5c8ab2cbb3 Merge pull request #21 from edmonds/branches/clang_generic_atomics
Expose generic atomicops on Clang
2014-09-18 13:52:31 -07:00
xfxyjwf
7b6c5d58a8 Merge pull request #20 from edmonds/branches/no_ppc
Remove GOOGLE_PROTOBUF_ARCH_PPC
2014-09-18 13:51:56 -07:00
Brian Duff
7d8185c963 am d3a8acb9: Merge "Includes a MessageNano subclass\'s name\'s hashCode in hashCode calculations."
* commit 'd3a8acb9a2b3695955c77f364b3a6bd2f1c189bc':
  Includes a MessageNano subclass's name's hashCode in hashCode calculations.
2014-09-17 07:34:13 +00:00
Brian Duff
14e2f6cb37 Merge "Includes a MessageNano subclass's name's hashCode in hashCode calculations." 2014-09-17 07:13:40 +00:00
Jason Neufeld
87bd4029cf Includes a MessageNano subclass's name's hashCode in hashCode calculations.
In the current implementation, a message with the same amount of null or
equal-valued fields as a different message type will have the same
hashCode. This adds more variety by including the hashCode of the
class's name in the hashCode calculations.

Change-Id: I284e3e6d198ad8037815948d1f65686465ffd623
Signed-off-by: Jason Neufeld <jneufeld@google.com>
2014-09-16 18:40:11 -07:00
Robert S. Edmonds
628a23ba8d Expose generic atomicops on Clang
The generic atomicops implementation is only exposed if GCC >= 4.7 is
available, but Clang, where the underlying __atomic built-ins are also
available, typically only claims to be GCC 4.2. This causes build
failures when compiling protobuf or the output of protoc's C++ code
generator on an architecture that needs the generic atomicops
implementation with Clang.

Clang has a "c_atomic" extension which can be tested for which almost
does what we want:

    C11 atomic operations

    Use __has_feature(c_atomic) or __has_extension(c_atomic) to
    determine if support for atomic types using _Atomic is enabled.
    Clang also provides a set of builtins which can be used to implement
    the <stdatomic.h> operations on _Atomic types.

I'm not sure if this guarantees that the GNU atomic builtins (the ones
with the __atomic prefix) are also available, but in practice this
should guarantee that Clang is new enough.

With this change in place, Clang generates several diagnostics when
compiling the generic atomicops implementation. These appear to be bugs
in the generic atomicops implementation and are not Clang-specific.
2014-09-13 20:59:39 -04:00
Robert S. Edmonds
d24b987c14 Remove GOOGLE_PROTOBUF_ARCH_PPC
The macro GOOGLE_PROTOBUF_ARCH_PPC is not used anywhere in the protobuf
source; there is no Power-specific atomics implementation, etc.

Funnily enough, the macro __ppc__ is not actually defined on 32-bit
Power on GCC/Linux, according to the following webpage:

    http://nadeausoftware.com/articles/2012/02/c_c_tip_how_detect_processor_type_using_compiler_predefined_macros#POWER

and verified on a 32-bit Debian sid 'powerpc' chroot:

    (sid_powerpc-dchroot)edmonds@partch:~$ gcc -dM -E - < /dev/null | grep -c __ppc__
    0
    (sid_powerpc-dchroot)edmonds@partch:~$ gcc -dM -E - < /dev/null | grep -c __LP64__
    0
2014-09-13 19:31:12 -04:00
Jisi Liu
edc5994525 Merge pull request #15 from google/pom_version_fix
Bump version for maven-bundle-plugin
2014-09-04 15:37:28 -07:00
Jisi Liu
ec0c9e4a03 Bump version for maven-bundle-plugin 2014-09-04 10:38:40 -07:00
Jisi Liu
9faecf7e93 Merge pull request #12 from huahang/patch-2
remove a const qualifier in a method's return type
2014-09-03 22:30:50 -07:00
huahang
c871fb9384 remove a const qualifier in a method's return type 2014-09-04 10:51:57 +08:00
Jisi Liu
1392f42d1b Merge pull request #8 from huahang/patch-1
fix a compile warning
2014-09-03 18:02:28 -07:00
Brian Duff
6c82acd0c8 am c4e7b92f: Merge "Make the tag field public."
* commit 'c4e7b92fefce5b069f50659363c8878612303510':
  Make the tag field public.
2014-09-03 19:59:15 +00:00
Brian Duff
e1458bba77 Merge "Make the tag field public." 2014-09-03 18:22:26 +00:00
huahang
27fcf9bff6 fix a compile warning
This change fixes the following compiler warning:

warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
2014-09-03 15:08:45 +08:00
Brian Duff
5a9b4501db Make the tag field public.
Change-Id: Ibfda5bb1ac3150ea90d82a152730be76a2f8bf71
2014-09-02 20:53:34 -07:00
Brian Duff
5db346f1ef am ddf016d8: Merge "Add MessageNano.messageNanoEquals()."
* commit 'ddf016d828d928eefbce89c602c323bf0f998574':
  Add MessageNano.messageNanoEquals().
2014-09-02 22:41:55 +00:00
Brian Duff
553d39f9d8 Merge "Add MessageNano.messageNanoEquals()." 2014-09-02 22:25:40 +00:00
Brian Duff
72881dad55 Add MessageNano.messageNanoEquals().
Allows two messages to be compared directly for equality without
generating an equals method for every generated message.

(Ports CL58125010)

Change-Id: I92ab5088539d1fd722fee7b5e28a8c825926c3b6
2014-09-02 22:24:21 +00:00
xfxyjwf
6890263c89 Merge pull request #1 from dhirschfeld/vs2008-fix
Added const qualifier to iterator to enable compiling with VS2008
2014-09-02 10:39:16 -07:00
Feng Xiao
aa51f2a38a Rename README.txt to README.md 2014-08-29 17:27:24 -07:00
xfxyjwf
d36778243b Merge pull request #5 from google/fix_readme
Rename README.txt to README.md and use markdown formatting.
2014-08-29 10:40:28 -07:00
Max Cai
80241687af am 0068978c: Merge "Fixed octal printing of bytearrays"
* commit '0068978c364173b15a9cb8ab65fb2d2eac17f136':
  Fixed octal printing of bytearrays
2014-08-29 15:47:23 +00:00
Max Cai
9d9cb7c330 Merge "Fixed octal printing of bytearrays" 2014-08-29 15:30:31 +00:00
Max Cai
be60c85171 am 77866143: Merge "Revert "Fixed octal printing of bytearrays""
* commit '77866143340f7541180d91fa316071ce947b3a8d':
  Revert "Fixed octal printing of bytearrays"
2014-08-29 11:39:06 +00:00
Max Cai
a609653bd3 am 238e0ac5: Merge "Fixed octal printing of bytearrays"
* commit '238e0ac56654afadb5270264660db7305f139c02':
  Fixed octal printing of bytearrays
2014-08-29 11:39:06 +00:00
Linus Tufvesson
2d60e102fa Fixed octal printing of bytearrays
- Now with 50% less '&' and 100% fewer build breakages!

Change-Id: Icf0283220f75cd14b8564b51bd55973e5b7da56b
2014-08-29 11:25:48 +01:00
Feng Xiao
b168d1fd1d Fix the formating of bold text. 2014-08-28 14:42:44 -07:00
Feng Xiao
17007a6c47 Update README.md to markdown format. 2014-08-28 14:39:49 -07:00
Feng Xiao
bc72de8ea0 Rename README.txt to README.md 2014-08-28 14:11:28 -07:00
Jisi Liu
0068a929ed Merge pull request #4 from google/fix_readme
Add instructions on how to generate the configure script.
2014-08-28 11:32:49 -07:00
Max Cai
2b69e07cf3 Merge "Revert "Fixed octal printing of bytearrays"" 2014-08-28 18:19:36 +00:00
Feng Xiao
de00052be7 Add instructions on how to generate the configure script. 2014-08-28 11:18:51 -07:00
Max Cai
42da25e969 Revert "Fixed octal printing of bytearrays"
This reverts commit 8b8481868877c9db407d04bdf4843e50d8920806.

Change-Id: I0876235b79cd7745312879d0f1b00c6d1c1a1b7a
2014-08-28 18:18:46 +00:00
Max Cai
04f70ef5c7 Merge "Fixed octal printing of bytearrays" 2014-08-28 17:28:22 +00:00
Linus Tufvesson
32a45d0921 Fixed octal printing of bytearrays
Change-Id: Ia848d7fae9aeab89e65b00f05cee6c1e6d649d94
2014-08-28 16:20:02 +01:00
David Hirschfeld
ef6eff20bd Explicitly specify pyext/cpp_message.py in py_modules list 2014-08-27 09:25:26 +01:00
David Hirschfeld
b7ec1a95d2 Added const qualifier to iterator to enable compiling with VS2008 2014-08-27 09:10:00 +01:00
Feng Xiao
e9c00d9dd0 Rename COPYING.txt to LICENSE for opensource compliance and update links
in README.txt.
2014-08-26 16:16:00 -07:00