File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,15 +60,15 @@ char * rcutils_get_executable_name(rcutils_allocator_t allocator)
6060
6161#if defined __APPLE__ || defined __FreeBSD__ || (defined __ANDROID__ && __ANDROID_API__ >= 21 )
6262 const char * appname = getprogname ();
63- #elif defined __GNUC__ && !defined(__QNXNTO__ )
63+ #elif defined __GNUC__ && !defined(__QNXNTO__ ) && !defined( __OHOS__ )
6464 const char * appname = program_invocation_name ;
6565#elif defined _WIN32 || defined __CYGWIN__
6666 char appname [MAX_PATH ];
6767 int32_t size = GetModuleFileNameA (NULL , appname , MAX_PATH );
6868 if (size == 0 ) {
6969 return NULL ;
7070 }
71- #elif defined __QNXNTO__
71+ #elif defined __QNXNTO__ || defined __OHOS__
7272 extern char * __progname ;
7373 const char * appname = __progname ;
7474#else
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ rcutils_load_shared_library(
127127 goto fail ;
128128 }
129129 lib -> library_path = rcutils_strdup (image_name , lib -> allocator );
130- #elif defined(_GNU_SOURCE ) && !defined(__QNXNTO__ ) && !defined(__ANDROID__ )
130+ #elif defined(_GNU_SOURCE ) && !defined(__QNXNTO__ ) && !defined(__ANDROID__ ) && !defined( __OHOS__ )
131131 struct link_map * map = NULL ;
132132 if (dlinfo (lib -> lib_pointer , RTLD_DI_LINKMAP , & map ) != 0 ) {
133133 RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING ("dlinfo error: %s" , dlerror ());
You can’t perform that action at this time.
0 commit comments