Commit Graph

412 Commits

Author SHA1 Message Date
Adal Chiriliuc
6f7aa2f678 Revert "Add __version__"
This reverts commit 5337cf564f.
2014-10-10 21:59:22 +03:00
Adal Chiriliuc
5337cf564f Add __version__
Added __version__ attr to package so that scripts that check local
packages to see if newer versions are available can work.

Almost all Python packages have a version attr, and the vast majority of
them name it "__version__"
2014-10-10 21:58:43 +03:00
Feng Xiao
5452bd6e39 Merge pull request #43 from abuszta/bugfix
Release objects allocated by InitializeDefaultRepeatedFields()
2014-10-09 10:25:47 -07:00
Antoni Buszta
e670b67032 DestroyDefaultRepeatedFields is registered using OnShutdown. 2014-10-09 07:16:04 +02:00
Feng Xiao
3b8dadf581 Avoid using the macro name again in macro definitions. 2014-10-08 17:32:53 -07:00
Feng Xiao
06e6690bf2 Fix the memory leak of GetEmptyString(). 2014-10-08 17:28:03 -07:00
Antoni Buszta
e83ba13a6f InitializeDefaultRepeatedFields() allocates memory but does not release it. 2014-10-08 11:27:18 +02:00
Feng Xiao
0971bb0d57 Down-integrate from internal branch. 2014-10-07 17:44:48 -07:00
Feng Xiao
c1d16457db Merge pull request #35 from dsrosario/fix_warning
Fix "warning C4018: '<' : signed/unsigned mismatch"
2014-10-06 14:12:21 -07:00
Feng Xiao
56aa52d986 Merge pull request #38 from xfxyjwf/fix17
Fix a bug that causes DynamicMessage.setField() to not work for repeated enum fields.
2014-10-03 11:24:42 -07:00
Feng Xiao
84731a111f Down-integrate from internal branch. 2014-10-03 11:14:13 -07:00
Feng Xiao
725326f1ee Update verification methods' names. 2014-10-02 17:46:39 -07:00
Feng Xiao
0dd3fef843 Merge pull request #39 from xfxyjwf/fix24
Fix descriptor validation logic for packed enum fields.
2014-10-02 17:40:47 -07:00
Feng Xiao
eb223ed4f7 Merge pull request #3 from dhirschfeld/pyext-fix
Explicitly specify pyext/cpp_message.py in py_modules list
2014-10-02 15:55:32 -07:00
Feng Xiao
f5691a617e Fix descriptor validation logic for packed enum fields. 2014-10-01 18:26:48 -07:00
Feng Xiao
345d49a51e Fix a bug that causes DynamicMessage.setField() to not work for repeated
enum fields.
2014-10-01 17:31:28 -07:00
xfxyjwf
6147768171 Merge pull request #37 from google/fix_links
Replace links to code.google.com/protobuf with developers.google.com/protocol-buffers
2014-10-01 16:52:35 -07:00
Feng Xiao
e428862450 Replace links to code.google.com/protobuf with developers.google.com/protocol-buffers 2014-10-01 16:26:23 -07:00
xfxyjwf
a9155b8d3c Merge pull request #32 from worr/bug/solaris-atomicops
Add support for solaris atomicops
2014-09-23 10:48:02 -07:00
Dinis Rosário
bb7d210c2a Fix "warning C4018: '<' : signed/unsigned mismatch" at wire_format_lite_inl.h 2014-09-23 14:03:46 +01:00
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
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
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
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
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
Feng Xiao
de00052be7 Add instructions on how to generate the configure script. 2014-08-28 11:18:51 -07:00
David Hirschfeld
ef6eff20bd Explicitly specify pyext/cpp_message.py in py_modules list 2014-08-27 09:25:26 +01:00