Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update approach #6

Merged
merged 2 commits into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ target_compile_definitions(${PROJECT_NAME}
$<$<BOOL:${RCUTILS_AVOID_DYNAMIC_ALLOCATION}>:RCUTILS_AVOID_DYNAMIC_ALLOCATION>
)

configure_file(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you keep the target_compile_definitions?
Why there is not RCUTILS_NO_THREAD_SUPPORT in configuration_flags.h?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"${PROJECT_SOURCE_DIR}/include/rcutils/configuration_flags.h.in"
"${PROJECT_SOURCE_DIR}/include/rcutils/configuration_flags.h"
)

# Needed if pthread is used for thread local storage.
if(IOS AND IOS_SDK_VERSION LESS 10.0)
ament_export_libraries(pthread)
Expand Down
17 changes: 17 additions & 0 deletions include/rcutils/configuration_flags.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

#ifndef RCUTILS__CONFIGURATION_FLAGS_H_
#define RCUTILS__CONFIGURATION_FLAGS_H_

#ifdef __cplusplus
extern "C"
{
#endif

#define RCUTILS_NO_FILESYSTEM
#define RCUTILS_AVOID_DYNAMIC_ALLOCATION

#ifdef __cplusplus
}
#endif

#endif // RCUTILS__CONFIGURATION_FLAGS_H_
17 changes: 17 additions & 0 deletions include/rcutils/configuration_flags.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

#ifndef RCUTILS__CONFIGURATION_FLAGS_H_
#define RCUTILS__CONFIGURATION_FLAGS_H_

#ifdef __cplusplus
extern "C"
{
#endif

#cmakedefine RCUTILS_NO_FILESYSTEM
#cmakedefine RCUTILS_AVOID_DYNAMIC_ALLOCATION

#ifdef __cplusplus
}
#endif

#endif // RCUTILS__CONFIGURATION_FLAGS_H_
1 change: 1 addition & 0 deletions include/rcutils/error_handling.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ extern "C"
#include "rcutils/snprintf.h"
#include "rcutils/types/rcutils_ret.h"
#include "rcutils/visibility_control.h"
#include "rcutils/configuration_flags.h"

#if defined(__STDC_LIB_EXT1__) && !defined(RCUTILS_NO_FILESYSTEM)
// Limit the buffer size in the `fwrite` call to give an upper bound to buffer overrun in the case
Expand Down