summaryrefslogtreecommitdiff
path: root/source/kit/miniz/miniz_common.h
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2024-07-14 21:12:37 +0200
committerMitya Selivanov <automainint@guattari.tech>2024-07-14 21:12:37 +0200
commit30740ca4131d1f574718262451b4410207dc8d4e (patch)
treefc88b16a216079397ad85b9c6b1a1c1c5712a814 /source/kit/miniz/miniz_common.h
parent5e3c99bb1cf1d03ea006300121265571f5008fd2 (diff)
downloadsaw-30740ca4131d1f574718262451b4410207dc8d4e.zip
Reworking the build system
Diffstat (limited to 'source/kit/miniz/miniz_common.h')
-rw-r--r--source/kit/miniz/miniz_common.h122
1 files changed, 0 insertions, 122 deletions
diff --git a/source/kit/miniz/miniz_common.h b/source/kit/miniz/miniz_common.h
deleted file mode 100644
index 26306f3..0000000
--- a/source/kit/miniz/miniz_common.h
+++ /dev/null
@@ -1,122 +0,0 @@
-#ifndef KIT_MINIZ_MINIZ_COMMON_H
-#define KIT_MINIZ_MINIZ_COMMON_H
-
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* ------------------- Types and macros */
-typedef unsigned char mz_uint8;
-typedef signed short mz_int16;
-typedef unsigned short mz_uint16;
-typedef unsigned int mz_uint32;
-typedef unsigned int mz_uint;
-typedef int64_t mz_int64;
-typedef uint64_t mz_uint64;
-typedef int mz_bool;
-
-#define MZ_FALSE (0)
-#define MZ_TRUE (1)
-
-/* Works around MSVC's spammy "warning C4127: conditional expression
- * is constant" message. */
-#ifdef _MSC_VER
-# define MZ_MACRO_END while (0, 0)
-#else
-# define MZ_MACRO_END while (0)
-#endif
-
-#ifdef MINIZ_NO_STDIO
-# define MZ_FILE void *
-#else
-# include <stdio.h>
-# define MZ_FILE FILE
-#endif /* #ifdef MINIZ_NO_STDIO */
-
-#ifdef MINIZ_NO_TIME
-typedef struct mz_dummy_time_t_tag {
- mz_uint32 m_dummy1;
- mz_uint32 m_dummy2;
-} mz_dummy_time_t;
-# define MZ_TIME_T mz_dummy_time_t
-#else
-# define MZ_TIME_T time_t
-#endif
-
-#define MZ_ASSERT(x) assert(x)
-
-#ifdef MINIZ_NO_MALLOC
-# define MZ_MALLOC(x) NULL
-# define MZ_FREE(x) (void) x, ((void) 0)
-# define MZ_REALLOC(p, x) NULL
-#else
-# define MZ_MALLOC(x) malloc(x)
-# define MZ_FREE(x) free(x)
-# define MZ_REALLOC(p, x) realloc(p, x)
-#endif
-
-#define MZ_MAX(a, b) (((a) > (b)) ? (a) : (b))
-#define MZ_MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj))
-#define MZ_CLEAR_ARR(obj) memset((obj), 0, sizeof(obj))
-#define MZ_CLEAR_PTR(obj) memset((obj), 0, sizeof(*obj))
-
-#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
-# define MZ_READ_LE16(p) *((const mz_uint16 *) (p))
-# define MZ_READ_LE32(p) *((const mz_uint32 *) (p))
-#else
-# define MZ_READ_LE16(p) \
- ((mz_uint32) (((const mz_uint8 *) (p))[0]) | \
- ((mz_uint32) (((const mz_uint8 *) (p))[1]) << 8U))
-# define MZ_READ_LE32(p) \
- ((mz_uint32) (((const mz_uint8 *) (p))[0]) | \
- ((mz_uint32) (((const mz_uint8 *) (p))[1]) << 8U) | \
- ((mz_uint32) (((const mz_uint8 *) (p))[2]) << 16U) | \
- ((mz_uint32) (((const mz_uint8 *) (p))[3]) << 24U))
-#endif
-
-#define MZ_READ_LE64(p) \
- (((mz_uint64) MZ_READ_LE32(p)) | \
- (((mz_uint64) MZ_READ_LE32((const mz_uint8 *) (p) + \
- sizeof(mz_uint32))) \
- << 32U))
-
-#ifdef _MSC_VER
-# define MZ_FORCEINLINE __forceinline
-#elif defined(__GNUC__)
-# define MZ_FORCEINLINE __inline__ __attribute__((__always_inline__))
-#else
-# define MZ_FORCEINLINE inline
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Heap allocation callbacks.
-Note that mz_alloc_func parameter types purposely differ from zlib's:
-items/size is size_t, not unsigned long. */
-typedef void *(*mz_alloc_func)(void *opaque, size_t items,
- size_t size);
-typedef void (*mz_free_func)(void *opaque, void *address);
-typedef void *(*mz_realloc_func)(void *opaque, void *address,
- size_t items, size_t size);
-
-void *miniz_def_alloc_func(void *opaque, size_t items, size_t size);
-void miniz_def_free_func(void *opaque, void *address);
-void *miniz_def_realloc_func(void *opaque, void *address,
- size_t items, size_t size);
-
-#define MZ_UINT16_MAX (0xFFFFU)
-#define MZ_UINT32_MAX (0xFFFFFFFFU)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif