2013-07-01 02:42:19 +04:00
|
|
|
/*
|
2010-07-31 06:52:47 +04:00
|
|
|
* The Python Imaging Library
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* platform declarations for the imaging core library
|
|
|
|
*
|
|
|
|
* Copyright (c) Fredrik Lundh 1995-2003.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Python.h"
|
|
|
|
|
2017-04-19 22:56:13 +03:00
|
|
|
/* Workaround issue #2479 */
|
2017-04-19 23:27:59 +03:00
|
|
|
#if PY_VERSION_HEX < 0x03070000 && defined(PySlice_GetIndicesEx) && !defined(PYPY_VERSION)
|
2017-04-19 22:56:13 +03:00
|
|
|
#undef PySlice_GetIndicesEx
|
|
|
|
#endif
|
|
|
|
|
2010-07-31 06:52:47 +04:00
|
|
|
/* Check that we have an ANSI compliant compiler */
|
|
|
|
#ifndef HAVE_PROTOTYPES
|
|
|
|
#error Sorry, this library requires support for ANSI prototypes.
|
|
|
|
#endif
|
|
|
|
#ifndef STDC_HEADERS
|
|
|
|
#error Sorry, this library requires ANSI header files.
|
|
|
|
#endif
|
|
|
|
|
2014-07-01 02:26:41 +04:00
|
|
|
#if defined(PIL_NO_INLINE)
|
2016-06-17 13:03:21 +03:00
|
|
|
#define inline
|
2014-06-25 09:23:17 +04:00
|
|
|
#else
|
2014-05-09 23:05:30 +04:00
|
|
|
#if defined(_MSC_VER) && !defined(__GNUC__)
|
2010-07-31 06:52:47 +04:00
|
|
|
#define inline __inline
|
2014-05-09 22:14:46 +04:00
|
|
|
#endif
|
2010-07-31 06:52:47 +04:00
|
|
|
#endif
|
|
|
|
|
2014-05-09 23:05:30 +04:00
|
|
|
#ifdef _WIN32
|
|
|
|
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#include <Windows.h>
|
|
|
|
|
|
|
|
#else
|
|
|
|
/* For System that are not Windows, we'll need to define these. */
|
|
|
|
|
2010-07-31 06:52:47 +04:00
|
|
|
#if SIZEOF_SHORT == 2
|
|
|
|
#define INT16 short
|
|
|
|
#elif SIZEOF_INT == 2
|
|
|
|
#define INT16 int
|
|
|
|
#else
|
|
|
|
#define INT16 short /* most things works just fine anyway... */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SIZEOF_SHORT == 4
|
|
|
|
#define INT32 short
|
|
|
|
#elif SIZEOF_INT == 4
|
|
|
|
#define INT32 int
|
|
|
|
#elif SIZEOF_LONG == 4
|
|
|
|
#define INT32 long
|
|
|
|
#else
|
|
|
|
#error Cannot find required 32-bit integer type
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SIZEOF_LONG == 8
|
|
|
|
#define INT64 long
|
|
|
|
#elif SIZEOF_LONG_LONG == 8
|
|
|
|
#define INT64 long
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define INT8 signed char
|
|
|
|
#define UINT8 unsigned char
|
|
|
|
|
|
|
|
#define UINT16 unsigned INT16
|
|
|
|
#define UINT32 unsigned INT32
|
2014-05-09 23:05:30 +04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* assume IEEE; tweak if necessary (patches are welcome) */
|
|
|
|
#define FLOAT32 float
|
|
|
|
#define FLOAT64 double
|
|
|
|
|
2014-07-06 02:06:17 +04:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
typedef signed __int64 int64_t;
|
|
|
|
#endif
|
2014-10-27 18:09:45 +03:00
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#define GCC_VERSION (__GNUC__ * 10000 \
|
|
|
|
+ __GNUC_MINOR__ * 100 \
|
|
|
|
+ __GNUC_PATCHLEVEL__)
|
|
|
|
#endif
|