You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/09/11 16:00:47 UTC

[arrow] branch master updated: ARROW-3219: [C++] Use Win32 API in MinGW build

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new c898ba0  ARROW-3219: [C++] Use Win32 API in MinGW build
c898ba0 is described below

commit c898ba019be16827f45d769ec99e4e0bcee75dc5
Author: Kouhei Sutou <ko...@clear-code.com>
AuthorDate: Tue Sep 11 12:00:42 2018 -0400

    ARROW-3219: [C++] Use Win32 API in MinGW build
    
    Author: Kouhei Sutou <ko...@clear-code.com>
    
    Closes #2544 from kou/cpp-use-win32-api-with-mingw and squashes the following commits:
    
    1be8137ea <Kouhei Sutou>  Use Win32 API in MinGW build
---
 cpp/src/arrow/memory_pool.cc  | 4 ++--
 cpp/src/arrow/util/io-util.cc | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc
index 2f71c5d..6d93db1 100644
--- a/cpp/src/arrow/memory_pool.cc
+++ b/cpp/src/arrow/memory_pool.cc
@@ -45,8 +45,8 @@ namespace {
 // (as of May 2016 64 bytes)
 Status AllocateAligned(int64_t size, uint8_t** out) {
 // TODO(emkornfield) find something compatible with windows
-#ifdef _MSC_VER
-  // Special code path for MSVC
+#ifdef _WIN32
+  // Special code path for Windows
   *out =
       reinterpret_cast<uint8_t*>(_aligned_malloc(static_cast<size_t>(size), kAlignment));
   if (!*out) {
diff --git a/cpp/src/arrow/util/io-util.cc b/cpp/src/arrow/util/io-util.cc
index 8e578e4..3ece551 100644
--- a/cpp/src/arrow/util/io-util.cc
+++ b/cpp/src/arrow/util/io-util.cc
@@ -222,7 +222,7 @@ Status FileTell(int fd, int64_t* pos) {
 
 Status CreatePipe(int fd[2]) {
   int ret;
-#if defined(_MSC_VER)
+#if defined(_WIN32)
   ret = _pipe(fd, 4096, _O_BINARY);
 #else
   ret = pipe(fd);
@@ -379,7 +379,7 @@ Status FileGetSize(int fd, int64_t* size) {
 //
 
 static inline int64_t pread_compat(int fd, void* buf, int64_t nbytes, int64_t pos) {
-#if defined(_MSC_VER)
+#if defined(_WIN32)
   HANDLE handle = reinterpret_cast<HANDLE>(_get_osfhandle(fd));
   DWORD dwBytesRead = 0;
   OVERLAPPED overlapped = {0};
@@ -496,7 +496,7 @@ Status FileWrite(int fd, const uint8_t* buffer, const int64_t nbytes) {
 Status FileTruncate(int fd, const int64_t size) {
   int ret, errno_actual;
 
-#ifdef _MSC_VER
+#ifdef _WIN32
   errno_actual = _chsize_s(fd, static_cast<size_t>(size));
   ret = errno_actual == 0 ? 0 : -1;
 #else