Advertisement
Guest User

cygwin_sasquatch_43.patch

a guest
Oct 17th, 2018
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 17.41 KB | None | 0 0
  1. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/action.c squashfs-tools/action.c
  2. --- squashfs-tools_orig/action.c        2014-05-10 07:54:13.000000000 +0300
  3. +++ squashfs-tools/action.c     2018-10-17 10:51:26.335387000 +0300
  4. @@ -44,6 +44,10 @@
  5.  #include "action.h"
  6.  #include "error.h"
  7.  
  8. +#if !defined(FNM_EXTMATCH)
  9. +#define FNM_EXTMATCH 0
  10. +#endif
  11. +
  12.  /*
  13.   * code to parse actions
  14.   */
  15. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/gzip_wrapper.h squashfs-tools/gzip_wrapper.h
  16. --- squashfs-tools_orig/gzip_wrapper.h  2014-05-12 02:29:29.000000000 +0300
  17. +++ squashfs-tools/gzip_wrapper.h       2018-10-17 12:32:51.583269500 +0300
  18. @@ -25,9 +25,11 @@
  19.   */
  20.  
  21.  #ifndef linux
  22. +#ifndef __CYGWIN__
  23.  #define __BYTE_ORDER BYTE_ORDER
  24.  #define __BIG_ENDIAN BIG_ENDIAN
  25.  #define __LITTLE_ENDIAN LITTLE_ENDIAN
  26. +#endif /* __CYGWIN__ */
  27.  #else
  28.  #include <endian.h>
  29.  #endif
  30. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMA.h squashfs-tools/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMA.h
  31. --- squashfs-tools_orig/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMA.h    2018-10-17 00:38:45.742271100 +0300
  32. +++ squashfs-tools/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMA.h 1970-01-01 03:00:00.000000000 +0300
  33. @@ -1,82 +0,0 @@
  34. -// LZMA.h
  35. -
  36. -#ifndef __LZMA_H
  37. -#define __LZMA_H
  38. -
  39. -namespace NCompress {
  40. -namespace NLZMA {
  41. -
  42. -const UInt32 kNumRepDistances = 4;
  43. -
  44. -const int kNumStates = 12;
  45. -
  46. -const Byte kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4,  5,  6,   4, 5};
  47. -const Byte kMatchNextStates[kNumStates]   = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
  48. -const Byte kRepNextStates[kNumStates]     = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
  49. -const Byte kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
  50. -
  51. -class CState
  52. -{
  53. -public:
  54. -  Byte Index;
  55. -  void Init() { Index = 0; }
  56. -  void UpdateChar() { Index = kLiteralNextStates[Index]; }
  57. -  void UpdateMatch() { Index = kMatchNextStates[Index]; }
  58. -  void UpdateRep() { Index = kRepNextStates[Index]; }
  59. -  void UpdateShortRep() { Index = kShortRepNextStates[Index]; }
  60. -  bool IsCharState() const { return Index < 7; }
  61. -};
  62. -
  63. -const int kNumPosSlotBits = 6;
  64. -const int kDicLogSizeMin = 0;
  65. -const int kDicLogSizeMax = 32;
  66. -const int kDistTableSizeMax = kDicLogSizeMax * 2;
  67. -
  68. -const UInt32 kNumLenToPosStates = 4;
  69. -
  70. -inline UInt32 GetLenToPosState(UInt32 len)
  71. -{
  72. -  len -= 2;
  73. -  if (len < kNumLenToPosStates)
  74. -    return len;
  75. -  return kNumLenToPosStates - 1;
  76. -}
  77. -
  78. -namespace NLength {
  79. -
  80. -const int kNumPosStatesBitsMax = 4;
  81. -const UInt32 kNumPosStatesMax = (1 << kNumPosStatesBitsMax);
  82. -
  83. -const int kNumPosStatesBitsEncodingMax = 4;
  84. -const UInt32 kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax);
  85. -
  86. -const int kNumLowBits = 3;
  87. -const int kNumMidBits = 3;
  88. -const int kNumHighBits = 8;
  89. -const UInt32 kNumLowSymbols = 1 << kNumLowBits;
  90. -const UInt32 kNumMidSymbols = 1 << kNumMidBits;
  91. -const UInt32 kNumSymbolsTotal = kNumLowSymbols + kNumMidSymbols + (1 << kNumHighBits);
  92. -
  93. -}
  94. -
  95. -const UInt32 kMatchMinLen = 2;
  96. -const UInt32 kMatchMaxLen = kMatchMinLen + NLength::kNumSymbolsTotal - 1;
  97. -
  98. -const int kNumAlignBits = 4;
  99. -const UInt32 kAlignTableSize = 1 << kNumAlignBits;
  100. -const UInt32 kAlignMask = (kAlignTableSize - 1);
  101. -
  102. -const UInt32 kStartPosModelIndex = 4;
  103. -const UInt32 kEndPosModelIndex = 14;
  104. -const UInt32 kNumPosModels = kEndPosModelIndex - kStartPosModelIndex;
  105. -
  106. -const UInt32 kNumFullDistances = 1 << (kEndPosModelIndex / 2);
  107. -
  108. -const int kNumLitPosStatesBitsEncodingMax = 4;
  109. -const int kNumLitContextBitsMax = 8;
  110. -
  111. -const int kNumMoveBits = 5;
  112. -
  113. -}}
  114. -
  115. -#endif
  116. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMA2.h squashfs-tools/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMA2.h
  117. --- squashfs-tools_orig/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMA2.h   1970-01-01 03:00:00.000000000 +0300
  118. +++ squashfs-tools/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMA2.h        2018-10-17 00:38:45.742271100 +0300
  119. @@ -0,0 +1,82 @@
  120. +// LZMA.h
  121. +
  122. +#ifndef __LZMA_H
  123. +#define __LZMA_H
  124. +
  125. +namespace NCompress {
  126. +namespace NLZMA {
  127. +
  128. +const UInt32 kNumRepDistances = 4;
  129. +
  130. +const int kNumStates = 12;
  131. +
  132. +const Byte kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4,  5,  6,   4, 5};
  133. +const Byte kMatchNextStates[kNumStates]   = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
  134. +const Byte kRepNextStates[kNumStates]     = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
  135. +const Byte kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
  136. +
  137. +class CState
  138. +{
  139. +public:
  140. +  Byte Index;
  141. +  void Init() { Index = 0; }
  142. +  void UpdateChar() { Index = kLiteralNextStates[Index]; }
  143. +  void UpdateMatch() { Index = kMatchNextStates[Index]; }
  144. +  void UpdateRep() { Index = kRepNextStates[Index]; }
  145. +  void UpdateShortRep() { Index = kShortRepNextStates[Index]; }
  146. +  bool IsCharState() const { return Index < 7; }
  147. +};
  148. +
  149. +const int kNumPosSlotBits = 6;
  150. +const int kDicLogSizeMin = 0;
  151. +const int kDicLogSizeMax = 32;
  152. +const int kDistTableSizeMax = kDicLogSizeMax * 2;
  153. +
  154. +const UInt32 kNumLenToPosStates = 4;
  155. +
  156. +inline UInt32 GetLenToPosState(UInt32 len)
  157. +{
  158. +  len -= 2;
  159. +  if (len < kNumLenToPosStates)
  160. +    return len;
  161. +  return kNumLenToPosStates - 1;
  162. +}
  163. +
  164. +namespace NLength {
  165. +
  166. +const int kNumPosStatesBitsMax = 4;
  167. +const UInt32 kNumPosStatesMax = (1 << kNumPosStatesBitsMax);
  168. +
  169. +const int kNumPosStatesBitsEncodingMax = 4;
  170. +const UInt32 kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax);
  171. +
  172. +const int kNumLowBits = 3;
  173. +const int kNumMidBits = 3;
  174. +const int kNumHighBits = 8;
  175. +const UInt32 kNumLowSymbols = 1 << kNumLowBits;
  176. +const UInt32 kNumMidSymbols = 1 << kNumMidBits;
  177. +const UInt32 kNumSymbolsTotal = kNumLowSymbols + kNumMidSymbols + (1 << kNumHighBits);
  178. +
  179. +}
  180. +
  181. +const UInt32 kMatchMinLen = 2;
  182. +const UInt32 kMatchMaxLen = kMatchMinLen + NLength::kNumSymbolsTotal - 1;
  183. +
  184. +const int kNumAlignBits = 4;
  185. +const UInt32 kAlignTableSize = 1 << kNumAlignBits;
  186. +const UInt32 kAlignMask = (kAlignTableSize - 1);
  187. +
  188. +const UInt32 kStartPosModelIndex = 4;
  189. +const UInt32 kEndPosModelIndex = 14;
  190. +const UInt32 kNumPosModels = kEndPosModelIndex - kStartPosModelIndex;
  191. +
  192. +const UInt32 kNumFullDistances = 1 << (kEndPosModelIndex / 2);
  193. +
  194. +const int kNumLitPosStatesBitsEncodingMax = 4;
  195. +const int kNumLitContextBitsMax = 8;
  196. +
  197. +const int kNumMoveBits = 5;
  198. +
  199. +}}
  200. +
  201. +#endif
  202. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMADecoder.h squashfs-tools/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMADecoder.h
  203. --- squashfs-tools_orig/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMADecoder.h     2018-10-17 00:38:45.726645700 +0300
  204. +++ squashfs-tools/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMADecoder.h  2018-10-17 13:03:27.348797000 +0300
  205. @@ -9,7 +9,7 @@
  206.  #include "../LZ/LZOutWindow.h"
  207.  #include "../RangeCoder/RangeCoderBitTree.h"
  208.  
  209. -#include "LZMA.h"
  210. +#include "LZMA2.h"
  211.  
  212.  namespace NCompress {
  213.  namespace NLZMA {
  214. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMAEncoder.h squashfs-tools/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMAEncoder.h
  215. --- squashfs-tools_orig/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMAEncoder.h     2018-10-17 00:38:45.742271100 +0300
  216. +++ squashfs-tools/LZMA/lzmadaptive/C/7zip/Compress/LZMA/LZMAEncoder.h  2018-10-17 13:06:41.369858100 +0300
  217. @@ -9,7 +9,7 @@
  218.  #include "../LZ/IMatchFinder.h"
  219.  #include "../RangeCoder/RangeCoderBitTree.h"
  220.  
  221. -#include "LZMA.h"
  222. +#include "LZMA2.h"
  223.  
  224.  namespace NCompress {
  225.  namespace NLZMA {
  226. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/LZMA/lzmalt/LZMA.h squashfs-tools/LZMA/lzmalt/LZMA.h
  227. --- squashfs-tools_orig/LZMA/lzmalt/LZMA.h      2018-10-17 00:38:46.023523600 +0300
  228. +++ squashfs-tools/LZMA/lzmalt/LZMA.h   1970-01-01 03:00:00.000000000 +0300
  229. @@ -1,83 +0,0 @@
  230. -#include "LenCoder.h"
  231. -
  232. -#ifndef __LZMA_H
  233. -#define __LZMA_H
  234. -
  235. -
  236. -#define kNumRepDistances 4
  237. -
  238. -#define kNumStates 12
  239. -
  240. -static const BYTE kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4,  5,  6,   4, 5};
  241. -static const BYTE kMatchNextStates[kNumStates]   = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
  242. -static const BYTE kRepNextStates[kNumStates]     = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
  243. -static const BYTE kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
  244. -
  245. -typedef BYTE CState;
  246. -
  247. -INLINE void CStateInit(CState *m_Index)
  248. -    { *m_Index = 0; }
  249. -INLINE void CStateUpdateChar(CState *m_Index)
  250. -    { *m_Index = kLiteralNextStates[*m_Index]; }
  251. -INLINE void CStateUpdateMatch(CState *m_Index)
  252. -    { *m_Index = kMatchNextStates[*m_Index]; }
  253. -INLINE void CStateUpdateRep(CState *m_Index)
  254. -    { *m_Index = kRepNextStates[*m_Index]; }
  255. -INLINE void CStateUpdateShortRep(CState *m_Index)
  256. -    { *m_Index = kShortRepNextStates[*m_Index]; }
  257. -
  258. -
  259. -#define kNumPosSlotBits 6
  260. -#define kDicLogSizeMax 28
  261. -#define kDistTableSizeMax 56
  262. -
  263. -//extern UINT32 kDistStart[kDistTableSizeMax];
  264. -static const BYTE kDistDirectBits[kDistTableSizeMax] =
  265. -{
  266. -  0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
  267. -  10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19,
  268. -  20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26
  269. -};
  270. -
  271. -#define kNumLenToPosStates 4
  272. -INLINE UINT32 GetLenToPosState(UINT32 aLen)
  273. -{
  274. -  aLen -= 2;
  275. -  if (aLen < kNumLenToPosStates)
  276. -    return aLen;
  277. -  return kNumLenToPosStates - 1;
  278. -}
  279. -
  280. -#define kMatchMinLen 2
  281. -
  282. -#define kMatchMaxLen (kMatchMinLen + kNumSymbolsTotal - 1)
  283. -
  284. -#define kNumAlignBits 4
  285. -#define kAlignTableSize 16
  286. -#define kAlignMask 15
  287. -
  288. -#define kStartPosModelIndex 4
  289. -#define kEndPosModelIndex 14
  290. -#define kNumPosModels 10
  291. -
  292. -#define kNumFullDistances (1 << (kEndPosModelIndex / 2))
  293. -
  294. -
  295. -#define kMainChoiceLiteralIndex 0
  296. -#define kMainChoiceMatchIndex 1
  297. -
  298. -#define kMatchChoiceDistanceIndex0
  299. -#define kMatchChoiceRepetitionIndex 1
  300. -
  301. -#define kNumMoveBitsForMainChoice 5
  302. -#define kNumMoveBitsForPosCoders 5
  303. -
  304. -#define kNumMoveBitsForAlignCoders 5
  305. -
  306. -#define kNumMoveBitsForPosSlotCoder 5
  307. -
  308. -#define kNumLitPosStatesBitsEncodingMax 4
  309. -#define kNumLitContextBitsMax 8
  310. -
  311. -
  312. -#endif
  313. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/LZMA/lzmalt/LZMA3.h squashfs-tools/LZMA/lzmalt/LZMA3.h
  314. --- squashfs-tools_orig/LZMA/lzmalt/LZMA3.h     1970-01-01 03:00:00.000000000 +0300
  315. +++ squashfs-tools/LZMA/lzmalt/LZMA3.h  2018-10-17 00:38:46.023523600 +0300
  316. @@ -0,0 +1,83 @@
  317. +#include "LenCoder.h"
  318. +
  319. +#ifndef __LZMA_H
  320. +#define __LZMA_H
  321. +
  322. +
  323. +#define kNumRepDistances 4
  324. +
  325. +#define kNumStates 12
  326. +
  327. +static const BYTE kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4,  5,  6,   4, 5};
  328. +static const BYTE kMatchNextStates[kNumStates]   = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
  329. +static const BYTE kRepNextStates[kNumStates]     = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
  330. +static const BYTE kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
  331. +
  332. +typedef BYTE CState;
  333. +
  334. +INLINE void CStateInit(CState *m_Index)
  335. +    { *m_Index = 0; }
  336. +INLINE void CStateUpdateChar(CState *m_Index)
  337. +    { *m_Index = kLiteralNextStates[*m_Index]; }
  338. +INLINE void CStateUpdateMatch(CState *m_Index)
  339. +    { *m_Index = kMatchNextStates[*m_Index]; }
  340. +INLINE void CStateUpdateRep(CState *m_Index)
  341. +    { *m_Index = kRepNextStates[*m_Index]; }
  342. +INLINE void CStateUpdateShortRep(CState *m_Index)
  343. +    { *m_Index = kShortRepNextStates[*m_Index]; }
  344. +
  345. +
  346. +#define kNumPosSlotBits 6
  347. +#define kDicLogSizeMax 28
  348. +#define kDistTableSizeMax 56
  349. +
  350. +//extern UINT32 kDistStart[kDistTableSizeMax];
  351. +static const BYTE kDistDirectBits[kDistTableSizeMax] =
  352. +{
  353. +  0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
  354. +  10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19,
  355. +  20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26
  356. +};
  357. +
  358. +#define kNumLenToPosStates 4
  359. +INLINE UINT32 GetLenToPosState(UINT32 aLen)
  360. +{
  361. +  aLen -= 2;
  362. +  if (aLen < kNumLenToPosStates)
  363. +    return aLen;
  364. +  return kNumLenToPosStates - 1;
  365. +}
  366. +
  367. +#define kMatchMinLen 2
  368. +
  369. +#define kMatchMaxLen (kMatchMinLen + kNumSymbolsTotal - 1)
  370. +
  371. +#define kNumAlignBits 4
  372. +#define kAlignTableSize 16
  373. +#define kAlignMask 15
  374. +
  375. +#define kStartPosModelIndex 4
  376. +#define kEndPosModelIndex 14
  377. +#define kNumPosModels 10
  378. +
  379. +#define kNumFullDistances (1 << (kEndPosModelIndex / 2))
  380. +
  381. +
  382. +#define kMainChoiceLiteralIndex 0
  383. +#define kMainChoiceMatchIndex 1
  384. +
  385. +#define kMatchChoiceDistanceIndex0
  386. +#define kMatchChoiceRepetitionIndex 1
  387. +
  388. +#define kNumMoveBitsForMainChoice 5
  389. +#define kNumMoveBitsForPosCoders 5
  390. +
  391. +#define kNumMoveBitsForAlignCoders 5
  392. +
  393. +#define kNumMoveBitsForPosSlotCoder 5
  394. +
  395. +#define kNumLitPosStatesBitsEncodingMax 4
  396. +#define kNumLitContextBitsMax 8
  397. +
  398. +
  399. +#endif
  400. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/LZMA/lzmalt/LZMADecoder.h squashfs-tools/LZMA/lzmalt/LZMADecoder.h
  401. --- squashfs-tools_orig/LZMA/lzmalt/LZMADecoder.h       2018-10-17 00:38:46.023523600 +0300
  402. +++ squashfs-tools/LZMA/lzmalt/LZMADecoder.h    2018-10-17 13:28:51.232233900 +0300
  403. @@ -2,7 +2,7 @@
  404.  #define __LZARITHMETIC_DECODER_H
  405.  
  406.  #include "WindowOut.h"
  407. -#include "LZMA.h"
  408. +#include "LZMA3.h"
  409.  #include "LenCoder.h"
  410.  #include "LiteralCoder.h"
  411.  
  412. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/lzo_wrapper.h squashfs-tools/lzo_wrapper.h
  413. --- squashfs-tools_orig/lzo_wrapper.h   2014-03-09 07:31:59.000000000 +0200
  414. +++ squashfs-tools/lzo_wrapper.h        2018-10-17 13:32:10.832476800 +0300
  415. @@ -25,9 +25,11 @@
  416.   */
  417.  
  418.  #ifndef linux
  419. +#ifndef __CYGWIN__
  420.  #define __BYTE_ORDER BYTE_ORDER
  421.  #define __BIG_ENDIAN BIG_ENDIAN
  422.  #define __LITTLE_ENDIAN LITTLE_ENDIAN
  423. +#endif /* __CYGWIN__ */
  424.  #else
  425.  #include <endian.h>
  426.  #endif
  427. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/mksquashfs.c squashfs-tools/mksquashfs.c
  428. --- squashfs-tools_orig/mksquashfs.c    2014-05-13 01:18:20.000000000 +0300
  429. +++ squashfs-tools/mksquashfs.c 2018-10-17 10:51:05.882087200 +0300
  430. @@ -1286,6 +1286,10 @@
  431.                 dir_size + 3, directory_block, directory_offset, NULL, NULL,
  432.                 dir, 0);
  433.  
  434. +#if !defined(FNM_EXTMATCH)
  435. +#define FNM_EXTMATCH 0
  436. +#endif
  437. +
  438.  #ifdef SQUASHFS_TRACE
  439.         {
  440.                 unsigned char *dirp;
  441. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/pseudo.c squashfs-tools/pseudo.c
  442. --- squashfs-tools_orig/pseudo.c        2014-05-10 07:54:13.000000000 +0300
  443. +++ squashfs-tools/pseudo.c     2018-10-17 10:57:11.257757200 +0300
  444. @@ -32,6 +32,7 @@
  445.  #include <stdlib.h>
  446.  #include <sys/types.h>
  447.  #include <sys/wait.h>
  448. +#include <sys/stat.h>
  449.  #include <ctype.h>
  450.  
  451.  #include "pseudo.h"
  452. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/read_xattrs.c squashfs-tools/read_xattrs.c
  453. --- squashfs-tools_orig/read_xattrs.c   2014-03-09 07:31:59.000000000 +0200
  454. +++ squashfs-tools/read_xattrs.c        2018-10-17 13:33:35.709560100 +0300
  455. @@ -32,9 +32,11 @@
  456.  #include <string.h>
  457.  
  458.  #ifndef linux
  459. +#ifndef __CYGWIN__
  460.  #define __BYTE_ORDER BYTE_ORDER
  461.  #define __BIG_ENDIAN BIG_ENDIAN
  462.  #define __LITTLE_ENDIAN LITTLE_ENDIAN
  463. +#endif /* __CYGWIN__ */
  464.  #else
  465.  #include <endian.h>
  466.  #endif
  467. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/unsquashfs.c squashfs-tools/unsquashfs.c
  468. --- squashfs-tools_orig/unsquashfs.c    2018-10-17 00:38:46.054773600 +0300
  469. +++ squashfs-tools/unsquashfs.c 2018-10-17 12:30:50.052420800 +0300
  470. @@ -39,6 +39,21 @@
  471.  #include <limits.h>
  472.  #include <ctype.h>
  473.  
  474. +
  475. +#include <stddef.h>
  476. +#ifdef HAVE_SYS_SYSCTL_H
  477. +    #include <sys/sysctl.h>
  478. +#endif
  479. +
  480. +#ifdef _WIN32
  481. +       #define WIN32_LEAN_AND_MEAN
  482. +       #include <Windows.h>
  483. +       //#include <sys/types.h>
  484. +       //#include <sys/sysctl.h>
  485. +#endif
  486. +
  487. +
  488. +
  489.  struct cache *fragment_cache, *data_cache;
  490.  struct queue *to_reader, *to_inflate, *to_writer, *from_writer;
  491.  pthread_t *thread, *inflator_thread;
  492. @@ -1422,6 +1437,9 @@
  493.         free(paths);
  494.  }
  495.  
  496. +#if !defined(FNM_EXTMATCH)
  497. +#define FNM_EXTMATCH 0
  498. +#endif
  499.  
  500.  int matches(struct pathnames *paths, char *name, struct pathnames **new)
  501.  {
  502. @@ -2291,6 +2309,9 @@
  503.                 EXIT_UNSQUASH("Failed to set signal mask in initialise_threads"
  504.                         "\n");
  505.  
  506. +#ifdef __CYGWIN__
  507. +       processors = atoi(getenv("NUMBER_OF_PROCESSORS"));
  508. +#else /* __CYGWIN__ */
  509.         if(processors == -1) {
  510.  #ifndef linux
  511.                 int mib[2];
  512. @@ -2312,6 +2333,7 @@
  513.                 processors = sysconf(_SC_NPROCESSORS_ONLN);
  514.  #endif
  515.         }
  516. +#endif /* __CYGWIN__ */
  517.  
  518.         if(add_overflow(processors, 3) ||
  519.                         multiply_overflow(processors + 3, sizeof(pthread_t)))
  520. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/unsquashfs.h squashfs-tools/unsquashfs.h
  521. --- squashfs-tools_orig/unsquashfs.h    2014-05-10 07:54:13.000000000 +0300
  522. +++ squashfs-tools/unsquashfs.h 2018-10-17 12:23:44.588451800 +0300
  523. @@ -48,9 +48,11 @@
  524.  #include <sys/time.h>
  525.  
  526.  #ifndef linux
  527. +#ifndef __CYGWIN__
  528.  #define __BYTE_ORDER BYTE_ORDER
  529.  #define __BIG_ENDIAN BIG_ENDIAN
  530.  #define __LITTLE_ENDIAN LITTLE_ENDIAN
  531. +#endif /* __CYGWIN__ */
  532.  #else
  533.  #include <endian.h>
  534.  #endif
  535. diff --strip-trailing-cr -NBbaur squashfs-tools_orig/xz_wrapper.h squashfs-tools/xz_wrapper.h
  536. --- squashfs-tools_orig/xz_wrapper.h    2014-03-09 07:31:59.000000000 +0200
  537. +++ squashfs-tools/xz_wrapper.h 2018-10-17 12:35:15.323374400 +0300
  538. @@ -25,9 +25,11 @@
  539.   */
  540.  
  541.  #ifndef linux
  542. +#ifndef __CYGWIN__
  543.  #define __BYTE_ORDER BYTE_ORDER
  544.  #define __BIG_ENDIAN BIG_ENDIAN
  545.  #define __LITTLE_ENDIAN LITTLE_ENDIAN
  546. +#endif /* __CYGWIN__ */
  547.  #else
  548.  #include <endian.h>
  549.  #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement