diff --git a/rcl/src/rcl/common.c b/rcl/src/rcl/common.c index 6838916..ca96599 100644 --- a/rcl/src/rcl/common.c +++ b/rcl/src/rcl/common.c @@ -23,10 +23,10 @@ extern "C" #include "rcl/allocator.h" -#if defined(WIN32) +#if defined(_WIN32) # define WINDOWS_ENV_BUFFER_SIZE 2048 static char __env_buffer[WINDOWS_ENV_BUFFER_SIZE]; -#endif // defined(WIN32) +#endif // defined(_WIN32) rcl_ret_t rcl_impl_getenv(const char * env_name, const char ** env_value) @@ -34,12 +34,12 @@ rcl_impl_getenv(const char * env_name, const char ** env_value) RCL_CHECK_ARGUMENT_FOR_NULL(env_name, RCL_RET_INVALID_ARGUMENT, rcl_get_default_allocator()); RCL_CHECK_ARGUMENT_FOR_NULL(env_value, RCL_RET_INVALID_ARGUMENT, rcl_get_default_allocator()); *env_value = NULL; -#if !defined(WIN32) +#if !defined(_WIN32) *env_value = getenv(env_name); if (*env_value == NULL) { *env_value = ""; } -#else // !defined(WIN32) +#else // !defined(_WIN32) size_t required_size; errno_t ret = getenv_s(&required_size, __env_buffer, sizeof(__env_buffer), env_name); if (ret != 0) { @@ -48,7 +48,7 @@ rcl_impl_getenv(const char * env_name, const char ** env_value) } __env_buffer[WINDOWS_ENV_BUFFER_SIZE - 1] = '\0'; *env_value = __env_buffer; -#endif // !defined(WIN32) +#endif // !defined(_WIN32) return RCL_RET_OK; } diff --git a/rcl/src/rcl/stdatomic_helper.h b/rcl/src/rcl/stdatomic_helper.h index 88c4140..88a7f7f 100644 --- a/rcl/src/rcl/stdatomic_helper.h +++ b/rcl/src/rcl/stdatomic_helper.h @@ -15,7 +15,7 @@ #ifndef RCL__STDATOMIC_HELPER_H_ #define RCL__STDATOMIC_HELPER_H_ -#if !defined(WIN32) +#if !defined(_WIN32) #if defined(__GNUC__) && __GNUC__ <= 4 && __GNUC_MINOR__ <= 9 // If GCC and below GCC-4.9, use the compatability header. @@ -38,7 +38,7 @@ #define rcl_atomic_store(object, desired) atomic_store(object, desired) -#else // !defined(WIN32) +#else // !defined(_WIN32) #include "./stdatomic_helper/win32/stdatomic.h" @@ -51,7 +51,7 @@ #define rcl_atomic_store(object, desired) rcl_win32_atomic_store(object, desired) -#endif // !defined(WIN32) +#endif // !defined(_WIN32) static inline bool rcl_atomic_load_bool(atomic_bool * a_bool) diff --git a/rcl/src/rcl/stdatomic_helper/win32/stdatomic.h b/rcl/src/rcl/stdatomic_helper/win32/stdatomic.h index 79e2fbf..77c26bb 100644 --- a/rcl/src/rcl/stdatomic_helper/win32/stdatomic.h +++ b/rcl/src/rcl/stdatomic_helper/win32/stdatomic.h @@ -56,9 +56,9 @@ * $FreeBSD: src/include/stdatomic.h,v 1.10.2.2 2012/05/30 19:21:54 theraven Exp $ */ -#if !defined(WIN32) +#if !defined(_WIN32) #error "this stdatomic.h does not support your compiler" -#endif +#endif // !defined(_WIN32) #ifndef RCL__STDATOMIC_HELPER__WIN32__STDATOMIC_H_ #define RCL__STDATOMIC_HELPER__WIN32__STDATOMIC_H_ diff --git a/rcl/test/memory_tools/memory_tools.cpp b/rcl/test/memory_tools/memory_tools.cpp index 37c7b82..5468d38 100644 --- a/rcl/test/memory_tools/memory_tools.cpp +++ b/rcl/test/memory_tools/memory_tools.cpp @@ -94,7 +94,7 @@ void stop_memory_checking() /****************************************************************************** * End Apple *****************************************************************************/ -// #elif defined(WIN32) +// #elif defined(_WIN32) /****************************************************************************** * Begin Windows *****************************************************************************/ @@ -140,4 +140,4 @@ void set_on_unexpected_free_callback(UnexpectedCallbackType callback) {} void memory_checking_thread_init() {} -#endif // if defined(__linux__) elif defined(__APPLE__) elif defined(WIN32) else ... +#endif // if defined(__linux__) elif defined(__APPLE__) elif defined(_WIN32) else ... diff --git a/rcl/test/rcl/test_node.cpp b/rcl/test/rcl/test_node.cpp index 7d17eb6..c6a2e6d 100644 --- a/rcl/test/rcl/test_node.cpp +++ b/rcl/test/rcl/test_node.cpp @@ -56,11 +56,11 @@ public: bool is_opensplice = std::string(rmw_get_implementation_identifier()).find("opensplice") != std::string::npos; -#if defined(WIN32) +#if defined(_WIN32) bool is_windows = true; #else bool is_windows = false; -#endif +#endif // defined(_WIN32) /* Tests the node accessors, i.e. rcl_node_get_* functions. */