mirror of
https://github.com/python/cpython.git
synced 2025-11-11 06:39:54 +00:00
Applying patch by Neal Norwitz:
[#727759] get bzip2 to build on Solaris 8 (old bzip library)
This commit is contained in:
parent
965697fc4b
commit
7628f1ffff
1 changed files with 25 additions and 0 deletions
|
|
@ -31,6 +31,9 @@ static char __author__[] =
|
||||||
|
|
||||||
#define BZ2FileObject_Check(v) ((v)->ob_type == &BZ2File_Type)
|
#define BZ2FileObject_Check(v) ((v)->ob_type == &BZ2File_Type)
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef BZ_CONFIG_ERROR
|
||||||
|
|
||||||
#if SIZEOF_LONG >= 8
|
#if SIZEOF_LONG >= 8
|
||||||
#define BZS_TOTAL_OUT(bzs) \
|
#define BZS_TOTAL_OUT(bzs) \
|
||||||
(((long)bzs->total_out_hi32 << 32) + bzs->total_out_lo32)
|
(((long)bzs->total_out_hi32 << 32) + bzs->total_out_lo32)
|
||||||
|
|
@ -42,6 +45,26 @@ static char __author__[] =
|
||||||
bzs->total_out_lo32;
|
bzs->total_out_lo32;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#else /* ! BZ_CONFIG_ERROR */
|
||||||
|
|
||||||
|
#define BZ2_bzRead bzRead
|
||||||
|
#define BZ2_bzReadOpen bzReadOpen
|
||||||
|
#define BZ2_bzReadClose bzReadClose
|
||||||
|
#define BZ2_bzWrite bzWrite
|
||||||
|
#define BZ2_bzWriteOpen bzWriteOpen
|
||||||
|
#define BZ2_bzWriteClose bzWriteClose
|
||||||
|
#define BZ2_bzCompress bzCompress
|
||||||
|
#define BZ2_bzCompressInit bzCompressInit
|
||||||
|
#define BZ2_bzCompressEnd bzCompressEnd
|
||||||
|
#define BZ2_bzDecompress bzDecompress
|
||||||
|
#define BZ2_bzDecompressInit bzDecompressInit
|
||||||
|
#define BZ2_bzDecompressEnd bzDecompressEnd
|
||||||
|
|
||||||
|
#define BZS_TOTAL_OUT(bzs) bzs->total_out
|
||||||
|
|
||||||
|
#endif /* ! BZ_CONFIG_ERROR */
|
||||||
|
|
||||||
|
|
||||||
#ifdef WITH_THREAD
|
#ifdef WITH_THREAD
|
||||||
#define ACQUIRE_LOCK(obj) PyThread_acquire_lock(obj->lock, 1)
|
#define ACQUIRE_LOCK(obj) PyThread_acquire_lock(obj->lock, 1)
|
||||||
#define RELEASE_LOCK(obj) PyThread_release_lock(obj->lock)
|
#define RELEASE_LOCK(obj) PyThread_release_lock(obj->lock)
|
||||||
|
|
@ -117,12 +140,14 @@ Util_CatchBZ2Error(int bzerror)
|
||||||
case BZ_STREAM_END:
|
case BZ_STREAM_END:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef BZ_CONFIG_ERROR
|
||||||
case BZ_CONFIG_ERROR:
|
case BZ_CONFIG_ERROR:
|
||||||
PyErr_SetString(PyExc_SystemError,
|
PyErr_SetString(PyExc_SystemError,
|
||||||
"the bz2 library was not compiled "
|
"the bz2 library was not compiled "
|
||||||
"correctly");
|
"correctly");
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case BZ_PARAM_ERROR:
|
case BZ_PARAM_ERROR:
|
||||||
PyErr_SetString(PyExc_ValueError,
|
PyErr_SetString(PyExc_ValueError,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue