mirror of
https://github.com/zlib-ng/minizip-ng
synced 2025-03-28 21:13:18 +00:00
Create dummy inttypes.h if it doesn't exist in compatibility mode. #344
This commit is contained in:
parent
a93a2ad678
commit
4d4c9db5b0
@ -282,6 +282,21 @@ if(USE_COMPAT)
|
||||
string(REPLACE "MZ_COMPAT_FILE" "MZ_COMPAT_UNZIP" UNZIP_COMPAT_HEADER ${UNZIP_COMPAT_HEADER})
|
||||
file(WRITE "unzip.h" ${UNZIP_COMPAT_HEADER})
|
||||
list(APPEND MINIZIP_PUBLIC_HEADERS "unzip.h")
|
||||
|
||||
include(CheckIncludeFile)
|
||||
check_include_file(inttypes.h HAVE_INTTYPES_H)
|
||||
if(NOT HAVE_INTTYPES_H)
|
||||
set(COMPAT_INTTYPES "\
|
||||
#define PRId16 \"hd\"
|
||||
#define PRId32 \"d\"
|
||||
#define PRIu32 \"u\"
|
||||
#define PRIx32 \"x\"
|
||||
#define PRId64 \"lld\"
|
||||
#define PRIu64 \"llu\"
|
||||
#define PRIx64 \"llx\"
|
||||
")
|
||||
file(WRITE "inttypes.h" ${COMPAT_INTTYPES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Include PKCRYPT
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "mz.h"
|
||||
@ -60,7 +61,6 @@ typedef struct mz_stream_buffered_s {
|
||||
#if 0
|
||||
# define mz_stream_buffered_print printf
|
||||
#else
|
||||
# include <inttypes.h>
|
||||
# define mz_stream_buffered_print(fmt,...)
|
||||
#endif
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
@ -70,7 +71,6 @@ typedef struct mz_stream_win32_s
|
||||
#if 0
|
||||
# define mz_stream_os_print printf
|
||||
#else
|
||||
# include <inttypes.h>
|
||||
# define mz_stream_os_print(fmt,...)
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user