Merge "Fix mac build." am: 5da045dc1a
am: 2cefddbce5
Change-Id: I5027f40f9d13186a8670712b9f44105b3329ee5f
diff --git a/ext4_utils/ext4_utils.c b/ext4_utils/ext4_utils.c
index 07a9211..8609851 100644
--- a/ext4_utils/ext4_utils.c
+++ b/ext4_utils/ext4_utils.c
@@ -632,7 +632,7 @@
printf(" Inodes per group: %d\n", info.inodes_per_group);
printf(" Inode size: %d\n", info.inode_size);
printf(" Label: %s\n", info.label);
- printf(" Blocks: %"PRIu64"\n", aux_info.len_blocks);
+ printf(" Blocks: %"PRIext4u64"\n", aux_info.len_blocks);
printf(" Block groups: %d\n", aux_info.groups);
printf(" Reserved block group size: %d\n", info.bg_desc_reserve_blocks);
printf(" Used %d/%d inodes and %d/%d blocks\n",
diff --git a/ext4_utils/extent.c b/ext4_utils/extent.c
index ff56a14..3cdf660 100644
--- a/ext4_utils/extent.c
+++ b/ext4_utils/extent.c
@@ -150,7 +150,7 @@
if (((int)(info.block_size - sizeof(struct ext4_extent_header) /
sizeof(struct ext4_extent))) < allocation_len) {
- error("File size %"PRIu64" is too big to fit in a single extent block\n",
+ error("File size %"PRIext4u64" is too big to fit in a single extent block\n",
len);
return NULL;
}
@@ -206,14 +206,14 @@
alloc = do_inode_allocate_extents(inode, len, NULL);
if (alloc == NULL) {
- error("failed to allocate extents for %"PRIu64" bytes", len);
+ error("failed to allocate extents for %"PRIext4u64" bytes", len);
return NULL;
}
if (backing_len) {
data = extent_create_backing(alloc, backing_len);
if (!data)
- error("failed to create backing for %"PRIu64" bytes", backing_len);
+ error("failed to create backing for %"PRIext4u64" bytes", backing_len);
}
free_alloc(alloc);
@@ -247,7 +247,7 @@
alloc = do_inode_allocate_extents(inode, len, prealloc);
if (alloc == NULL) {
- error("failed to allocate extents for %"PRIu64" bytes", len);
+ error("failed to allocate extents for %"PRIext4u64" bytes", len);
return NULL;
}
@@ -262,7 +262,7 @@
alloc = do_inode_allocate_extents(inode, len, NULL);
if (alloc == NULL) {
- error("failed to allocate extents for %"PRIu64" bytes", len);
+ error("failed to allocate extents for %"PRIext4u64" bytes", len);
return;
}
diff --git a/ext4_utils/include/ext4_utils/ext4_utils.h b/ext4_utils/include/ext4_utils/ext4_utils.h
index 75c72bb..17a8056 100644
--- a/ext4_utils/include/ext4_utils/ext4_utils.h
+++ b/ext4_utils/include/ext4_utils/ext4_utils.h
@@ -75,9 +75,13 @@
#ifdef __LP64__
typedef unsigned long u64;
typedef signed long s64;
+
+#define PRIext4u64 "lu"
#else
typedef unsigned long long u64;
typedef signed long long s64;
+
+#define PRIext4u64 PRIu64
#endif
typedef unsigned int u32;
typedef unsigned short int u16;
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index e550ac2..077899a 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -816,7 +816,7 @@
ext4_create_fs_aux_info();
- printf(" Blocks: %"PRIu64"\n", aux_info.len_blocks);
+ printf(" Blocks: %"PRIext4u64"\n", aux_info.len_blocks);
printf(" Block groups: %d\n", aux_info.groups);
printf(" Reserved block group size: %d\n", info.bg_desc_reserve_blocks);