Compare commits

...

18 Commits

Author SHA1 Message Date
099cf261b0 Added clang 7 CI job. 2018-11-01 20:24:04 +03:00
ab509ca840 Use https in URLs in readme. 2018-11-01 16:33:47 +03:00
37204ea892 Corrected a typo in readme. 2018-11-01 16:25:15 +03:00
5df4961448 Added CI build statuses to readme. 2018-11-01 16:14:20 +03:00
95a19b6364 Merge pull request #14 from boostorg/danieljames-patch-1
Fix json error
2018-10-30 11:46:15 +03:00
8674c6724f Fix json error 2018-10-30 07:47:30 +00:00
7c5def9d39 Disable Boost.Multiprecision tests for gcc 4.7 in C++11 mode.
The compiler fails in Boost.TypeTraits which is used in Boost.Multiprecision.
2018-10-29 12:25:55 +03:00
791a139a51 Disable testing C++14 and 17 on clang 3.8 and 3.9.
The compiler uses libstdc++ from gcc 4.8, which does not support C++14.
In particular, it is trying to import the missing ::gets function.
2018-10-29 12:13:42 +03:00
835ac98a23 Fail libgmpxx detection on Linux if libstdc++ is not used as the std library.
libgmpxx was built against libstdc++, so if the application uses e.g. libc++,
linking fails because of the standard symbols mismatch.
2018-10-29 12:07:06 +03:00
b5d5c56e68 Use boostdep to install library dependencies. 2018-10-28 19:51:00 +03:00
3961dc2f1e Changed clang 3.9 toolset apt source to Trusty to fix compilation errors. Aggregated multiple C++ versions to CI jobs and added more toolsets. 2018-10-28 19:11:29 +03:00
645edc971d Added Boost.IO to CI checkout as it's required by Boost.Random. 2018-10-28 01:12:49 +03:00
e00ffe97ae Merge branch 'develop' 2018-10-27 20:26:07 +03:00
1c586d6dd0 Merge pull request #13 from NAThompson/deprecate_pending_3
[ci skip] Deprecate boost/pending/integer_log2.hpp
2018-10-24 17:59:09 +03:00
6a97e49614 Added a readme. Added myself as a maintainer. 2018-10-24 17:56:15 +03:00
661986dd3d [ci skip] Deprecate boost/pending/integer_log2.hpp 2018-02-11 12:32:14 -06:00
919c5277c1 Merge pull request #10 from Lastique/patch-2
Correct make_odd return type inconsistency
2017-08-27 12:07:50 -04:00
bc2349f71b Corrected make_odd return type inconsistency.
Make gcd_traits<signed char>::make_odd return unsigned int, similar to all other gcd_traits specializations. Also, correct the local variable types that receive the result of make_odd to avoid warnings about unintended conversion.
2017-08-20 01:57:09 +03:00
9 changed files with 106 additions and 210 deletions

View File

@ -28,10 +28,10 @@ matrix:
include:
- os: linux
env: TOOLSET=gcc COMPILER=g++ CXXSTD=c++03
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++03
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
addons:
apt:
packages:
@ -40,16 +40,7 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++11
addons:
apt:
packages:
- g++-4.7
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++03
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
addons:
apt:
packages:
@ -58,16 +49,7 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++11
addons:
apt:
packages:
- g++-4.8
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++03
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
addons:
apt:
packages:
@ -76,16 +58,7 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++11
addons:
apt:
packages:
- g++-4.9
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++03
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14
addons:
apt:
packages:
@ -94,25 +67,7 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++11
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z
addons:
apt:
packages:
@ -121,40 +76,37 @@ matrix:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- g++-6
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14
compiler: g++-8
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17
addons:
apt:
packages:
- g++-6
- g++-8
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
- os: linux
compiler: clang++-libc++
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- libc++-dev
- os: linux
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
- os: linux
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++03
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11
addons:
apt:
packages:
@ -164,17 +116,7 @@ matrix:
- llvm-toolchain-precise-3.5
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++11
addons:
apt:
packages:
- clang-3.5
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++03
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11
addons:
apt:
packages:
@ -184,17 +126,7 @@ matrix:
- llvm-toolchain-precise-3.6
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++11
addons:
apt:
packages:
- clang-3.6
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++03
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11
addons:
apt:
packages:
@ -204,17 +136,7 @@ matrix:
- llvm-toolchain-precise-3.7
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++11
addons:
apt:
packages:
- clang-3.7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++03
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11
addons:
apt:
packages:
@ -224,124 +146,78 @@ matrix:
- llvm-toolchain-precise-3.8
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++11
addons:
apt:
packages:
- clang-3.8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++14
addons:
apt:
packages:
- clang-3.8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++1z
addons:
apt:
packages:
- clang-3.8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++03
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11
addons:
apt:
packages:
- clang-3.9
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
- llvm-toolchain-trusty-3.9
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++11
compiler: clang++-4.0
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.9
- clang-4.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
- llvm-toolchain-trusty-4.0
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++14
compiler: clang++-5.0
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.9
- clang-5.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
- llvm-toolchain-trusty-5.0
- os: linux
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++1z
compiler: clang++-6.0
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,17
addons:
apt:
packages:
- clang-3.9
- clang-6.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
- llvm-toolchain-trusty-6.0
- os: linux
compiler: clang++-7
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=03,11,14,17
addons:
apt:
packages:
- clang-7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
install:
- cd ..
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/boostdep
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init libs/core
- git submodule update --init libs/detail
- git submodule update --init libs/assert
- git submodule update --init libs/static_assert
- git submodule update --init libs/type_traits
- git submodule update --init libs/mpl
- git submodule update --init libs/preprocessor
- git submodule update --init libs/multiprecision
- git submodule update --init libs/math
- git submodule update --init libs/rational
- git submodule update --init libs/throw_exception
- git submodule update --init libs/predef
- git submodule update --init libs/lexical_cast
- git submodule update --init libs/range
- git submodule update --init libs/iterator
- git submodule update --init libs/concept_check
- git submodule update --init libs/numeric
- git submodule update --init libs/array
- git submodule update --init libs/container
- git submodule update --init libs/move
- git submodule update --init libs/functional
- git submodule update --init libs/random
- git submodule update --init libs/utility
- cp -r $TRAVIS_BUILD_DIR/* libs/integer
- python tools/boostdep/depinst/depinst.py integer
- ./bootstrap.sh
- ./b2 headers
script:
- |-
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
- ./b2 libs/integer/test toolset=$TOOLSET
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
- ./b2 -j3 libs/integer/test toolset=$TOOLSET cxxstd=$CXXSTD
notifications:
email:

30
README.md Normal file
View File

@ -0,0 +1,30 @@
# Boost.Integer
Boost.Integer, part of collection of the [Boost C++ Libraries](https://github.com/boostorg), provides
integer type support, particularly helpful in generic programming. It provides the means to select
an integer type based upon its properties, like the number of bits or the maximum supported value,
as well as compile-time bit mask selection. There is a derivative of `std::numeric_limits` that provides
integral constant expressions for `min` and `max`...
Finally, it provides two compile-time algorithms: determining the highest power of two in a
compile-time value; and computing min and max of constant expressions.
### Directories
* **doc** - QuickBook documentation sources
* **include** - Interface headers of Boost.Integer
* **test** - Boost.Integer unit tests
### More information
* [Documentation](https://boost.org/libs/integer)
* [Report bugs](https://github.com/boostorg/integer/issues/new). Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
* Submit your patches as pull requests against **develop** branch. Note that by submitting patches you agree to license your modifications under the [Boost Software License, Version 1.0](https://www.boost.org/LICENSE_1_0.txt).
### Build status
Master: [![AppVeyor](https://ci.appveyor.com/api/projects/status/iugyf5rf51n99g3w?svg=true)](https://ci.appveyor.com/project/Lastique/integer/branch/master) [![Travis CI](https://travis-ci.org/boostorg/integer.svg?branch=master)](https://travis-ci.org/boostorg/integer)
Develop: [![AppVeyor](https://ci.appveyor.com/api/projects/status/iugyf5rf51n99g3w/branch/develop?svg=true)](https://ci.appveyor.com/project/Lastique/integer/branch/develop) [![Travis CI](https://travis-ci.org/boostorg/integer.svg?branch=develop)](https://travis-ci.org/boostorg/integer)
### License
Distributed under the [Boost Software License, Version 1.0](https://www.boost.org/LICENSE_1_0.txt).

View File

@ -44,32 +44,11 @@ install:
- cd ..
- git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/boostdep
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init libs/core
- git submodule update --init libs/detail
- git submodule update --init libs/assert
- git submodule update --init libs/static_assert
- git submodule update --init libs/type_traits
- git submodule update --init libs/mpl
- git submodule update --init libs/preprocessor
- git submodule update --init libs/multiprecision
- git submodule update --init libs/math
- git submodule update --init libs/rational
- git submodule update --init libs/throw_exception
- git submodule update --init libs/predef
- git submodule update --init libs/lexical_cast
- git submodule update --init libs/range
- git submodule update --init libs/iterator
- git submodule update --init libs/concept_check
- git submodule update --init libs/numeric
- git submodule update --init libs/array
- git submodule update --init libs/container
- git submodule update --init libs/move
- git submodule update --init libs/functional
- git submodule update --init libs/random
- git submodule update --init libs/utility
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\integer
- python tools/boostdep/depinst/depinst.py integer
- bootstrap
- b2 headers

View File

@ -223,7 +223,7 @@ namespace boost {
template <> struct gcd_traits<unsigned char> : public gcd_traits_defaults<unsigned char>
{ BOOST_FORCEINLINE static unsigned make_odd(unsigned char& val)BOOST_NOEXCEPT{ unsigned result = gcd_traits<unsigned long>::find_lsb(val); val >>= result; return result; } };
template <> struct gcd_traits<signed char> : public gcd_traits_defaults<signed char>
{ BOOST_FORCEINLINE static signed make_odd(signed char& val)BOOST_NOEXCEPT{ signed result = gcd_traits<unsigned long>::find_lsb(val); val >>= result; return result; } };
{ BOOST_FORCEINLINE static unsigned make_odd(signed char& val)BOOST_NOEXCEPT{ unsigned result = gcd_traits<unsigned long>::find_lsb(val); val >>= result; return result; } };
template <> struct gcd_traits<char> : public gcd_traits_defaults<char>
{ BOOST_FORCEINLINE static unsigned make_odd(char& val)BOOST_NOEXCEPT{ unsigned result = gcd_traits<unsigned long>::find_lsb(val); val >>= result; return result; } };
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
@ -310,7 +310,7 @@ namespace boost {
};
template <> struct gcd_traits<signed char> : public gcd_traits_defaults<signed char>
{
BOOST_FORCEINLINE static BOOST_CXX14_CONSTEXPR signed make_odd(signed char& val)BOOST_NOEXCEPT { signed result = gcd_traits<unsigned>::find_lsb(val); val >>= result; return result; }
BOOST_FORCEINLINE static BOOST_CXX14_CONSTEXPR unsigned make_odd(signed char& val)BOOST_NOEXCEPT { unsigned result = gcd_traits<unsigned>::find_lsb(val); val >>= result; return result; }
};
template <> struct gcd_traits<char> : public gcd_traits_defaults<char>
{
@ -373,8 +373,8 @@ namespace boost {
if (n == SteinDomain(0))
return m;
// m > 0 && n > 0
int d_m = gcd_traits<SteinDomain>::make_odd(m);
int d_n = gcd_traits<SteinDomain>::make_odd(n);
unsigned d_m = gcd_traits<SteinDomain>::make_odd(m);
unsigned d_n = gcd_traits<SteinDomain>::make_odd(n);
// odd(m) && odd(n)
while (m != n)
{

View File

@ -1,9 +1,9 @@
#ifndef BOOST_PENDING_INTEGER_LOG2_HPP
#define BOOST_PENDING_INTEGER_LOG2_HPP
// The header file at this path is deprecated;
// use boost/integer/integer_log2.hpp instead.
#include <boost/integer/integer_log2.hpp>
#include <boost/config/header_deprecated.hpp>
BOOST_HEADER_DEPRECATED("<boost/integer/integer_log2.hpp>");
#endif

View File

@ -7,6 +7,7 @@
],
"authors": "",
"maintainers": [
"Daryle Walker <darylew -at- hotmail.com>"
"Daryle Walker <darylew -at- hotmail.com>",
"Andrey Semashev <andrey.semashev -at- gmail.com>"
]
}

View File

@ -10,7 +10,7 @@ obj has_gmpxx : has_gmpxx.cpp ;
explicit has_gmpxx ;
test-suite integer
:
:
[ run integer_traits_test.cpp ]
[ run integer_test.cpp : : : <toolset>gcc:<cxxflags>-Wno-long-long <toolset>darwin:<cxxflags>-Wno-long-long <toolset>sun:<cxxflags>"-Qoption ccfe -tmpldepth=128" ]
[ run integer_mask_test.cpp ]
@ -22,8 +22,8 @@ test-suite integer
[ compile static_log2_include_test.cpp ]
[ compile static_min_max_include_test.cpp ]
[ compile integer_fwd_include_test.cpp ]
[ compile gcd_constexpr14_test.cpp ]
[ compile gcd_noexcept_test.cpp ]
[ compile gcd_constexpr14_test.cpp ]
[ compile gcd_noexcept_test.cpp ]
[ compile-fail fail_int_exact.cpp ]
[ compile-fail fail_int_fast.cpp ]
[ compile-fail fail_int_least.cpp ]

View File

@ -34,7 +34,9 @@
#include <gmpxx.h>
#endif
#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1500)) || (defined(__clang_major__) && (__clang_major__ == 3) && (__clang_minor__ < 2))
#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1500)) || \
(defined(__clang_major__) && (__clang_major__ == 3) && (__clang_minor__ < 2)) || \
(defined(BOOST_GCC) && defined(BOOST_GCC_CXX11) && BOOST_GCC < 40800)
#define DISABLE_MP_TESTS
#endif

View File

@ -5,3 +5,11 @@
#include <gmpxx.h>
// On Linux, libgmpxx is built with gcc and libstdc++. When the user application, such as tests, are built against libc++,
// linking fails because of the C++ standard library symbol names mismatch. So fail the test if we're not using libstdc++.
#if defined(__linux__) || defined(__linux) || defined(linux)
#include <utility>
#if !defined(__GLIBCPP__) && !defined(__GLIBCXX__)
#error "libgmpxx is not supported on this platform with this C++ standard library"
#endif
#endif