rhsyscfg.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. ---------------------------------------------------------------------------
  3. Copyright (c) 2003, Dominik Reichl <dominik.reichl@t-online.de>, Germany.
  4. All rights reserved.
  5. Distributed under the terms of the GNU General Public License v2.
  6. This software is provided 'as is' with no explicit or implied warranties
  7. in respect of its properties, including, but not limited to, correctness
  8. and/or fitness for purpose.
  9. ---------------------------------------------------------------------------
  10. */
  11. #ifndef ___RH_SYSTEM_CONFIG_H___
  12. #define ___RH_SYSTEM_CONFIG_H___
  13. //////////////////////////////////////////////////////////////////////////////
  14. // Start build mode
  15. // #define or #undef RH_DEBUG
  16. #define RH_DEBUG
  17. #define RH_RELEASE
  18. // End build mode
  19. //////////////////////////////////////////////////////////////////////////////
  20. // If you define RH_RELEASE, RH_DEBUG will be undefined
  21. //////////////////////////////////////////////////////////////////////////////
  22. #define RH_LITTLE_ENDIAN
  23. #undef RH_BIG_ENDIAN
  24. #include <stdlib.h>
  25. #include <stdio.h>
  26. #include <conio.h>
  27. #include <io.h>
  28. #include <direct.h>
  29. #include <limits.h>
  30. #include <memory.h>
  31. #include <string.h>
  32. #include <errno.h>
  33. // Don't change this!!!:
  34. #ifdef RH_RELEASE
  35. #undef RH_DEBUG
  36. #endif
  37. // Only for release version:
  38. #ifndef RH_DEBUG
  39. #pragma warning(disable : 4101) /* Unused variable */
  40. #endif
  41. #ifndef __cplusplus
  42. #error You need a CPlusPlus compiler to compile the ReHash project
  43. #endif
  44. #define RH_TARGET_SYSTEM_NULL 0
  45. #define RH_TARGET_SYSTEM_WINDOWS 1
  46. #define RH_TARGET_SYSTEM_LINUX 2
  47. #if defined(WIN32)
  48. #define RH_TARGET_SYSTEM RH_TARGET_SYSTEM_WINDOWS
  49. #elif defined(_WIN32)
  50. #define RH_TARGET_SYSTEM RH_TARGET_SYSTEM_WINDOWS
  51. #elif defined(MSC_VER)
  52. #define RH_TARGET_SYSTEM RH_TARGET_SYSTEM_WINDOWS
  53. #elif defined(_MSC_VER)
  54. #define RH_TARGET_SYSTEM RH_TARGET_SYSTEM_WINDOWS
  55. #else
  56. #define RH_TARGET_SYSTEM RH_TARGET_SYSTEM_LINUX
  57. #endif // RH_TARGET_SYSTEM is now defined
  58. #if (RH_TARGET_SYSTEM == RH_TARGET_SYSTEM_WINDOWS)
  59. #define CPS_NEWLINE "\r\n"
  60. #else
  61. #define CPS_NEWLINE "\n"
  62. #endif
  63. #define recursivesafe /* recursive safe variable declaration */
  64. #if (RH_TARGET_SYSTEM == RH_TARGET_SYSTEM_WINDOWS)
  65. #define SZ_DIR_CHAR '\\'
  66. #define SZ_DIR_STR "\\"
  67. #define SZ_LEVEL_UP ".\\..\\"
  68. #define SZ_DIR_ALL "*"
  69. #else
  70. #define SZ_DIR_CHAR '/'
  71. #define SZ_DIR_STR "/"
  72. #define SZ_LEVEL_UP "./../"
  73. #define SZ_DIR_ALL "*"
  74. #endif
  75. #ifndef strlwr
  76. #define strlwr _strlwr
  77. #endif
  78. #ifndef fullpath
  79. #define fullpath _fullpath
  80. #endif
  81. #ifndef findfirst
  82. #define findfirst _findfirst
  83. #endif
  84. #ifndef findnext
  85. #define findnext _findnext
  86. #endif
  87. #ifndef findclose
  88. #define findclose _findclose
  89. #endif
  90. #ifndef finddata
  91. #define finddata _finddata_t
  92. #endif
  93. #ifndef chdir
  94. #define chdir _chdir
  95. #endif
  96. #ifndef getcwd
  97. #define getcwd _getcwd
  98. #endif
  99. #ifdef _MSC_VER
  100. #ifndef CONST
  101. #define CONST64(n) n ## ui64
  102. #endif
  103. #ifndef ulong64
  104. typedef unsigned __int64 ulong64;
  105. #endif
  106. #else
  107. #ifndef CONST64
  108. #define CONST64(n) n ## ULL
  109. #endif
  110. #ifndef ulong64
  111. typedef unsigned long long ulong64;
  112. #endif
  113. #endif
  114. // Based on LibTomCrypt's cryptography library
  115. #ifndef LOAD64L
  116. #define LOAD64L(x, y) \
  117. { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48)| \
  118. (((ulong64)((y)[5] & 255))<<40)|(((ulong64)((y)[4] & 255))<<32)| \
  119. (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16)| \
  120. (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); }
  121. #define STORE64L(x, y) \
  122. { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \
  123. (y)[5] = (unsigned char)(((x)>>40)&255); (y)[4] = (unsigned char)(((x)>>32)&255); \
  124. (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \
  125. (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); }
  126. #endif
  127. #ifndef MIN
  128. #define MAX(x, y) (((x)>(y))?(x):(y))
  129. #define MIN(x, y) (((x)<(y))?(x):(y))
  130. #endif
  131. #define HAVAL_PASS 5 /* 3, 4, or 5 */
  132. #define HAVAL_FPTLEN 256 /* 128, 160, 192, 224 or 256 */
  133. #endif // ___RH_SYSTEM_CONFIG_H___