ImPlatform.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * The Python Imaging Library
  3. * $Id$
  4. *
  5. * platform declarations for the imaging core library
  6. *
  7. * Copyright (c) Fredrik Lundh 1995-2003.
  8. */
  9. #include "Python.h"
  10. /* Check that we have an ANSI compliant compiler */
  11. #ifndef HAVE_PROTOTYPES
  12. #error Sorry, this library requires support for ANSI prototypes.
  13. #endif
  14. #ifndef STDC_HEADERS
  15. #error Sorry, this library requires ANSI header files.
  16. #endif
  17. #if defined(PIL_NO_INLINE)
  18. #define inline
  19. #else
  20. #if defined(_MSC_VER) && !defined(__GNUC__)
  21. #define inline __inline
  22. #endif
  23. #endif
  24. #ifdef _WIN32
  25. #define WIN32_LEAN_AND_MEAN
  26. #include <Windows.h>
  27. #else
  28. /* For System that are not Windows, we'll need to define these. */
  29. #if SIZEOF_SHORT == 2
  30. #define INT16 short
  31. #elif SIZEOF_INT == 2
  32. #define INT16 int
  33. #else
  34. #define INT16 short /* most things works just fine anyway... */
  35. #endif
  36. #if SIZEOF_SHORT == 4
  37. #define INT32 short
  38. #elif SIZEOF_INT == 4
  39. #define INT32 int
  40. #elif SIZEOF_LONG == 4
  41. #define INT32 long
  42. #else
  43. #error Cannot find required 32-bit integer type
  44. #endif
  45. #if SIZEOF_LONG == 8
  46. #define INT64 long
  47. #elif SIZEOF_LONG_LONG == 8
  48. #define INT64 long
  49. #endif
  50. #define INT8 signed char
  51. #define UINT8 unsigned char
  52. #define UINT16 unsigned INT16
  53. #define UINT32 unsigned INT32
  54. #endif
  55. /* assume IEEE; tweak if necessary (patches are welcome) */
  56. #define FLOAT32 float
  57. #define FLOAT64 double
  58. #ifdef _MSC_VER
  59. typedef signed __int64 int64_t;
  60. #endif
  61. #ifdef __GNUC__
  62. #define GCC_VERSION (__GNUC__ * 10000 \
  63. + __GNUC_MINOR__ * 100 \
  64. + __GNUC_PATCHLEVEL__)
  65. #endif