Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

115 рядки
3.0 KiB

  1. /*
  2. * libcaca Colour ASCII-Art library
  3. * libcaca Colour ASCII-Art library
  4. * Copyright (c) 2008-2010 Sam Hocevar <sam@hocevar.net>
  5. * All Rights Reserved
  6. *
  7. * This library is free software. It comes without any warranty, to
  8. * the extent permitted by applicable law. You can redistribute it
  9. * and/or modify it under the terms of the Do What The Fuck You Want
  10. * To 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 __CACA_TYPES_H__
  17. #define __CACA_TYPES_H__
  18. #ifndef CACA_TYPES
  19. # define CACA_TYPES @CACA_TYPES@
  20. #endif
  21. /* mode 1: standard <stdint.h> header is present, just include it */
  22. #if CACA_TYPES == 1
  23. # include <stdint.h>
  24. # include <unistd.h>
  25. /* mode 2: standard <inttypes.h> header is present, just include it */
  26. #elif CACA_TYPES == 2
  27. # include <inttypes.h>
  28. # include <unistd.h>
  29. /* mode 3: Win32, only (u)intptr_t is present */
  30. #elif CACA_TYPES == 3
  31. #include <windows.h>
  32. typedef signed char int8_t;
  33. typedef signed short int16_t;
  34. typedef signed int int32_t;
  35. typedef signed long long int int64_t;
  36. typedef unsigned char uint8_t;
  37. typedef unsigned short uint16_t;
  38. typedef unsigned int uint32_t;
  39. typedef unsigned long long int uint64_t;
  40. typedef int ssize_t;
  41. typedef unsigned int size_t;
  42. /* mode 4: Win64, only (u)intptr_t and size_t are present */
  43. #elif CACA_TYPES == 4
  44. #include <windows.h>
  45. typedef signed char int8_t;
  46. typedef signed short int16_t;
  47. typedef signed int int32_t;
  48. typedef signed long long int int64_t;
  49. typedef unsigned char uint8_t;
  50. typedef unsigned short uint16_t;
  51. typedef unsigned int uint32_t;
  52. typedef unsigned long long int uint64_t;
  53. typedef int ssize_t;
  54. /* fallback: nothing is known, we assume the platform is 32-bit and
  55. * sizeof(long) == sizeof(void *). We don't typedef directly because we
  56. * have no idea what other typedefs have already been made. */
  57. #else
  58. typedef signed char _caca_int8_t;
  59. typedef signed short _caca_int16_t;
  60. typedef signed long int _caca_int32_t;
  61. typedef signed long long int _caca_int64_t;
  62. # undef int8_t
  63. # define int8_t _caca_int8_t
  64. # undef int16_t
  65. # define int16_t _caca_int16_t
  66. # undef int32_t
  67. # define int32_t _caca_int32_t
  68. # undef int64_t
  69. # define int64_t _caca_int64_t
  70. typedef unsigned char _caca_uint8_t;
  71. typedef unsigned short _caca_uint16_t;
  72. typedef unsigned long int _caca_uint32_t;
  73. typedef unsigned long long int _caca_uint64_t;
  74. # undef uint8_t
  75. # define uint8_t _caca_uint8_t
  76. # undef uint16_t
  77. # define uint16_t _caca_uint16_t
  78. # undef uint32_t
  79. # define uint32_t _caca_uint32_t
  80. # undef uint64_t
  81. # define uint64_t _caca_uint64_t
  82. typedef long int _caca_intptr_t;
  83. typedef unsigned long int _caca_uintptr_t;
  84. # undef intptr_t
  85. # define intptr_t _caca_intptr_t
  86. # undef uintptr_t
  87. # define uintptr_t _caca_uintptr_t
  88. typedef int _caca_ssize_t;
  89. typedef unsigned int _caca_size_t;
  90. # undef ssize_t
  91. # define ssize_t _caca_ssize_t
  92. # undef size_t
  93. # define size_t _caca_size_t
  94. #endif
  95. #endif /* __CACA_TYPES_H__ */