@@ -434,6 +434,7 @@ static HPy (*original_Long)(HPyContext *ctx, HPy h);
434434static HPy (* original_Float_FromDouble )(HPyContext * ctx , double v );
435435static double (* original_Float_AsDouble )(HPyContext * ctx , HPy h );
436436static long (* original_Long_AsLong )(HPyContext * ctx , HPy h );
437+ static long long (* original_Long_AsLongLong )(HPyContext * ctx , HPy h );
437438static unsigned long (* original_Long_AsUnsignedLong )(HPyContext * ctx , HPy h );
438439static double (* original_Long_AsDouble )(HPyContext * ctx , HPy h );
439440static HPy (* original_Long_FromLong )(HPyContext * ctx , long l );
@@ -524,6 +525,15 @@ static long augment_Long_AsLong(HPyContext *ctx, HPy h) {
524525 }
525526}
526527
528+ static long long augment_Long_AsLongLong (HPyContext * ctx , HPy h ) {
529+ uint64_t bits = toBits (h );
530+ if (isBoxedInt (bits )) {
531+ return (long long ) unboxInt (bits );
532+ } else {
533+ return original_Long_AsLongLong (ctx , h );
534+ }
535+ }
536+
527537static unsigned long augment_Long_AsUnsignedLong (HPyContext * ctx , HPy h ) {
528538 uint64_t bits = toBits (h );
529539 if (isBoxedInt (bits )) {
@@ -762,6 +772,8 @@ void initDirectFastPaths(HPyContext *context) {
762772
763773 AUGMENT (Long_AsLong );
764774
775+ AUGMENT (Long_AsLongLong );
776+
765777 AUGMENT (Long_AsUnsignedLong );
766778
767779 AUGMENT (Long_AsDouble );
0 commit comments