OSDN Git Service

ext4_utils: Fix warning when compiling C++ code
authorTom Marshall <tdm@cyngn.com>
Mon, 14 Dec 2015 19:20:47 +0000 (11:20 -0800)
committerMichael Bestas <mikeioannina@gmail.com>
Sun, 1 Jan 2017 23:30:04 +0000 (01:30 +0200)
 * Fixes "#warning: macro min is incompatible with C++.  #undefing min"

Change-Id: I2d7a0fd6c7babd0abd5e4c0ece55432f9ea37e95

ext4_utils/ext4_utils.h

index 188976f..c493705 100644 (file)
@@ -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)))