* Note: int64 may actually be a 32-bit type if ./configure couldn't find any * 64-bit types on this platform. */
| 2220 | * 64-bit types on this platform. |
| 2221 | */ |
| 2222 | void write_longint(int f, int64 x) |
| 2223 | { |
| 2224 | char b[12], * const s = b+4; |
| 2225 | |
| 2226 | SIVAL(s, 0, x); |
| 2227 | if (x <= 0x7FFFFFFF && x >= 0) { |
| 2228 | write_buf(f, s, 4); |
| 2229 | return; |
| 2230 | } |
| 2231 | |
| 2232 | #if SIZEOF_INT64 < 8 |
| 2233 | rprintf(FERROR, "Integer overflow: attempted 64-bit offset\n"); |
| 2234 | exit_cleanup(RERR_UNSUPPORTED); |
| 2235 | #else |
| 2236 | memset(b, 0xFF, 4); |
| 2237 | SIVAL(s, 4, x >> 32); |
| 2238 | write_buf(f, b, 12); |
| 2239 | #endif |
| 2240 | } |
| 2241 | |
| 2242 | void write_bigbuf(int f, const char *buf, size_t len) |
| 2243 | { |
no test coverage detected