aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/stubs/port.h
Commit message (Collapse)AuthorAge
* Merge pull request #4387 from acozzette/down-integrateGravatar Adam Cozzette2018-03-20
|\ | | | | Integrated internal changes from Google
| * Integrated internal changes from GoogleGravatar Adam Cozzette2018-03-13
| |
* | Support using MSVC intrinsics in Log2FloorNonZeroGravatar Arkady Shapkin2018-02-15
|/
* Remove use of GOOGLE_FALLTHROUGH_INTENDED from protobuf.Gravatar Nico Weber2018-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | Chrome is running into two issues with the use of this macro in open-source protobuf (https://crbug.com/809157): 1. GOOGLE_FALLTHROUGH_INTENDED is defined to nothing on __APPLE__ platforms, which blocks us from enabling -Wimplicit-fallthrough on Mac and iOS. (We use a hermetic self-built modern clang, so whatever Xcode bug that exclusion might be for doesn't apply to us.) 2. It's in a public header file, and it's included in a public header file. When clang suggests adding [[clang::fallthrough]], it checks if it knows of a macro expanding to that and if so, suggests inserting that. Since lots of chrome code includes protobuf headers, it often suggests inserting GOOGLE_FALLTHROUGH_INTENDED (from protobuf) instead of the correct FALLTHROUGH (from chrome's base). Since the fallthrough doens't do anyting useful, just remove it. Long ago, this might have had perf impact, but d64a2d9941c36a7bc added a parsing fast path that calls this switch as slow fallback, so it should be off the hot path nowadays. No intended behavior change. This is the public version of internal change 184824132.
* Use the portable version of Log2Floor for Clang with older Android NDK versionsGravatar Adam Cozzette2017-12-07
| | | | | This is necessary for avoiding a strange compiler error that we have already run into with older versions of Clang on NaCl.
* fix implicit fallthrough in gcc 7Gravatar Tobias Jungel2017-10-15
| | | | fixes #3700
* Integrated internal changes from GoogleGravatar Adam Cozzette2017-09-14
|
* Merge remote-tracking branch 'origin/3.4.x' into mergemasterGravatar Jisi Liu2017-08-18
|\
* | Fixing warning under Clang 6.x (-Wexpansion-to-defined) where the macro ↵Gravatar drivehappy2017-08-15
| | | | | | | | expansion producing 'defined' was warning on undefined behavior.
| * Merge master into 3.4.xGravatar Jisi Liu2017-07-18
| |\ | |/ |/|
| * Merge from Google internal for 3.4 releaseGravatar Jisi Liu2017-07-18
| |
* | Fix more implicit type conversions in public headers and generated code.Gravatar Bo Yang2017-06-24
| |
* | Removing undefined behavior and compiler warnings (#1315)Gravatar brian-peloton2017-05-23
|/ | | | | | | | | | | | | | | | | | | * Comment out unused arguments. These last few are all that's needed to compile with -Wunused-arguments. * Fix missing struct field initializer. With this fix, everything compiles with -Wmissing-field-initializers. * Add support for disabling unaligned memory accesses on x86 too. ubsan doesn't like these because they are technically undefined behavior, so -DGOOGLE_PROTOBUF_DONT_USE_UNALIGNED will disable them easily. * Avoid undefined integer overflow. ubsan catches all of these.
* Added a workaround to allow building for NaClGravatar Adam Cozzette2017-03-28
| | | | | | | arm-nacl-clang seems to produce a mysterious compiler error when it encounters __builtin_clzll, so when we are building for NaCl, let's avoid that in favor of the portable implementation of Log2FloorNonZero64.
* Return uint32 from Log2FloorNonZero64Gravatar Adam Cozzette2017-03-02
| | | | | | A uint32 is big enough to hold any return value from that function, and doing it this way prevents compiler warnings in coded_stream.h about narrowing a uint64 to a uint32.
* Merge 3.2.x branch into master (#2648)Gravatar Paul Yang2017-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Down-integrate internal changes to github. * Update conformance test failure list. * Explicitly import used class in nano test to avoid random test fail. * Update _GNUC_VER to use the correct implementation of atomic operation on Mac. * maps_test.js: check whether Symbol is defined before using it (#2524) Symbol is not yet available on older versions of Node.js and so this test fails with them. This change just directly checks whether Symbol is available before we try to use it. * Added well_known_types_embed.cc to CLEANFILES so that it gets cleaned up * Updated Makefile.am to fix out-of-tree builds * Added Bazel genrule for generating well_known_types_embed.cc In pull request #2517 I made this change for the CMake and autotools builds but forgot to do it for the Bazel build. * Update _GNUC_VER to use the correct implementation of atomic operation on Mac. * Add new js file in extra dist. * Bump version number to 3.2.0 * Fixed issue with autoloading - Invalid paths (#2538) * PHP fix int64 decoding (#2516) * fix int64 decoding * fix int64 decoding + tests * Fix int64 decoding on 32-bit machines. * Fix warning in compiler/js/embed.cc embed.cc: In function ‘std::string CEscape(const string&)’: embed.cc:51:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < str.size(); ++i) { ^ * Fix include in auto-generated well_known_types_embed.cc Restore include style fix (e3da722) that has been trampled by auto-generation of well_known_types_embed.cc * Fixed cross compilations with the Autotools build Pull request #2517 caused cross compilations to start failing, because the js_embed binary was being built to run on the target platform instead of on the build machine. This change updates the Autotools build to use the AX_PROG_CXX_FOR_BUILD macro to find a suitable compiler for the build machine and always use that when building js_embed. * Minor fix for autocreated object repeated fields and maps. - If setting/clearing a repeated field/map that was objects, check the class before checking the autocreator. - Just to be paranoid, don’t mutate within copy/mutableCopy for the autocreated classes to ensure there is less chance of issues if someone does something really crazy threading wise. - Some more tests for the internal AutocreatedArray/AutocreatedDictionary classes to ensure things are working as expected. - Add Xcode 8.2 to the full_mac_build.sh supported list. * Fix generation of extending nested messages in JavaScript (#2439) * Fix generation of extending nested messages in JavaScript * Added missing test8.proto to build * Fix generated code when there is no namespace but there is enum definition. * Decoding unknown field should succeed. * Add embed.cc in src/Makefile.am to fix dist check. * Fixed "make distcheck" for the Autotools build To make the test pass I needed to fix out-of-tree builds and update EXTRA_DIST and CLEANFILES. * Remove redundent embed.cc from src/Makefile.am * Update version number to 3.2.0-rc.1 (#2578) * Change protoc-artifacts version to 3.2.0-rc.1 * Update version number to 3.2.0rc2 * Update change logs for 3.2.0 release. * Update php README * Update upb, fixes some bugs (including a hash table problem). (#2611) * Update upb, fixes some bugs (including a hash table problem). * Ruby: added a test for the previous hash table corruption. Verified that this triggers the bug in the currently released version. * Ruby: bugfix for SEGV. * Ruby: removed old code for dup'ing defs. * Reverting deployment target to 7.0 (#2618) The Protobuf library doesn’t require the 7.1 deployment target so reverting it back to 7.0 * Fix typo that breaks builds on big-endian (#2632) * Bump version number to 3.2.0
* Define LANG_CXX11 for port.h and use this to guard C++11 features.Gravatar Chris Kennelly2016-12-14
|
* when on OpenBSD we include the correct headers for endianess and check the ↵Gravatar ramrunner2016-12-05
| | | | apropriate defines
* Integrate internal changesGravatar Bo Yang2016-10-10
|
* Fixes traivs cpp build.Gravatar Feng Xiao2016-07-26
| | | | Remove the use of INT64_C/UINT64_C and add static_cast when neccessary.
* Define intX as standard exact-width integer types.Gravatar Feng Xiao2016-07-25
| | | | | | Fixes https://github.com/google/protobuf/issues/823 Change-Id: I7f4c2bfcac2f81d8b34c030dd3d12ea02aaa2264
* Integrated internal changes from GoogleGravatar Adam Cozzette2016-06-29
| | | | This includes all internal changes from around May 20 to now.
* Remove confounding and unused #define - breaks boost/predef/other/endian.hGravatar Walter Gray2016-05-06
|
* Fix Intel compiler warnings in include files on WindowsGravatar kkm2016-01-27
|
* Merge remote-tracking branch 'origin/master' into beta-1Gravatar Feng Xiao2015-08-29
|\ | | | | | | | | Conflicts: src/google/protobuf/extension_set.h
| * Merge pull request #746 from zmodem/fix_predict_macros2Gravatar Feng Xiao2015-08-27
| |\ | | | | | | Fix the no-op definitions of GOOGLE_PREDICT_{TRUE,FALSE}
| * | Avoid #including system headers from inside a namespace.Gravatar Peter Kasting2015-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | port.h #includes various headers in order to define byteswap functions, but it currently does so from inside the google::protobuf namespace. This can cause bizarre symbol conflicts and other build errors as these headers' contents are then included inside this namespace. Instead, #include the relevant headers above the namespace declarations.
* | | Add a TODO to clean-up the LITTLE_ENDIAN macro.Gravatar Feng Xiao2015-08-26
| | |
* | | Assume LITTLE_ENDIAN for windows build.Gravatar Feng Xiao2015-08-26
| | |
| | * Fix the no-op definitions of GOOGLE_PREDICT_{TRUE,FALSE}Gravatar Hans Wennborg2015-08-26
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updating to the current protobuf version caused the following build errors in Chromium when using Clang on Windows: ..\..\third_party\protobuf\src\google/protobuf/stubs/fastmem.h(67,43) : error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] if (GOOGLE_PREDICT_FALSE(n_rounded_down == 0)) { // n <= 7 ~~~~~~~~~~~~~~~^~~~ The problem is that on Windows, GOOGLE_PREDICT_FALSE is #defined to nothing, so the code expands to 'if ((n_rounded_down == 0))', which Clang warns about. Clang would not have warned if the extra parentheses came from the macro, but in this case they don't because the macro is just dropped. Fix this by making the macros behave as an identity function instead of just getting dropped. This is closer to what these macros look like in stubs/port.h internally.
* | Merge remote-tracking branch 'origin/master' into beta-1Gravatar Feng Xiao2015-08-25
|\|
* | Merge branch 'master' of github.com:google/protobufGravatar Jisi Liu2015-08-21
|\ \ | | | | | | | | | Change-Id: If3fb07754a734bae610d95124528e073515ac525
* | | Down-integrate from internal branch.Gravatar Jisi Liu2015-08-21
| | | | | | | | | | | | Change-Id: Ieb7a2c2fbf35bc2a8fa65b915a5ecb68c83863e4
| | * Define GOOGLE_ATTRIBUTE_NOINLINE for MSVC. Workaround for VS2015 Release ↵Gravatar Douglas Heriot2015-08-22
| |/ | | | | | | | | | | | | | | | | | | | | build compiler bug. See issue #240 - MSVC in VS2015 seems to inline a function it shouldn't. My original workaround was to disable inlining for the whole file, but I found a way to do it on just this specific function using __declspec(noinline). Unfortunately __declspec has to go at the start of the function declaration, while __attribute in GCC can go either before or after. I had to move lots of GOOGLE_ATTRIBUTE_NOLINE to make it compile. I have not yet tested this change with GCC. Will there be other side effects of defining this, given it wasn't previously? I also noticed a few functions marked with both the 'inline' keyword, and GOOGLE_ATTRIBUTE_NOINLINE - huh? Is there an explanation for this, or is it an oversight?
| * Move the definition of GOOGLE_FALLTHROUGH_INTENDED to port.hGravatar teboring2015-07-29
|/
* Split up common.h headersGravatar Jisi Liu2015-07-16
Change-Id: I223783111d743aa5193bf70fa1b9b54c7b4389c3