Skip to content

Commit

Permalink
use absl for int128 (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
artpaul committed Sep 24, 2020
1 parent cfa4554 commit ddeb031
Show file tree
Hide file tree
Showing 17 changed files with 4,481 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ PROJECT (CLICKHOUSE-CLIENT)

SUBDIRS (
clickhouse
contrib/absl
contrib/cityhash
contrib/lz4
)
Expand Down
2 changes: 2 additions & 0 deletions clickhouse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ SET_TARGET_PROPERTIES(clickhouse-cpp-lib
PROPERTIES LINKER_LANGUAGE CXX)

TARGET_LINK_LIBRARIES (clickhouse-cpp-lib
absl-lib
cityhash-lib
lz4-lib
)

ADD_LIBRARY (clickhouse-cpp-lib-static STATIC ${clickhouse-cpp-lib-src})
TARGET_LINK_LIBRARIES (clickhouse-cpp-lib-static
absl-lib
cityhash-lib
lz4-lib
)
3 changes: 2 additions & 1 deletion clickhouse/columns/numeric.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "column.h"
#include "absl/numeric/int128.h"

namespace clickhouse {

Expand Down Expand Up @@ -48,7 +49,7 @@ class ColumnVector : public Column {
std::vector<T> data_;
};

using Int128 = __int128;
using Int128 = absl::int128;

using ColumnUInt8 = ColumnVector<uint8_t>;
using ColumnUInt16 = ColumnVector<uint16_t>;
Expand Down
4 changes: 3 additions & 1 deletion clickhouse/types/types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "absl/numeric/int128.h"

#include <map>
#include <memory>
#include <string>
Expand Down Expand Up @@ -184,7 +186,7 @@ inline TypeRef Type::CreateSimple<int64_t>() {
}

template <>
inline TypeRef Type::CreateSimple<__int128>() {
inline TypeRef Type::CreateSimple<absl::int128>() {
return TypeRef(new Type(Int128));
}

Expand Down
3 changes: 3 additions & 0 deletions contrib/absl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ADD_LIBRARY (absl-lib STATIC
numeric/int128.cc
)
Loading

0 comments on commit ddeb031

Please sign in to comment.