Skip to content

Commit a645a06

Browse files
committed
miniz: do not define conditionally used functions
No need for static functions that are only used when `MINIZ_NO_ARCHIVE_WRITING_APIS` is unset.
1 parent be4b5f4 commit a645a06

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jbmc/src/miniz/miniz.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -3397,6 +3397,7 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
33973397
return MZ_TRUE;
33983398
}
33993399

3400+
#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
34003401
static MZ_FORCEINLINE mz_bool mz_zip_array_reserve(mz_zip_archive *pZip, mz_zip_array *pArray, size_t new_capacity, mz_uint growing)
34013402
{
34023403
if (new_capacity > pArray->m_capacity)
@@ -3406,6 +3407,7 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
34063407
}
34073408
return MZ_TRUE;
34083409
}
3410+
#endif
34093411

34103412
static MZ_FORCEINLINE mz_bool mz_zip_array_resize(mz_zip_archive *pZip, mz_zip_array *pArray, size_t new_size, mz_uint growing)
34113413
{
@@ -3418,6 +3420,7 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
34183420
return MZ_TRUE;
34193421
}
34203422

3423+
#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
34213424
static MZ_FORCEINLINE mz_bool mz_zip_array_ensure_room(mz_zip_archive *pZip, mz_zip_array *pArray, size_t n)
34223425
{
34233426
return mz_zip_array_reserve(pZip, pArray, pArray->m_size + n, MZ_TRUE);
@@ -3432,6 +3435,7 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
34323435
memcpy((mz_uint8 *)pArray->m_p + orig_size * pArray->m_element_size, pElements, n * pArray->m_element_size);
34333436
return MZ_TRUE;
34343437
}
3438+
#endif /* #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS */
34353439

34363440
#ifndef MINIZ_NO_TIME
34373441
static MZ_TIME_T mz_zip_dos_to_time_t(int dos_time, int dos_date)
@@ -5781,6 +5785,7 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
57815785
return n;
57825786
}
57835787

5788+
#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
57845789
static mz_bool mz_zip_writer_end_internal(mz_zip_archive *pZip, mz_bool set_last_error)
57855790
{
57865791
mz_zip_internal_state *pState;
@@ -7540,6 +7545,7 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
75407545
{
75417546
return mz_zip_writer_end_internal(pZip, MZ_TRUE);
75427547
}
7548+
#endif /* #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS */
75437549

75447550
#ifndef MINIZ_NO_STDIO
75457551
mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags)

0 commit comments

Comments
 (0)