From 79a929621c7a8e406f0cba257b8a42d372f49e00 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 23 Apr 2018 10:12:49 -0500 Subject: [PATCH] Change #if to #ifdef. --- include/rcutils/allocator.h | 4 ++-- include/rcutils/cmdline_parser.h | 4 ++-- include/rcutils/concat.h | 4 ++-- include/rcutils/error_handling.h | 4 ++-- include/rcutils/filesystem.h | 4 ++-- include/rcutils/find.h | 4 ++-- include/rcutils/format_string.h | 4 ++-- include/rcutils/get_env.h | 4 ++-- include/rcutils/isalnum_no_locale.h | 4 ++-- include/rcutils/logging.h | 4 ++-- include/rcutils/macros.h | 4 ++-- include/rcutils/repl_str.h | 4 ++-- include/rcutils/snprintf.h | 4 ++-- include/rcutils/split.h | 4 ++-- include/rcutils/strdup.h | 4 ++-- include/rcutils/time.h | 4 ++-- include/rcutils/types.h | 4 ++-- include/rcutils/types/rcutils_ret.h | 4 ++-- include/rcutils/types/string_array.h | 4 ++-- include/rcutils/types/string_map.h | 4 ++-- include/rcutils/visibility_control.h | 4 ++-- resource/logging_macros.h.em | 4 ++-- src/common.h | 4 ++-- src/concat.c | 4 ++-- src/filesystem.c | 4 ++-- src/find.c | 4 ++-- src/format_string.c | 4 ++-- src/get_env.c | 4 ++-- src/logging.c | 4 ++-- src/repl_str.c | 4 ++-- src/split.c | 4 ++-- src/strdup.c | 4 ++-- src/string_array.c | 4 ++-- src/string_map.c | 4 ++-- src/time_unix.c | 4 ++-- src/time_win32.c | 4 ++-- test/allocator_testing_utils.h | 4 ++-- 37 files changed, 74 insertions(+), 74 deletions(-) diff --git a/include/rcutils/allocator.h b/include/rcutils/allocator.h index 66f91100..dc727654 100644 --- a/include/rcutils/allocator.h +++ b/include/rcutils/allocator.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__ALLOCATOR_H_ #define RCUTILS__ALLOCATOR_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -135,7 +135,7 @@ RCUTILS_WARN_UNUSED void * rcutils_reallocf(void * pointer, size_t size, rcutils_allocator_t * allocator); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/cmdline_parser.h b/include/rcutils/cmdline_parser.h index 182c4104..05caed55 100644 --- a/include/rcutils/cmdline_parser.h +++ b/include/rcutils/cmdline_parser.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__CMDLINE_PARSER_H_ #define RCUTILS__CMDLINE_PARSER_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -32,7 +32,7 @@ RCUTILS_PUBLIC char * rcutils_cli_get_option(char ** begin, char ** end, const char * option); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/concat.h b/include/rcutils/concat.h index 62e5357b..475d104b 100644 --- a/include/rcutils/concat.h +++ b/include/rcutils/concat.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__CONCAT_H_ #define RCUTILS__CONCAT_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -35,7 +35,7 @@ RCUTILS_PUBLIC char * rcutils_concat(const char * lhs, const char * rhs, const char * delimiter); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/error_handling.h b/include/rcutils/error_handling.h index 8a117608..fd7f56bb 100644 --- a/include/rcutils/error_handling.h +++ b/include/rcutils/error_handling.h @@ -17,7 +17,7 @@ #ifndef RCUTILS__ERROR_HANDLING_H_ #define RCUTILS__ERROR_HANDLING_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -213,7 +213,7 @@ RCUTILS_PUBLIC void rcutils_reset_error(void); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/filesystem.h b/include/rcutils/filesystem.h index 4b4e7de0..d9133771 100644 --- a/include/rcutils/filesystem.h +++ b/include/rcutils/filesystem.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__FILESYSTEM_H_ #define RCUTILS__FILESYSTEM_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -120,7 +120,7 @@ RCUTILS_PUBLIC char * rcutils_join_path(const char * left_hand_path, const char * right_hand_path); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/find.h b/include/rcutils/find.h index d4e0ef36..454be135 100644 --- a/include/rcutils/find.h +++ b/include/rcutils/find.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__FIND_H_ #define RCUTILS__FIND_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -79,7 +79,7 @@ RCUTILS_PUBLIC size_t rcutils_find_lastn(const char * str, char delimiter, size_t string_length); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/format_string.h b/include/rcutils/format_string.h index 28119947..cb83f413 100644 --- a/include/rcutils/format_string.h +++ b/include/rcutils/format_string.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__FORMAT_STRING_H_ #define RCUTILS__FORMAT_STRING_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -71,7 +71,7 @@ rcutils_format_string_limit( const char * format_string, ...); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/get_env.h b/include/rcutils/get_env.h index 3b48bbf8..29e85584 100644 --- a/include/rcutils/get_env.h +++ b/include/rcutils/get_env.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__GET_ENV_H_ #define RCUTILS__GET_ENV_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -61,7 +61,7 @@ RCUTILS_WARN_UNUSED const char * rcutils_get_env(const char * env_name, const char ** env_value); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/isalnum_no_locale.h b/include/rcutils/isalnum_no_locale.h index d70f325b..1f02f914 100644 --- a/include/rcutils/isalnum_no_locale.h +++ b/include/rcutils/isalnum_no_locale.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__ISALNUM_NO_LOCALE_H_ #define RCUTILS__ISALNUM_NO_LOCALE_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -40,7 +40,7 @@ rcutils_isalnum_no_locale(char c) return false; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/logging.h b/include/rcutils/logging.h index b67af0b6..21c9cbab 100644 --- a/include/rcutils/logging.h +++ b/include/rcutils/logging.h @@ -24,7 +24,7 @@ #include "rcutils/types/rcutils_ret.h" #include "rcutils/visibility_control.h" -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -472,7 +472,7 @@ void rcutils_logging_console_output_handler( } \ } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/macros.h b/include/rcutils/macros.h index 57f2e63c..db705703 100644 --- a/include/rcutils/macros.h +++ b/include/rcutils/macros.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__MACROS_H_ #define RCUTILS__MACROS_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -63,7 +63,7 @@ extern "C" #define RCUTILS_STRINGIFY_IMPL(x) #x #define RCUTILS_STRINGIFY(x) RCUTILS_STRINGIFY_IMPL(x) -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/repl_str.h b/include/rcutils/repl_str.h index 0b7b950b..979189fc 100644 --- a/include/rcutils/repl_str.h +++ b/include/rcutils/repl_str.h @@ -26,7 +26,7 @@ #ifndef RCUTILS__REPL_STR_H_ #define RCUTILS__REPL_STR_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -133,7 +133,7 @@ rcutils_repl_str( // Implementation copied from above mentioned source continues in repl_str.c. -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/snprintf.h b/include/rcutils/snprintf.h index 604a023e..5c873720 100644 --- a/include/rcutils/snprintf.h +++ b/include/rcutils/snprintf.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__SNPRINTF_H_ #define RCUTILS__SNPRINTF_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -45,7 +45,7 @@ extern "C" _vsnprintf_s(buffer, buffer_size, _TRUNCATE, format, __VA_ARGS__) #endif -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/split.h b/include/rcutils/split.h index 4359a335..d681530a 100644 --- a/include/rcutils/split.h +++ b/include/rcutils/split.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__SPLIT_H_ #define RCUTILS__SPLIT_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -59,7 +59,7 @@ rcutils_split_last( rcutils_allocator_t allocator, rcutils_string_array_t * string_array); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/strdup.h b/include/rcutils/strdup.h index 01f487db..6347656e 100644 --- a/include/rcutils/strdup.h +++ b/include/rcutils/strdup.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__STRDUP_H_ #define RCUTILS__STRDUP_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -67,7 +67,7 @@ RCUTILS_WARN_UNUSED char * rcutils_strndup(const char * str, size_t string_length, rcutils_allocator_t allocator); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/time.h b/include/rcutils/time.h index 862ea50e..2f75ef80 100644 --- a/include/rcutils/time.h +++ b/include/rcutils/time.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__TIME_H_ #define RCUTILS__TIME_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -100,7 +100,7 @@ RCUTILS_WARN_UNUSED rcutils_ret_t rcutils_steady_time_now(rcutils_time_point_value_t * now); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/types.h b/include/rcutils/types.h index 875b7660..82c78f00 100644 --- a/include/rcutils/types.h +++ b/include/rcutils/types.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__TYPES_H_ #define RCUTILS__TYPES_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -24,7 +24,7 @@ extern "C" #include "rcutils/types/string_map.h" #include "rcutils/types/rcutils_ret.h" -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/types/rcutils_ret.h b/include/rcutils/types/rcutils_ret.h index 39724d14..4747c3bb 100644 --- a/include/rcutils/types/rcutils_ret.h +++ b/include/rcutils/types/rcutils_ret.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__TYPES__RCUTILS_RET_H_ #define RCUTILS__TYPES__RCUTILS_RET_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -42,7 +42,7 @@ typedef int rcutils_ret_t; /// Internal severity map for logger thresholds is invalid. #define RCUTILS_RET_LOGGING_SEVERITY_MAP_INVALID 40 -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/types/string_array.h b/include/rcutils/types/string_array.h index 1255bfc4..5a63c3fe 100644 --- a/include/rcutils/types/string_array.h +++ b/include/rcutils/types/string_array.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__TYPES__STRING_ARRAY_H_ #define RCUTILS__TYPES__STRING_ARRAY_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -110,7 +110,7 @@ RCUTILS_WARN_UNUSED rcutils_ret_t rcutils_string_array_fini(rcutils_string_array_t * string_array); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/types/string_map.h b/include/rcutils/types/string_map.h index a083646e..de2e0392 100644 --- a/include/rcutils/types/string_map.h +++ b/include/rcutils/types/string_map.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__TYPES__STRING_MAP_H_ #define RCUTILS__TYPES__STRING_MAP_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -432,7 +432,7 @@ rcutils_string_map_copy( const rcutils_string_map_t * src_string_map, rcutils_string_map_t * dst_string_map); -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/include/rcutils/visibility_control.h b/include/rcutils/visibility_control.h index cfaaa6f8..e8069039 100644 --- a/include/rcutils/visibility_control.h +++ b/include/rcutils/visibility_control.h @@ -15,7 +15,7 @@ #ifndef RCUTILS__VISIBILITY_CONTROL_H_ #define RCUTILS__VISIBILITY_CONTROL_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -51,7 +51,7 @@ extern "C" #define RCUTILS_PUBLIC_TYPE #endif -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/resource/logging_macros.h.em b/resource/logging_macros.h.em index caa2f675..ef901113 100644 --- a/resource/logging_macros.h.em +++ b/resource/logging_macros.h.em @@ -24,7 +24,7 @@ #include #include -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -248,7 +248,7 @@ from rcutils.logging import severities ///@@} @[end for]@ -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/common.h b/src/common.h index 0ea3b56b..0c4de97b 100644 --- a/src/common.h +++ b/src/common.h @@ -15,14 +15,14 @@ #ifndef COMMON_H_ #define COMMON_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif #include "rcutils/error_handling.h" -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/concat.c b/src/concat.c index 167db127..65325228 100644 --- a/src/concat.c +++ b/src/concat.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -48,6 +48,6 @@ rcutils_concat(const char * lhs, const char * rhs, const char * delimiter) return concat; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/filesystem.c b/src/filesystem.c index 03af3e77..3375de16 100644 --- a/src/filesystem.c +++ b/src/filesystem.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -160,6 +160,6 @@ rcutils_join_path(const char * left_hand_path, const char * right_hand_path) return rcutils_concat(left_hand_path, right_hand_path, delimiter); } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/find.c b/src/find.c index 7df2cf1d..ab39e42f 100644 --- a/src/find.c +++ b/src/find.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -73,6 +73,6 @@ rcutils_find_lastn(const char * str, char delimiter, size_t string_length) return str[0] == delimiter ? 0 : SIZE_MAX; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/format_string.c b/src/format_string.c index 1c6c4eb1..feadaeea 100644 --- a/src/format_string.c +++ b/src/format_string.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -67,6 +67,6 @@ rcutils_format_string_limit( return output_string; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/get_env.c b/src/get_env.c index f37fbb61..3fdff69f 100644 --- a/src/get_env.c +++ b/src/get_env.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -55,6 +55,6 @@ rcutils_get_env(const char * env_name, const char ** env_value) return NULL; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/logging.c b/src/logging.c index 838c03cb..a965d641 100644 --- a/src/logging.c +++ b/src/logging.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -598,6 +598,6 @@ void rcutils_logging_console_output_handler( } } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/repl_str.c b/src/repl_str.c index e1d0c9d8..1ebb7b81 100644 --- a/src/repl_str.c +++ b/src/repl_str.c @@ -25,7 +25,7 @@ // Note: the "tuning" values at the beginning of the function have been left as-is. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -144,6 +144,6 @@ rcutils_repl_str( // *INDENT-ON* -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/split.c b/src/split.c index 0daa2d3c..1a877bbc 100644 --- a/src/split.c +++ b/src/split.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -213,6 +213,6 @@ rcutils_split_last( return result_error; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/strdup.c b/src/strdup.c index 9c5ea658..bc52b189 100644 --- a/src/strdup.c +++ b/src/strdup.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -48,6 +48,6 @@ rcutils_strndup(const char * str, size_t string_length, rcutils_allocator_t allo return new_string; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/string_array.c b/src/string_array.c index cfa534e2..82497cc7 100644 --- a/src/string_array.c +++ b/src/string_array.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -87,6 +87,6 @@ rcutils_string_array_fini(rcutils_string_array_t * string_array) return RCUTILS_RET_OK; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/string_map.c b/src/string_map.c index 16ebcadf..9452b76e 100644 --- a/src/string_map.c +++ b/src/string_map.c @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -481,6 +481,6 @@ rcutils_string_map_copy( return RCUTILS_RET_OK; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/time_unix.c b/src/time_unix.c index 6959e2bf..f3fd108c 100644 --- a/src/time_unix.c +++ b/src/time_unix.c @@ -16,7 +16,7 @@ # error time_unix.c is not intended to be used with win32 based systems #endif // defined(_WIN32) -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -104,6 +104,6 @@ rcutils_steady_time_now(rcutils_time_point_value_t * now) return RCUTILS_RET_OK; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/src/time_win32.c b/src/time_win32.c index 537cda39..ab25f1dd 100644 --- a/src/time_win32.c +++ b/src/time_win32.c @@ -16,7 +16,7 @@ # error time_win32.c is only intended to be used with win32 based systems #endif // _WIN32 -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -75,6 +75,6 @@ rcutils_steady_time_now(rcutils_time_point_value_t * now) return RCUTILS_RET_OK; } -#if __cplusplus +#ifdef __cplusplus } #endif diff --git a/test/allocator_testing_utils.h b/test/allocator_testing_utils.h index 4d619d34..72d0a453 100644 --- a/test/allocator_testing_utils.h +++ b/test/allocator_testing_utils.h @@ -15,7 +15,7 @@ #ifndef ALLOCATOR_TESTING_UTILS_H_ #define ALLOCATOR_TESTING_UTILS_H_ -#if __cplusplus +#ifdef __cplusplus extern "C" { #endif @@ -76,7 +76,7 @@ set_failing_allocator_is_failing(rcutils_allocator_t & failing_allocator, bool s ((__failing_allocator_state *)failing_allocator.state)->is_failing = state; } -#if __cplusplus +#ifdef __cplusplus } #endif