2012-01-06 14:49:06 -08:00
|
|
|
// Copyright 2010 Google Inc. All Rights Reserved.
|
2011-01-06 07:25:43 -08:00
|
|
|
//
|
2013-06-06 23:05:58 -07:00
|
|
|
// Use of this source code is governed by a BSD-style license
|
|
|
|
// that can be found in the COPYING file in the root of the source
|
|
|
|
// tree. An additional intellectual property rights grant can be found
|
|
|
|
// in the file PATENTS. All contributing project authors may
|
|
|
|
// be found in the AUTHORS file in the root of the source tree.
|
2011-01-06 07:25:43 -08:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
//
|
2019-10-15 23:16:51 +02:00
|
|
|
// Common types + memory wrappers
|
2011-01-06 07:25:43 -08:00
|
|
|
//
|
|
|
|
// Author: Skal (pascal.massimino@gmail.com)
|
|
|
|
|
2011-01-31 22:00:33 -08:00
|
|
|
#ifndef WEBP_WEBP_TYPES_H_
|
|
|
|
#define WEBP_WEBP_TYPES_H_
|
2011-01-06 07:25:43 -08:00
|
|
|
|
2012-04-12 17:05:34 -07:00
|
|
|
#include <stddef.h> // for size_t
|
|
|
|
|
2011-01-06 07:25:43 -08:00
|
|
|
#ifndef _MSC_VER
|
|
|
|
#include <inttypes.h>
|
2014-10-30 14:49:31 +01:00
|
|
|
#if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \
|
|
|
|
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
|
2011-11-04 19:44:57 -07:00
|
|
|
#define WEBP_INLINE inline
|
2014-10-30 14:49:31 +01:00
|
|
|
#else
|
|
|
|
#define WEBP_INLINE
|
2011-11-04 19:44:57 -07:00
|
|
|
#endif
|
2011-01-06 07:25:43 -08:00
|
|
|
#else
|
|
|
|
typedef signed char int8_t;
|
|
|
|
typedef unsigned char uint8_t;
|
|
|
|
typedef signed short int16_t;
|
|
|
|
typedef unsigned short uint16_t;
|
|
|
|
typedef signed int int32_t;
|
|
|
|
typedef unsigned int uint32_t;
|
|
|
|
typedef unsigned long long int uint64_t;
|
2011-02-16 14:33:16 -08:00
|
|
|
typedef long long int int64_t;
|
2011-11-04 19:44:57 -07:00
|
|
|
#define WEBP_INLINE __forceinline
|
2011-01-06 07:25:43 -08:00
|
|
|
#endif /* _MSC_VER */
|
|
|
|
|
2011-07-12 19:43:15 -07:00
|
|
|
#ifndef WEBP_EXTERN
|
|
|
|
// This explicitly marks library functions and allows for changing the
|
|
|
|
// signature for e.g., Windows DLL builds.
|
2014-09-12 21:07:19 -07:00
|
|
|
# if defined(__GNUC__) && __GNUC__ >= 4
|
2017-07-31 18:12:11 -07:00
|
|
|
# define WEBP_EXTERN extern __attribute__ ((visibility ("default")))
|
2014-09-12 21:07:19 -07:00
|
|
|
# else
|
2022-08-11 19:33:37 -07:00
|
|
|
# if defined(_MSC_VER) && defined(WEBP_DLL)
|
|
|
|
# define WEBP_EXTERN __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define WEBP_EXTERN extern
|
|
|
|
# endif
|
2014-09-12 21:07:19 -07:00
|
|
|
# endif /* __GNUC__ >= 4 */
|
2011-07-12 19:43:15 -07:00
|
|
|
#endif /* WEBP_EXTERN */
|
|
|
|
|
2012-07-18 11:53:25 -07:00
|
|
|
// Macro to check ABI compatibility (same major revision number)
|
|
|
|
#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))
|
|
|
|
|
2019-10-15 23:16:51 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Allocates 'size' bytes of memory. Returns NULL upon error. Memory
|
|
|
|
// must be deallocated by calling WebPFree(). This function is made available
|
|
|
|
// by the core 'libwebp' library.
|
|
|
|
WEBP_EXTERN void* WebPMalloc(size_t size);
|
|
|
|
|
|
|
|
// Releases memory returned by the WebPDecode*() functions (from decode.h).
|
|
|
|
WEBP_EXTERN void WebPFree(void* ptr);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
2018-08-22 14:46:53 -07:00
|
|
|
#endif // WEBP_WEBP_TYPES_H_
|