Use _WIN32 everywhere (#151)
This commit is contained in:
parent
af03d0c44d
commit
2d961fb501
5 changed files with 14 additions and 14 deletions
|
@ -23,10 +23,10 @@ extern "C"
|
||||||
|
|
||||||
#include "rcl/allocator.h"
|
#include "rcl/allocator.h"
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(_WIN32)
|
||||||
# define WINDOWS_ENV_BUFFER_SIZE 2048
|
# define WINDOWS_ENV_BUFFER_SIZE 2048
|
||||||
static char __env_buffer[WINDOWS_ENV_BUFFER_SIZE];
|
static char __env_buffer[WINDOWS_ENV_BUFFER_SIZE];
|
||||||
#endif // defined(WIN32)
|
#endif // defined(_WIN32)
|
||||||
|
|
||||||
rcl_ret_t
|
rcl_ret_t
|
||||||
rcl_impl_getenv(const char * env_name, const char ** env_value)
|
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_name, RCL_RET_INVALID_ARGUMENT, rcl_get_default_allocator());
|
||||||
RCL_CHECK_ARGUMENT_FOR_NULL(env_value, 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;
|
*env_value = NULL;
|
||||||
#if !defined(WIN32)
|
#if !defined(_WIN32)
|
||||||
*env_value = getenv(env_name);
|
*env_value = getenv(env_name);
|
||||||
if (*env_value == NULL) {
|
if (*env_value == NULL) {
|
||||||
*env_value = "";
|
*env_value = "";
|
||||||
}
|
}
|
||||||
#else // !defined(WIN32)
|
#else // !defined(_WIN32)
|
||||||
size_t required_size;
|
size_t required_size;
|
||||||
errno_t ret = getenv_s(&required_size, __env_buffer, sizeof(__env_buffer), env_name);
|
errno_t ret = getenv_s(&required_size, __env_buffer, sizeof(__env_buffer), env_name);
|
||||||
if (ret != 0) {
|
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_buffer[WINDOWS_ENV_BUFFER_SIZE - 1] = '\0';
|
||||||
*env_value = __env_buffer;
|
*env_value = __env_buffer;
|
||||||
#endif // !defined(WIN32)
|
#endif // !defined(_WIN32)
|
||||||
return RCL_RET_OK;
|
return RCL_RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#ifndef RCL__STDATOMIC_HELPER_H_
|
#ifndef RCL__STDATOMIC_HELPER_H_
|
||||||
#define RCL__STDATOMIC_HELPER_H_
|
#define RCL__STDATOMIC_HELPER_H_
|
||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(_WIN32)
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ <= 4 && __GNUC_MINOR__ <= 9
|
#if defined(__GNUC__) && __GNUC__ <= 4 && __GNUC_MINOR__ <= 9
|
||||||
// If GCC and below GCC-4.9, use the compatability header.
|
// 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)
|
#define rcl_atomic_store(object, desired) atomic_store(object, desired)
|
||||||
|
|
||||||
#else // !defined(WIN32)
|
#else // !defined(_WIN32)
|
||||||
|
|
||||||
#include "./stdatomic_helper/win32/stdatomic.h"
|
#include "./stdatomic_helper/win32/stdatomic.h"
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
#define rcl_atomic_store(object, desired) rcl_win32_atomic_store(object, desired)
|
#define rcl_atomic_store(object, desired) rcl_win32_atomic_store(object, desired)
|
||||||
|
|
||||||
#endif // !defined(WIN32)
|
#endif // !defined(_WIN32)
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
rcl_atomic_load_bool(atomic_bool * a_bool)
|
rcl_atomic_load_bool(atomic_bool * a_bool)
|
||||||
|
|
|
@ -56,9 +56,9 @@
|
||||||
* $FreeBSD: src/include/stdatomic.h,v 1.10.2.2 2012/05/30 19:21:54 theraven Exp $
|
* $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"
|
#error "this stdatomic.h does not support your compiler"
|
||||||
#endif
|
#endif // !defined(_WIN32)
|
||||||
|
|
||||||
#ifndef RCL__STDATOMIC_HELPER__WIN32__STDATOMIC_H_
|
#ifndef RCL__STDATOMIC_HELPER__WIN32__STDATOMIC_H_
|
||||||
#define RCL__STDATOMIC_HELPER__WIN32__STDATOMIC_H_
|
#define RCL__STDATOMIC_HELPER__WIN32__STDATOMIC_H_
|
||||||
|
|
|
@ -94,7 +94,7 @@ void stop_memory_checking()
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* End Apple
|
* End Apple
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
// #elif defined(WIN32)
|
// #elif defined(_WIN32)
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Begin Windows
|
* Begin Windows
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
@ -140,4 +140,4 @@ void set_on_unexpected_free_callback(UnexpectedCallbackType callback) {}
|
||||||
|
|
||||||
void memory_checking_thread_init() {}
|
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 ...
|
||||||
|
|
|
@ -56,11 +56,11 @@ public:
|
||||||
|
|
||||||
bool is_opensplice =
|
bool is_opensplice =
|
||||||
std::string(rmw_get_implementation_identifier()).find("opensplice") != std::string::npos;
|
std::string(rmw_get_implementation_identifier()).find("opensplice") != std::string::npos;
|
||||||
#if defined(WIN32)
|
#if defined(_WIN32)
|
||||||
bool is_windows = true;
|
bool is_windows = true;
|
||||||
#else
|
#else
|
||||||
bool is_windows = false;
|
bool is_windows = false;
|
||||||
#endif
|
#endif // defined(_WIN32)
|
||||||
|
|
||||||
/* Tests the node accessors, i.e. rcl_node_get_* functions.
|
/* Tests the node accessors, i.e. rcl_node_get_* functions.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue