Rename libdl.c to libdl.cpp.
The no-arg function definitions in libdl.c weren't strictly correct,
because they should have taken void. Rename .c to .cpp instead of
fixing them.
Test: mma
Change-Id: I9e3528c836ffc8625a6a4d529034263b19b9fb3a
diff --git a/libdl/Android.bp b/libdl/Android.bp
index b0bbe99..44daaec 100644
--- a/libdl/Android.bp
+++ b/libdl/Android.bp
@@ -4,7 +4,7 @@
cc_library_static {
name: "libdl_static",
- srcs: ["libdl.c", "libdl_cfi.cpp"],
+ srcs: ["libdl.cpp", "libdl_cfi.cpp"],
cflags: [
"-Wall",
diff --git a/libdl/libdl.c b/libdl/libdl.cpp
similarity index 98%
rename from libdl/libdl.c
rename to libdl/libdl.cpp
index b747c22..97cdeb4 100644
--- a/libdl/libdl.c
+++ b/libdl/libdl.cpp
@@ -23,11 +23,13 @@
// These functions are exported by the loader
// TODO(dimitry): replace these with reference to libc.so
+extern "C" {
+
__attribute__((__weak__, visibility("default")))
void* __loader_dlopen(const char* filename, int flags, const void* caller_addr);
__attribute__((__weak__, visibility("default")))
-void* __loader_dlerror();
+char* __loader_dlerror();
__attribute__((__weak__, visibility("default")))
void* __loader_dlsym(void* handle, const char* symbol, const void* caller_addr);
@@ -212,3 +214,5 @@
struct android_namespace_t* android_get_exported_namespace(const char* name) {
return __loader_android_get_exported_namespace(name);
}
+
+} // extern "C"