From 500364b01f8269a014995b40f5c9f2a3d9fa1aa2 Mon Sep 17 00:00:00 2001 From: uhm0311 Date: Thu, 22 Aug 2024 12:42:51 +0900 Subject: [PATCH] FIX: Use `__linux__` instead of `TARGET_OS_LINUX` to check if the current OS is Linux. --- libmemcached/connect.cc | 2 +- libmemcached/io.cc | 8 ++++---- libmemcached/memcached.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libmemcached/connect.cc b/libmemcached/connect.cc index 3a08661e..e2406f70 100644 --- a/libmemcached/connect.cc +++ b/libmemcached/connect.cc @@ -82,7 +82,7 @@ static memcached_return_t connect_poll(memcached_server_st *server) default: // A real error occurred and we need to completely bail switch (get_socket_errno()) { -#ifdef TARGET_OS_LINUX +#ifdef __linux__ case ERESTART: #endif case EINTR: diff --git a/libmemcached/io.cc b/libmemcached/io.cc index 5da059d4..01687d23 100644 --- a/libmemcached/io.cc +++ b/libmemcached/io.cc @@ -125,7 +125,7 @@ static bool repack_input_buffer(memcached_server_write_instance_st ptr) #ifdef USE_EAGAIN case EAGAIN: #endif -#ifdef TARGET_OS_LINUX +#ifdef __linux__ case ERESTART: #endif break; // No IO is fine, we can just move on @@ -266,7 +266,7 @@ static memcached_return_t io_wait(memcached_server_write_instance_st ptr, WATCHPOINT_ERRNO(get_socket_errno()); switch (get_socket_errno()) { -#ifdef TARGET_OS_LINUX +#ifdef __linux__ case ERESTART: #endif case EINTR: @@ -476,7 +476,7 @@ static memcached_return_t _io_fill(memcached_server_write_instance_st ptr) #ifdef USE_EAGAIN case EAGAIN: #endif -#ifdef TARGET_OS_LINUX +#ifdef __linux__ case ERESTART: #endif if (memcached_success(io_wait(ptr, MEM_READ))) @@ -603,7 +603,7 @@ memcached_return_t memcached_io_slurp(memcached_server_write_instance_st ptr) #ifdef USE_EAGAIN case EAGAIN: #endif -#ifdef TARGET_OS_LINUX +#ifdef __linux__ case ERESTART: #endif if (memcached_success(io_wait(ptr, MEM_READ))) diff --git a/libmemcached/memcached.h b/libmemcached/memcached.h index 7a5ae5fb..1b86d821 100644 --- a/libmemcached/memcached.h +++ b/libmemcached/memcached.h @@ -105,7 +105,7 @@ #include #include #ifdef LIBMEMCACHED_WITH_ZK_INTEGRATION -#ifdef TARGET_OS_LINUX +#ifdef __linux__ #include #endif #ifndef PATH_MAX