Merge "Test for _WIN32 in instead of USE_MINGW." am: ec99158580
am: 2e7e065db9
am: 04819403d6
am: c9dc124e2f
Change-Id: I2cfb73fc12da1bb6396bfdd8f638b9ce977f84bc
This commit is contained in:
commit
c2b3b5fade
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef USE_MINGW
|
||||
#ifdef _WIN32
|
||||
// MINGW does not define these constants.
|
||||
#define PROT_NONE 0
|
||||
#define PROT_READ 0x1
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "sparse_crc32.h"
|
||||
#include "sparse_format.h"
|
||||
|
||||
#ifndef USE_MINGW
|
||||
#ifndef _WIN32
|
||||
#include <sys/mman.h>
|
||||
#define O_BINARY 0
|
||||
#else
|
||||
|
@ -705,7 +705,7 @@ int write_fd_chunk(struct output_file *out, unsigned int len,
|
|||
aligned_diff = offset - aligned_offset;
|
||||
buffer_size = len + aligned_diff;
|
||||
|
||||
#ifndef USE_MINGW
|
||||
#ifndef _WIN32
|
||||
char *data = mmap64(NULL, buffer_size, PROT_READ, MAP_SHARED, fd,
|
||||
aligned_offset);
|
||||
if (data == MAP_FAILED) {
|
||||
|
@ -733,7 +733,7 @@ int write_fd_chunk(struct output_file *out, unsigned int len,
|
|||
|
||||
ret = out->sparse_ops->write_data_chunk(out, len, ptr);
|
||||
|
||||
#ifndef USE_MINGW
|
||||
#ifndef _WIN32
|
||||
munmap(data, buffer_size);
|
||||
#else
|
||||
free(data);
|
||||
|
|
|
@ -79,7 +79,7 @@ static void verbose_error(bool verbose, int err, const char *fmt, ...)
|
|||
s = " at ";
|
||||
}
|
||||
if (verbose) {
|
||||
#ifndef USE_MINGW
|
||||
#ifndef _WIN32
|
||||
if (err == -EOVERFLOW) {
|
||||
sparse_print_verbose("EOF while reading file%s%s\n", s, at);
|
||||
} else
|
||||
|
|
|
@ -44,7 +44,7 @@ void Printer::printFormatLine(const char* format, ...) {
|
|||
|
||||
char* formattedString;
|
||||
|
||||
#ifndef USE_MINGW
|
||||
#ifndef _WIN32
|
||||
if (vasprintf(&formattedString, format, arglist) < 0) { // returns -1 on error
|
||||
ALOGE("%s: Failed to format string", __FUNCTION__);
|
||||
return;
|
||||
|
@ -115,7 +115,7 @@ void FdPrinter::printLine(const char* string) {
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef USE_MINGW
|
||||
#ifndef _WIN32
|
||||
dprintf(mFd, mFormatString, mPrefix, string);
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue