Skip to content

Commit 8487ae6

Browse files
committed
libpressio version 0.46.1
Bug Fixes + Fix several build failures on GCC-4.8 and add CI to ensure they don't return.
1 parent 2db31d8 commit 8487ae6

23 files changed

+196
-76
lines changed

.travis.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,28 @@ matrix:
66
env:
77
- CC=gcc-7
88
- CXX=g++-7
9+
- EXTRA_BUILD_ARGS=
10+
- os: linux
11+
env:
12+
- CC=gcc-4.8
13+
- CXX=g++-4.8
14+
- EXTRA_BUILD_ARGS=-DLIBPRESSIO_CXX_VERSION=11
15+
addons:
16+
apt:
17+
packages:
18+
- gcc-4.8
19+
- g++-4.8
20+
- libboost-dev
21+
- doxygen
22+
- graphviz
23+
- libhdf5-dev
24+
- libmagick++-dev
25+
- libblosc-dev
926
- os: linux
1027
env:
1128
- CC=clang
1229
- CXX=clang++
30+
- EXTRA_BUILD_ARGS=
1331

1432
addons:
1533
apt:
@@ -29,7 +47,7 @@ before_install:
2947
script:
3048
- mkdir build
3149
- cd build
32-
- cmake .. -DCMAKE_BUILD_TYPE=Release -DLIBPRESSIO_HAS_SZ=OFF -DLIBPRESSIO_HAS_ZFP=OFF -DBUILD_DOCS=ON
50+
- cmake .. -DCMAKE_BUILD_TYPE=Release -DLIBPRESSIO_HAS_SZ=OFF -DBUILD_DOCS=ON $EXTRA_BUILD_ARGS
3351
- cmake --build .
3452
- cmake --build . --target docs
3553
- ctest

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
2-
project(libpressio VERSION "0.46.0" LANGUAGES CXX C)
2+
project(libpressio VERSION "0.46.1" LANGUAGES CXX C)
33

44
#correct was to set a default build type
55
# https://blog.kitware.com/cmake-and-the-default-build-type/
@@ -66,6 +66,7 @@ check_cpp_standard(void_t)
6666
check_cpp_standard(negation)
6767
check_cpp_standard(clamp)
6868
check_cpp_standard(string_view)
69+
check_cpp_standard(is_null_pointer)
6970

7071

7172
set(LIBPRESSIO_FEATURES "")
@@ -87,6 +88,7 @@ add_library(libpressio
8788

8889
#compat implementation
8990
./src/compat/span.cc
91+
./src/compat/optional.cc
9092

9193
#plugins
9294
./src/plugins/compressors/compressor_base.cc

checks/is_null_pointer.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <type_traits>
2+
3+
int main()
4+
{
5+
return std::is_null_pointer<std::nullptr_t>::value;
6+
}

include/libpressio_ext/compat/algorithm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ namespace compat {
4747
template<class T>
4848
constexpr const T& clamp( const T& v, const T& low, const T& hi )
4949
{
50+
#if __cplusplus >= 201703L
5051
assert( !(hi < low) );
52+
#endif
5153
return (v < low) ? low : (hi < v) ? hi : v;
5254
}
5355

@@ -61,7 +63,9 @@ constexpr const T& clamp( const T& v, const T& low, const T& hi )
6163
template<class T, class Compare>
6264
constexpr const T& clamp( const T& v, const T& low, const T& high, Compare comp )
6365
{
66+
#if __cplusplus >= 201703L
6467
assert( !comp(high, low) );
68+
#endif
6569
return comp(v, low) ? low : comp(high, v) ? high : v;
6670
}
6771
#else
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <utility>
2+
3+
#if __cplusplus >= 201703L
4+
#define RVO_MOVE(x) (x)
5+
#define DEFAULTED_NOEXCEPT noexcept
6+
#else
7+
#define RVO_MOVE(x) std::move(x)
8+
#define DEFAULTED_NOEXCEPT
9+
#endif

include/libpressio_ext/compat/numeric.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
#ifndef LIBPRESSIO_COMPAT_NUMERIC_H
66
#define LIBPRESSIO_COMPAT_NUMERIC_H
77
#include <pressio_version.h>
8-
#include <type_traits>
98
#include <limits>
109
#include <cstddef>
1110
#include <numeric>
1211
#include "functional.h"
12+
#include "type_traits.h"
1313

1414
namespace compat {
1515
#if !(LIBPRESSIO_COMPAT_HAS_MIDPOINT)
@@ -22,11 +22,11 @@ namespace compat {
2222
template <class Type>
2323
constexpr typename std::enable_if<std::is_integral<Type>::value &&
2424
!std::is_same<bool, Type>::value &&
25-
!std::is_null_pointer<Type>::value,
25+
!compat::is_null_pointer<Type>::value,
2626
Type>::type
2727
midpoint(Type a, Type b) noexcept
2828
{
29-
using Up = std::make_unsigned_t<Type>;
29+
using Up = typename std::make_unsigned<Type>::type;
3030
constexpr Up bitshift = std::numeric_limits<Up>::digits - 1;
3131

3232
Up diff = Up(b) - Up(a);

include/libpressio_ext/compat/optional.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99

1010
#if !(LIBPRESSIO_COMPAT_HAS_OPTIONAL)
1111
#include <boost/optional.hpp>
12+
#include <boost/none.hpp>
1213
#else
1314
#include <optional>
1415
#endif
1516

1617
namespace compat {
1718
#if (!LIBPRESSIO_COMPAT_HAS_OPTIONAL)
1819
using boost::optional;
20+
extern const boost::none_t& nullopt;
1921
#else
2022
using std::optional;
2123
using std::nullopt;

0 commit comments

Comments
 (0)