Commit 07c69cd5fbf4f1f67ffb8254ead23b046caeae86
Committed by
Gerrit Code Review
Merge "Error message when demo lib doesn't have main()" into devel/master
Showing
1 changed file
with
7 additions
and
0 deletions
build/android/app/src/main/cpp/main.cpp
| ... | ... | @@ -217,10 +217,17 @@ void android_main(struct android_app* state) |
| 217 | 217 | dlerror(); /* Clear any existing error */ |
| 218 | 218 | |
| 219 | 219 | int (*main)(int, char**) = (int (*)(int, char**))dlsym(handle, "main"); |
| 220 | + LOGV("lib=%s handle=%p main=%p", libpath.c_str(), handle, main ); | |
| 220 | 221 | if(main) |
| 221 | 222 | { |
| 222 | 223 | status = main(0, nullptr); |
| 223 | 224 | } |
| 225 | + else | |
| 226 | + { | |
| 227 | + LOGE("lib %s doesn't have main()", libpath.c_str()); | |
| 228 | + status = EFAULT; | |
| 229 | + std::exit(status); | |
| 230 | + } | |
| 224 | 231 | |
| 225 | 232 | if(handle) |
| 226 | 233 | { | ... | ... |