You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

101 lines
2.6 KiB

  1. /*
  2. * libpipi Pathetic image processing interface library
  3. * Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the Do What The Fuck You Want To
  10. * Public License, Version 2, as published by Sam Hocevar. See
  11. * http://sam.zoy.org/wtfpl/COPYING for more details.
  12. */
  13. /*
  14. * This file contains definitions for the C99 integer types.
  15. */
  16. #ifndef __PIPI_TYPES_H__
  17. #define __PIPI_TYPES_H__
  18. #ifndef PIPI_TYPES
  19. # define PIPI_TYPES @PIPI_TYPES@
  20. #endif
  21. /* mode 1: standard <stdint.h> header is present, just include it */
  22. #if PIPI_TYPES == 1
  23. # include <stdint.h>
  24. # include <unistd.h>
  25. /* mode 2: standard <inttypes.h> header is present, just include it */
  26. #elif PIPI_TYPES == 2
  27. # include <inttypes.h>
  28. # include <unistd.h>
  29. /* mode 3: <windows.h> indicates Win32, only (u)intptr_t is present
  30. * FIXME: Win64 probably doesn't work that way */
  31. #elif PIPI_TYPES == 3
  32. #include <windows.h>
  33. typedef signed char int8_t;
  34. typedef signed short int16_t;
  35. typedef signed int int32_t;
  36. typedef signed long long int int64_t;
  37. typedef unsigned char uint8_t;
  38. typedef unsigned short uint16_t;
  39. typedef unsigned int uint32_t;
  40. typedef unsigned long long int uint64_t;
  41. typedef int ssize_t;
  42. typedef unsigned int size_t;
  43. /* fallback: nothing is known, we assume the platform is 32-bit and
  44. * sizeof(long) == sizeof(void *). We don't typedef directly because we
  45. * have no idea what other typedefs have already been made. */
  46. #else
  47. typedef signed char _pipi_int8_t;
  48. typedef signed short _pipi_int16_t;
  49. typedef signed long int _pipi_int32_t;
  50. typedef signed long long int _pipi_int64_t;
  51. # undef int8_t
  52. # define int8_t _pipi_int8_t
  53. # undef int16_t
  54. # define int16_t _pipi_int16_t
  55. # undef int32_t
  56. # define int32_t _pipi_int32_t
  57. # undef int64_t
  58. # define int64_t _pipi_int64_t
  59. typedef unsigned char _pipi_uint8_t;
  60. typedef unsigned short _pipi_uint16_t;
  61. typedef unsigned long int _pipi_uint32_t;
  62. typedef unsigned long long int _pipi_uint64_t;
  63. # undef uint8_t
  64. # define uint8_t _pipi_uint8_t
  65. # undef uint16_t
  66. # define uint16_t _pipi_uint16_t
  67. # undef uint32_t
  68. # define uint32_t _pipi_uint32_t
  69. # undef uint64_t
  70. # define uint64_t _pipi_uint64_t
  71. typedef long int _pipi_intptr_t;
  72. typedef unsigned long int _pipi_uintptr_t;
  73. # undef intptr_t
  74. # define intptr_t _pipi_intptr_t
  75. # undef uintptr_t
  76. # define uintptr_t _pipi_uintptr_t
  77. typedef int _pipi_ssize_t;
  78. typedef unsigned int _pipi_size_t;
  79. # undef ssize_t
  80. # define ssize_t _pipi_ssize_t
  81. # undef size_t
  82. # define size_t _pipi_size_t
  83. #endif
  84. #endif /* __PIPI_TYPES_H__ */