@@ -31,6 +31,9 @@ static char __author__[] =
3131
3232#define BZ2FileObject_Check (v ) ((v)->ob_type == &BZ2File_Type)
3333
34+
35+ #ifdef BZ_CONFIG_ERROR
36+
3437#if SIZEOF_LONG >= 8
3538#define BZS_TOTAL_OUT (bzs ) \
3639 (((long)bzs->total_out_hi32 << 32) + bzs->total_out_lo32)
@@ -42,6 +45,26 @@ static char __author__[] =
4245 bzs->total_out_lo32;
4346#endif
4447
48+ #else /* ! BZ_CONFIG_ERROR */
49+
50+ #define BZ2_bzRead bzRead
51+ #define BZ2_bzReadOpen bzReadOpen
52+ #define BZ2_bzReadClose bzReadClose
53+ #define BZ2_bzWrite bzWrite
54+ #define BZ2_bzWriteOpen bzWriteOpen
55+ #define BZ2_bzWriteClose bzWriteClose
56+ #define BZ2_bzCompress bzCompress
57+ #define BZ2_bzCompressInit bzCompressInit
58+ #define BZ2_bzCompressEnd bzCompressEnd
59+ #define BZ2_bzDecompress bzDecompress
60+ #define BZ2_bzDecompressInit bzDecompressInit
61+ #define BZ2_bzDecompressEnd bzDecompressEnd
62+
63+ #define BZS_TOTAL_OUT (bzs ) bzs->total_out
64+
65+ #endif /* ! BZ_CONFIG_ERROR */
66+
67+
4568#ifdef WITH_THREAD
4669#define ACQUIRE_LOCK (obj ) PyThread_acquire_lock(obj->lock, 1)
4770#define RELEASE_LOCK (obj ) PyThread_release_lock(obj->lock)
@@ -117,12 +140,14 @@ Util_CatchBZ2Error(int bzerror)
117140 case BZ_STREAM_END :
118141 break ;
119142
143+ #ifdef BZ_CONFIG_ERROR
120144 case BZ_CONFIG_ERROR :
121145 PyErr_SetString (PyExc_SystemError ,
122146 "the bz2 library was not compiled "
123147 "correctly" );
124148 ret = 1 ;
125149 break ;
150+ #endif
126151
127152 case BZ_PARAM_ERROR :
128153 PyErr_SetString (PyExc_ValueError ,
0 commit comments