1
0

Types.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* 7zTypes.h */
  2. #ifndef __C_TYPES_H
  3. #define __C_TYPES_H
  4. #ifndef _7ZIP_BYTE_DEFINED
  5. #define _7ZIP_BYTE_DEFINED
  6. typedef unsigned char Byte;
  7. #endif
  8. #ifndef _7ZIP_UINT16_DEFINED
  9. #define _7ZIP_UINT16_DEFINED
  10. typedef unsigned short UInt16;
  11. #endif
  12. #ifndef _7ZIP_UINT32_DEFINED
  13. #define _7ZIP_UINT32_DEFINED
  14. #ifdef _LZMA_UINT32_IS_ULONG
  15. typedef unsigned long UInt32;
  16. #else
  17. typedef unsigned int UInt32;
  18. #endif
  19. #endif
  20. #ifndef _7ZIP_INT32_DEFINED
  21. #define _7ZIP_INT32_DEFINED
  22. #ifdef _LZMA_INT32_IS_ULONG
  23. typedef long Int32;
  24. #else
  25. typedef int Int32;
  26. #endif
  27. #endif
  28. /* #define _SZ_NO_INT_64 */
  29. /* define it your compiler doesn't support long long int */
  30. #ifndef _7ZIP_UINT64_DEFINED
  31. #define _7ZIP_UINT64_DEFINED
  32. #ifdef _SZ_NO_INT_64
  33. typedef unsigned long UInt64;
  34. #else
  35. #if defined(_MSC_VER) || defined(__BORLANDC__)
  36. typedef unsigned __int64 UInt64;
  37. #else
  38. typedef unsigned long long int UInt64;
  39. #endif
  40. #endif
  41. #endif
  42. /* #define _SZ_FILE_SIZE_32 */
  43. /* You can define _SZ_FILE_SIZE_32, if you don't need support for files larger than 4 GB*/
  44. #ifndef CFileSize
  45. #ifdef _SZ_FILE_SIZE_32
  46. typedef UInt32 CFileSize;
  47. #else
  48. typedef UInt64 CFileSize;
  49. #endif
  50. #endif
  51. #define SZ_RESULT int
  52. typedef int HRes;
  53. #define RES_OK (0)
  54. #define SZ_OK (0)
  55. #define SZE_DATA_ERROR (1)
  56. #define SZE_CRC_ERROR (3)
  57. #define SZE_ARCHIVE_ERROR (6)
  58. #define SZE_OUTOFMEMORY (0x8007000EL)
  59. #define SZE_NOTIMPL (0x80004001L)
  60. #define SZE_FAIL (0x80004005L)
  61. #define SZE_INVALIDARG (0x80070057L)
  62. #ifndef RINOK
  63. #define RINOK(x) { HRes __result_ = (x); if(__result_ != 0) return __result_; }
  64. #endif
  65. typedef int Bool;
  66. #define True 1
  67. #define False 0
  68. #ifdef _MSC_VER
  69. #define StdCall __stdcall
  70. #else
  71. #define StdCall
  72. #endif
  73. #if _MSC_VER >= 1300
  74. #define MY_FAST_CALL __declspec(noinline) __fastcall
  75. #elif defined( _MSC_VER)
  76. #define MY_FAST_CALL __fastcall
  77. #else
  78. #define MY_FAST_CALL
  79. #endif
  80. #endif