OSDN Git Service

make ext4 utils callable from C++
authorDoug Zongker <dougz@android.com>
Fri, 28 Oct 2011 17:21:08 +0000 (10:21 -0700)
committerDoug Zongker <dougz@android.com>
Fri, 28 Oct 2011 17:21:08 +0000 (10:21 -0700)
Change-Id: I5a33cb1231428c045c23d74fdceb41b76bd0431e

ext4_utils/ext4_utils.h
ext4_utils/make_ext4fs.h

index 94f4bc9..bb9c09e 100644 (file)
 #ifndef _EXT4_UTILS_H_
 #define _EXT4_UTILS_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #define _FILE_OFFSET_BITS 64
 #define _LARGEFILE64_SOURCE
 #include <sys/types.h>
@@ -158,4 +164,8 @@ u64 get_file_size(const char *filename);
 u64 parse_num(const char *arg);
 void ext4_parse_sb(struct ext4_super_block *sb);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index adad58e..3053d71 100644 (file)
 #include "ext4_utils.h"
 #include "ext4.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void reset_ext4fs_info();
 int make_ext4fs(const char *filename, s64 len);
 int make_ext4fs_internal(const char *filename, const char *directory,
                          char *mountpoint, int android, int gzip, int sparse,
                          int crc, int wipe, int init_itabs);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif