]>
Commit | Line | Data |
---|---|---|
2cb9734b JR |
1 | > The header stores only 4 bytes for crc, so it is quite reasonable. |
2 | ||
3 | Then I would suggest something like this, though it could be made more | |
4 | efficient. | |
5 | ||
6 | --- orig/configure.ac | |
7 | +++ mod/configure.ac | |
8 | @@ -51,6 +51,9 @@ | |
9 | AC_CHECK_TYPE(gid_t, int) | |
10 | AC_HEADER_STDC | |
11 | AC_HEADER_DIRENT | |
12 | +AC_CHECK_TYPES(uint32_t) | |
13 | +AC_CHECK_SIZEOF(unsigned long) | |
14 | +AC_CHECK_SIZEOF(unsigned int) | |
15 | ||
16 | AC_CHECK_FUNCS([fchmod fchown]) | |
17 | # This is needed for mingw build | |
18 | --- orig/src/extern.h | |
19 | +++ mod/src/extern.h | |
20 | @@ -66,7 +66,17 @@ | |
21 | extern int archive_des; | |
22 | extern char *archive_name; | |
23 | extern char *rsh_command_option; | |
24 | +#ifdef HAVE_UINT32_T | |
25 | +extern uint32_t crc; | |
26 | +#else | |
27 | +# if SIZEOF_UNSIGNED_LONG == 4 | |
28 | extern unsigned long crc; | |
29 | +# elif SIZEOF_UNSIGNED_INT == 4 | |
30 | +extern unsigned int crc; | |
31 | +# else | |
32 | +# error Wrong size for crc | |
33 | +# endif | |
34 | +#endif | |
35 | extern int delayed_seek_count; | |
36 | #ifdef DEBUG_CPIO | |
37 | extern int debug_flag; | |
38 | ||
39 | ||
40 | --- orig/src/global.c | |
41 | +++ mod/src/global.c | |
42 | @@ -139,7 +139,17 @@ | |
43 | char *rsh_command_option = NULL; | |
44 | ||
45 | /* CRC checksum. */ | |
46 | +#ifdef HAVE_UINT32_T | |
47 | +uint32_t crc; | |
48 | +#else | |
49 | +# if SIZEOF_UNSIGNED_LONG == 4 | |
50 | unsigned long crc; | |
51 | +# elif SIZEOF_UNSIGNED_INT == 4 | |
52 | +unsigned int crc; | |
53 | +# else | |
54 | +# error Wrong size for crc | |
55 | +# endif | |
56 | +#endif | |
57 | ||
58 | /* Input and output buffers. */ | |
59 | char *input_buffer, *output_buffer; | |
60 | ||
61 | ||
62 | ||
63 | ||
64 |