Commit 8c94bfdf authored by Stefan Behnel's avatar Stefan Behnel

Exclude "long long" overflow checking code from compilation when...

Exclude "long long" overflow checking code from compilation when HAVE_LONG_LONG is not set by CPython.
parent 359f89a8
......@@ -74,6 +74,8 @@ if (unlikely(__Pyx_check_twos_complement())) {
/////////////// BaseCaseUnsigned.proto ///////////////
{{if UINT == "long long"}}#ifdef HAVE_LONG_LONG{{endif}}
static CYTHON_INLINE {{UINT}} __Pyx_add_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow);
static CYTHON_INLINE {{UINT}} __Pyx_sub_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow);
static CYTHON_INLINE {{UINT}} __Pyx_mul_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow);
......@@ -89,8 +91,12 @@ static CYTHON_INLINE {{UINT}} __Pyx_mul_const_{{NAME}}_checking_overflow({{UINT}
#endif
#define __Pyx_div_const_{{NAME}}_checking_overflow __Pyx_div_{{NAME}}_checking_overflow
{{if UINT == "long long"}}#endif{{endif}}
/////////////// BaseCaseUnsigned ///////////////
{{if UINT == "long long"}}#ifdef HAVE_LONG_LONG{{endif}}
#if defined(__PYX_HAVE_BUILTIN_OVERFLOW)
static CYTHON_INLINE {{UINT}} __Pyx_add_{{NAME}}_checking_overflow({{UINT}} a, {{UINT}} b, int *overflow) {
......@@ -174,9 +180,13 @@ static CYTHON_INLINE {{UINT}} __Pyx_div_{{NAME}}_checking_overflow({{UINT}} a, {
return a / b;
}
{{if UINT == "long long"}}#endif{{endif}}
/////////////// BaseCaseSigned.proto ///////////////
{{if INT == "long long"}}#ifdef HAVE_LONG_LONG{{endif}}
static CYTHON_INLINE {{INT}} __Pyx_add_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow);
static CYTHON_INLINE {{INT}} __Pyx_sub_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow);
static CYTHON_INLINE {{INT}} __Pyx_mul_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow);
......@@ -193,8 +203,12 @@ static CYTHON_INLINE {{INT}} __Pyx_mul_const_{{NAME}}_checking_overflow({{INT}}
#endif
#define __Pyx_div_const_{{NAME}}_checking_overflow __Pyx_div_{{NAME}}_checking_overflow
{{if INT == "long long"}}#endif{{endif}}
/////////////// BaseCaseSigned ///////////////
{{if INT == "long long"}}#ifdef HAVE_LONG_LONG{{endif}}
#if defined(__PYX_HAVE_BUILTIN_OVERFLOW)
static CYTHON_INLINE {{INT}} __Pyx_add_{{NAME}}_checking_overflow({{INT}} a, {{INT}} b, int *overflow) {
......@@ -306,6 +320,8 @@ static CYTHON_INLINE {{INT}} __Pyx_div_{{NAME}}_checking_overflow({{INT}} a, {{I
return ({{INT}}) ((unsigned {{INT}}) a / (unsigned {{INT}}) b);
}
{{if INT == "long long"}}#endif{{endif}}
/////////////// SizeCheck.init ///////////////
//@substitute: naming
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment