util: Allow functions to be called from c++ 10/189810/4
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 25 Sep 2018 11:38:58 +0000 (13:38 +0200)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Wed, 3 Oct 2018 09:22:41 +0000 (11:22 +0200)
Change-Id: If4dc6b6e494096713e76a1345ab3753a6914e1c2

src/shared/util.h

index c4aa1a6..03de693 100644 (file)
 #define __CONSTRUCTOR__ __attribute__ ((constructor))
 #endif
 
+#define fprintf_fd(fd, fmt, ...) dprintf(fd, fmt, ##__VA_ARGS__)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int system_command(char *command);
 
 int system_command_with_timeout(int timeout_seconds, char *command);
@@ -31,8 +37,6 @@ int system_command_parallel(char *command);
 
 int wait_system_command(int pid);
 
-#define fprintf_fd(fd, fmt, ...) dprintf(fd, fmt, ##__VA_ARGS__)
-
 int write_fd(int fd, const void *buf, int len);
 
 int copy_file(char *src, char *dst);
@@ -62,6 +66,11 @@ char* get_exe_path(pid_t pid);
 char* get_cmd_line(pid_t pid);
 
 char *nullvec2str(char *const vec[]);
+
+#ifdef __cplusplus
+}
+#endif
+
 /**
  * @}
  */