summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbowgotsai <bowgotsai@google.com>2017-01-16 21:46:45 +0800
committerbowgotsai <bowgotsai@google.com>2017-01-25 20:47:37 +0800
commitd43cc68c4d4053f8b9855462e428b0749c088a17 (patch)
tree789db81d79485382756752eacc3ef18a2f79829e
parentde893939ec7b77427681244dddbd20f54eb96171 (diff)
downloadextras-d43cc68c4d4053f8b9855462e428b0749c088a17.tar.gz
Do not add macro min() definition for C++
It will have build error when the caller also includes <algorithm> in C++: external/libcxx/include/__undef_min_max: macro min is incompatible with C++ Bug: 34336098 Test: builds Change-Id: I984a24a8dfce6da5a1ad52594ef94ed97c67e9b8
-rw-r--r--ext4_utils/include/ext4_utils/ext4_utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext4_utils/include/ext4_utils/ext4_utils.h b/ext4_utils/include/ext4_utils/ext4_utils.h
index 0fbbdd31..75c72bbf 100644
--- a/ext4_utils/include/ext4_utils/ext4_utils.h
+++ b/ext4_utils/include/ext4_utils/ext4_utils.h
@@ -57,9 +57,11 @@ extern int force;
#define EXT4_JNL_BACKUP_BLOCKS 1
+#ifndef __cplusplus
#ifndef min /* already defined by windows.h */
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
+#endif
#define DIV_ROUND_UP(x, y) (((x) + (y) - 1)/(y))
#define EXT4_ALIGN(x, y) ((y) * DIV_ROUND_UP((x), (y)))