| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
#ifndef WEBP_WEBP_TYPES_H_ |
| 15 |
#define WEBP_WEBP_TYPES_H_ |
| 16 |
|
| 17 |
#include <stddef.h> |
| 18 |
|
| 19 |
#ifndef _MSC_VER |
| 20 |
#include <inttypes.h> |
| 21 |
#if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \ |
| 22 |
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) |
| 23 |
#define WEBP_INLINE inline |
| 24 |
#else |
| 25 |
#define WEBP_INLINE |
| 26 |
#endif |
| 27 |
#else |
| 28 |
typedef signed char int8_t; |
| 29 |
typedef unsigned char uint8_t; |
| 30 |
typedef signed short int16_t; |
| 31 |
typedef unsigned short uint16_t; |
| 32 |
typedef signed int int32_t; |
| 33 |
typedef unsigned int uint32_t; |
| 34 |
typedef unsigned long long int uint64_t; |
| 35 |
typedef long long int int64_t; |
| 36 |
#define WEBP_INLINE __forceinline |
| 37 |
#endif |
| 38 |
|
| 39 |
#ifndef WEBP_NODISCARD |
| 40 |
#if defined(WEBP_ENABLE_NODISCARD) && WEBP_ENABLE_NODISCARD |
| 41 |
#if (defined(__cplusplus) && __cplusplus >= 201700L) || \ |
| 42 |
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) |
| 43 |
#define WEBP_NODISCARD [[nodiscard]] |
| 44 |
#else |
| 45 |
|
| 46 |
#if defined(__clang__) && defined(__has_attribute) |
| 47 |
#if __has_attribute(warn_unused_result) |
| 48 |
#define WEBP_NODISCARD __attribute__((warn_unused_result)) |
| 49 |
#else |
| 50 |
#define WEBP_NODISCARD |
| 51 |
#endif |
| 52 |
#else |
| 53 |
#define WEBP_NODISCARD |
| 54 |
#endif |
| 55 |
#endif |
| 56 |
|
| 57 |
#else |
| 58 |
#define WEBP_NODISCARD |
| 59 |
#endif |
| 60 |
#endif |
| 61 |
|
| 62 |
#ifndef WEBP_EXTERN |
| 63 |
|
| 64 |
|
| 65 |
# if defined(_WIN32) && defined(WEBP_DLL) |
| 66 |
# define WEBP_EXTERN __declspec(dllexport) |
| 67 |
# elif defined(__GNUC__) && __GNUC__ >= 4 |
| 68 |
# define WEBP_EXTERN extern __attribute__ ((visibility ("default"))) |
| 69 |
# else |
| 70 |
# define WEBP_EXTERN extern |
| 71 |
# endif |
| 72 |
#endif |
| 73 |
|
| 74 |
|
| 75 |
#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8)) |
| 76 |
|
| 77 |
#ifdef __cplusplus |
| 78 |
extern "C" { |
| 79 |
#endif |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
WEBP_NODISCARD WEBP_EXTERN void* WebPMalloc(size_t size); |
| 85 |
|
| 86 |
|
| 87 |
WEBP_EXTERN void WebPFree(void* ptr); |
| 88 |
|
| 89 |
#ifdef __cplusplus |
| 90 |
} |
| 91 |
#endif |
| 92 |
|
| 93 |
#endif |