File tree Expand file tree Collapse file tree 3 files changed +46
-15
lines changed Expand file tree Collapse file tree 3 files changed +46
-15
lines changed Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 2.8.3)
22
3- project (rmw NONE )
3+ project (rmw C )
44
55find_package (ament_cmake REQUIRED)
66
7+ include_directories (include )
8+ add_library (${PROJECT_NAME} SHARED "src/error_handling.c" )
9+
710ament_export_dependencies(rosidl_generator_c)
811ament_export_include_directories(include )
12+ ament_export_libraries(${PROJECT_NAME} )
913
1014if (AMENT_ENABLE_TESTING)
1115 find_package (ament_lint_auto REQUIRED)
@@ -22,3 +26,9 @@ install(
2226 DIRECTORY include /
2327 DESTINATION include
2428)
29+ install (
30+ TARGETS ${PROJECT_NAME}
31+ ARCHIVE DESTINATION lib
32+ LIBRARY DESTINATION lib
33+ RUNTIME DESTINATION bin
34+ )
Original file line number Diff line number Diff line change @@ -20,26 +20,16 @@ extern "C"
2020{
2121#endif
2222
23- #include <string.h>
24-
2523#include "macros.h"
2624#include "visibility_control.h"
2725
28- RMW_THREAD_LOCAL char * __rmw_error_string = 0 ;
29-
30- RMW_LOCAL
26+ RMW_PUBLIC
3127void
32- rmw_set_error_string (const char * error_string )
33- {
34- __rmw_error_string = strdup (error_string );
35- }
28+ rmw_set_error_string (const char * error_string );
3629
37- RMW_LOCAL
30+ RMW_PUBLIC
3831const char *
39- rmw_get_error_string ()
40- {
41- return __rmw_error_string ;
42- }
32+ rmw_get_error_string ();
4333
4434#if __cplusplus
4535 }
Original file line number Diff line number Diff line change 1+ // Copyright 2015 Open Source Robotics Foundation, Inc.
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
15+ #include <string.h>
16+
17+ #include <rmw/error_handling.h>
18+
19+ RMW_THREAD_LOCAL char * __rmw_error_string = 0 ;
20+
21+ void
22+ rmw_set_error_string (const char * error_string )
23+ {
24+ __rmw_error_string = strdup (error_string );
25+ }
26+
27+ const char *
28+ rmw_get_error_string ()
29+ {
30+ return __rmw_error_string ;
31+ }
You can’t perform that action at this time.
0 commit comments