Add extern "C" keyword in header files 48/280148/1
authorTaeminYeom <taemin.yeom@samsung.com>
Wed, 24 Aug 2022 09:15:03 +0000 (18:15 +0900)
committerTaemin Yeom <taemin.yeom@samsung.com>
Wed, 24 Aug 2022 09:18:07 +0000 (09:18 +0000)
Change-Id: Ie16f5ec1d1c18f5e20cd94d46ad63a3ad7ac58fc
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
(cherry picked from commit 52e7d17a5203b8b042989aa6d689d994835feb5a)

src/libcommon/common.h
src/libcommon/file.h
src/libcommon/ini-parser.h
src/libcommon/list.h
src/libgdbus/dbus-iface-system.h
src/libgdbus/libgdbus.h
src/shared/log-macro.h
src/shared/log.h

index 057bad4c4f9ab48d9067d08bb674c9698a7fe0e2..178be64f9beedda90269627f9e32503f87022dc0 100644 (file)
 
 #include <stdbool.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @brief Check if running on emulator
  *
@@ -33,4 +37,8 @@ bool libsys_is_emulator(void);
  */
 bool libsys_is_container(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __LIBCOMMON_COMMON_H__ */
index 71544948ce02aaa5a6aef0d52baba61eee28dfc9..6622dfcce729c28148d6a4538f5dfbcd0ae21910 100644 (file)
 
 #include <stdarg.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @brief Open file, read and close
  *
@@ -92,4 +96,8 @@ int sys_set_str(char *fname, char *val);
  */
 int libsys_parse_cmdline_scanf(const char *format, ...);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __LIBCOMMON_FILE_H__ */
index 7af9f424e7756892296277c92830378bbcb2b319..35e748087744e411a1570ac9ca7dce56998ff25e 100644 (file)
 #define MATCH(a, b)     (!strncmp(a, b, strlen(a)))
 #define SET_CONF(a, b)      (a = (b > 0.0 ? b : a))
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct parse_result {
        char *section;
        union {
@@ -63,4 +67,9 @@ int config_parse(const char *file_name, int cb(struct parse_result *result,
  * @return 0 on success, negative if failed
  */
 int libsys_config_parse_by_section(const char *file_name, int cb(const struct parse_result *,  void *), void *user_data);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index ab2784356c551ddd66a49d7ca4e68f9a144cfb17..d45dbec42a29798cbf9ea147b92bf8a7a150223d 100644 (file)
 
 #include <glib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define SYS_G_LIST_PREPEND(a, b)       \
        a = g_list_prepend(a, (gpointer)b)
 #define SYS_G_LIST_APPEND(a, b)        \
@@ -56,5 +60,9 @@
 #define SYS_G_LIST_NEXT(a)     \
        g_list_next(a)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
index a5b838e5a11f8c91e55f6b6160833dbc94505beb..1096a785667081386d7edc1426e1a68d8ece4e95 100644 (file)
 #ifndef __DBUS_SYSTEM_IFACE_H__
 #define __DBUS_SYSTEM_IFACE_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Template
  *
 /* End of the Experimental for Specific device */
 /***********************************************/
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif
index 6828b76990e29a200e11ffef3efac35024e1613b..85e2ed004880e30530ffdf9b432f49e684599386 100644 (file)
 
 #include "dbus-iface-system.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct {
        const unsigned char *data;
        int size;
@@ -270,6 +274,8 @@ GVariant *gdbus_make_simple_array   (const char *sig,
 
 int check_systemd_active                       (void);
 
-
+#ifdef __cplusplus
+}
+#endif
 
 #endif
index 8532b376464227976047c14e6659b3daaaed919b..6792243a7d41e93af902fb682a17b6aee2ad381e 100644 (file)
 #ifndef __LOG_MACRO_H__
 #define __LOG_MACRO_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef ENABLE_DLOG
 #include <dlog.h>
 #define _D(fmt, arg...) \
@@ -48,4 +52,9 @@
 #define _SW(...)   do { } while (0)
 #define _SE(...)   do { } while (0)
 #endif
+
+#ifdef __cplusplus
+}
 #endif
+
+#endif /* __LOG_MACRO_H__ */
index ad914a3e0d8dd9e9fe634ff52cfe0a1bf335c9a7..c5ee0fd329e57815363ae7e1f1ca8569407de9cb 100644 (file)
 #ifndef __LOG_H__
 #define __LOG_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef ENABLE_LIBDEVICED_DLOG
 #define ENABLE_DLOG
 #endif
@@ -27,4 +31,8 @@
 #define LOG_TAG "LIBSYSCOMMON"
 #include "shared/log-macro.h"
 
+#ifdef __cplusplus
+}
 #endif
+
+#endif /* __LOG_H__ */