Skip to content

Commit

Permalink
Stop checking HAVE_LONG_LONG
Browse files Browse the repository at this point in the history
`long long` has been a standard type since C++11.

Furthermore, according to Python's `Include/pyport.h`, `HAVE_LONG_LONG` is
always 1.

PiperOrigin-RevId: 607155351
  • Loading branch information
CLIF Team authored and rwgk committed Feb 19, 2024
1 parent 6e09925 commit 25b988f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions clif/python/types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ bool Clif_PyObjAs(PyObject* py, long* c) { //NOLINT: runtime/int
}

// int64
#ifdef HAVE_LONG_LONG
bool Clif_PyObjAs(PyObject* py, long long* c) { //NOLINT: runtime/int
CHECK(c != nullptr);
if (!PyLong_Check(py)) {
Expand Down Expand Up @@ -270,7 +269,6 @@ bool Clif_PyObjAs(PyObject* py, absl::uint128* c) { // NOLINT: runtime/int
}
return !PyErr_Occurred();
}
#endif // HAVE_LONG_LONG

#ifdef ABSL_HAVE_INTRINSIC_INT128
bool Clif_PyObjAs(PyObject* py, __int128* c) {
Expand Down
4 changes: 0 additions & 4 deletions clif/python/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ inline PyObject* Clif_PyObjFrom(unsigned long c, // NOLINT runtime/int
return pc.Apply(PyLong_FromSize_t(c));
}
// CLIF use `int64` as int64
#ifdef HAVE_LONG_LONG
inline PyObject* Clif_PyObjFrom(long long c, // NOLINT runtime/int
const py::PostConv& pc) {
return pc.Apply(PyLong_FromLongLong(c));
Expand All @@ -128,7 +127,6 @@ inline PyObject* Clif_PyObjFrom(absl::uint128 c, const py::PostConv& pc) {
auto lo = PyLong_FromUnsignedLongLong(absl::Uint128Low64(c));
return pc.Apply(PyNumber_Add(hi, lo));
}
#endif

#ifdef ABSL_HAVE_INTRINSIC_INT128
// CLIF use2 `__int128` as int
Expand Down Expand Up @@ -195,12 +193,10 @@ bool Clif_PyObjAs(PyObject*, unsigned char*);
bool Clif_PyObjAs(PyObject*, unsigned short*); // NOLINT runtime/int
bool Clif_PyObjAs(PyObject*, unsigned int*);
bool Clif_PyObjAs(PyObject*, unsigned long*); // NOLINT runtime/int
#ifdef HAVE_LONG_LONG
bool Clif_PyObjAs(PyObject*, unsigned long long*); // NOLINT runtime/int
bool Clif_PyObjAs(PyObject*, long long*); // NOLINT runtime/int
bool Clif_PyObjAs(PyObject*, absl::int128*); // NOLINT runtime/int
bool Clif_PyObjAs(PyObject*, absl::uint128*); // NOLINT runtime/int
#endif
#ifdef ABSL_HAVE_INTRINSIC_INT128
bool Clif_PyObjAs(PyObject*, __int128*);
bool Clif_PyObjAs(PyObject*, unsigned __int128*);
Expand Down

0 comments on commit 25b988f

Please sign in to comment.