Put the extern "C" 28/278028/1
authorSooChan Lim <sc1.lim@samsung.com>
Sun, 6 Mar 2022 23:10:09 +0000 (08:10 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 18 Jul 2022 05:07:54 +0000 (14:07 +0900)
Without this extern "C", C++ program which uses libds does not recognize
the symbols in libds header files.

Change-Id: Id6e79c68472af9e8e1616aca6d37a4feaea75450

include/libds/allocator.h
include/libds/allocator/shm.h
include/libds/allocator/tbm.h
include/libds/backend/tdm.h
include/libds/backend/wayland.h
include/libds/output.h
include/libds/swapchain.h
include/libds/xdg_shell.h

index d4a6a80..7f26a96 100644 (file)
@@ -3,6 +3,10 @@
 
 #include <libds/buffer.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ds_allocator;
 
 void
@@ -16,4 +20,8 @@ void
 ds_allocator_add_destroy_listener(struct ds_allocator *alloc,
         struct wl_listener *listener);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 1a02338..c151183 100644 (file)
@@ -3,7 +3,15 @@
 
 #include <libds/allocator.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ds_allocator *
 ds_shm_allocator_create(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 1457e3f..c02aee3 100644 (file)
@@ -3,10 +3,18 @@
 
 #include <libds/allocator.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ds_allocator *
 ds_tbm_allocator_create(void);
 
 WL_EXPORT void *
 ds_tbm_buffer_get_surface(struct ds_buffer *ds_buffer);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index ec5f9cc..e697413 100644 (file)
@@ -3,7 +3,15 @@
 
 #include <libds/backend.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ds_backend *
 ds_tdm_backend_create(struct wl_display *display);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index e7f233a..2be8d76 100644 (file)
@@ -4,10 +4,18 @@
 #include <libds/backend.h>
 #include <libds/output.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ds_backend *
 ds_wl_backend_create(struct wl_display *display, const char *server_name);
 
 struct ds_output *
 ds_wl_backend_create_output(struct ds_backend *backend);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index d2454fc..d56690e 100644 (file)
@@ -4,6 +4,10 @@
 #include <time.h>
 #include <libds/buffer.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ds_output;
 
 struct ds_output_mode {
@@ -41,4 +45,8 @@ void
 ds_output_add_commit_listener(struct ds_output *output,
         struct wl_listener *listener);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index d78d428..61d8a68 100644 (file)
@@ -3,6 +3,10 @@
 
 #include <libds/allocator.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ds_swapchain;
 
 struct ds_swapchain *
@@ -19,4 +23,8 @@ void
 ds_swapchain_set_buffer_submitted(struct ds_swapchain *swapchain,
         struct ds_buffer *buffer);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index e3b386f..624c327 100644 (file)
@@ -6,6 +6,10 @@
 
 #include "surface.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ds_xdg_shell;
 
 struct ds_xdg_surface;
@@ -47,4 +51,8 @@ uint32_t
 ds_xdg_toplevel_set_activated(struct ds_xdg_surface *surface,
         bool activated);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif