From: TaeminYeom Date: Wed, 24 Aug 2022 09:15:03 +0000 (+0900) Subject: Add extern "C" keyword in header files X-Git-Tag: accepted/tizen/unified/20220919.021606^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F280147%2F1;p=platform%2Fcore%2Fsystem%2Flibsyscommon.git Add extern "C" keyword in header files Change-Id: Ie16f5ec1d1c18f5e20cd94d46ad63a3ad7ac58fc Signed-off-by: TaeminYeom --- diff --git a/src/libcommon/common.h b/src/libcommon/common.h index bbeee46..8144929 100644 --- a/src/libcommon/common.h +++ b/src/libcommon/common.h @@ -25,6 +25,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Check if running on emulator * @@ -39,4 +43,8 @@ bool libsys_is_emulator(void); */ bool libsys_is_container(void); +#ifdef __cplusplus +} +#endif + #endif /* __LIBCOMMON_COMMON_H__ */ diff --git a/src/libcommon/file.h b/src/libcommon/file.h index 84fca0c..c933fc9 100644 --- a/src/libcommon/file.h +++ b/src/libcommon/file.h @@ -25,6 +25,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Open file, read and close * @@ -97,4 +101,8 @@ int sys_set_str(char *fname, char *val); */ int libsys_parse_cmdline_scanf(const char *format, ...); +#ifdef __cplusplus +} +#endif + #endif /* __LIBCOMMON_FILE_H__ */ diff --git a/src/libcommon/ini-parser.h b/src/libcommon/ini-parser.h index dccd1ac..9620103 100644 --- a/src/libcommon/ini-parser.h +++ b/src/libcommon/ini-parser.h @@ -28,6 +28,10 @@ #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 { @@ -66,4 +70,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 diff --git a/src/libcommon/list.h b/src/libcommon/list.h index aa9e947..dc646dc 100644 --- a/src/libcommon/list.h +++ b/src/libcommon/list.h @@ -25,6 +25,10 @@ #include +#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) \ @@ -60,5 +64,9 @@ #define SYS_G_LIST_NEXT(a) \ g_list_next(a) +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/libgdbus/dbus-iface-system.h b/src/libgdbus/dbus-iface-system.h index a4f69da..1a98990 100644 --- a/src/libgdbus/dbus-iface-system.h +++ b/src/libgdbus/dbus-iface-system.h @@ -23,6 +23,10 @@ #ifndef __DBUS_SYSTEM_IFACE_H__ #define __DBUS_SYSTEM_IFACE_H__ +#ifdef __cplusplus +extern "C" { +#endif + /* * Template * @@ -342,5 +346,8 @@ /* End of the Experimental for Specific device */ /***********************************************/ +#ifdef __cplusplus +} +#endif #endif diff --git a/src/libgdbus/libgdbus.h b/src/libgdbus/libgdbus.h index f909d76..659b2e4 100644 --- a/src/libgdbus/libgdbus.h +++ b/src/libgdbus/libgdbus.h @@ -32,6 +32,10 @@ #include "dbus-iface-system.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { const unsigned char *data; int size; @@ -274,6 +278,8 @@ GVariant *gdbus_make_simple_array (const char *sig, int check_systemd_active (void); - +#ifdef __cplusplus +} +#endif #endif diff --git a/src/shared/log-macro.h b/src/shared/log-macro.h index 9893820..882bee1 100644 --- a/src/shared/log-macro.h +++ b/src/shared/log-macro.h @@ -23,6 +23,10 @@ #ifndef __LOG_MACRO_H__ #define __LOG_MACRO_H__ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef ENABLE_DLOG #include #define _D(fmt, arg...) \ @@ -51,4 +55,9 @@ #define _SW(...) do { } while (0) #define _SE(...) do { } while (0) #endif + +#ifdef __cplusplus +} #endif + +#endif /* __LOG_MACRO_H__ */ diff --git a/src/shared/log.h b/src/shared/log.h index 09a9eb4..7f5b6bb 100644 --- a/src/shared/log.h +++ b/src/shared/log.h @@ -23,6 +23,10 @@ #ifndef __LOG_H__ #define __LOG_H__ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef ENABLE_LIBDEVICED_DLOG #define ENABLE_DLOG #endif @@ -30,4 +34,8 @@ #define LOG_TAG "LIBSYSCOMMON" #include "shared/log-macro.h" +#ifdef __cplusplus +} #endif + +#endif /* __LOG_H__ */