Use C++ template for min/max

To be more friendly for off-device regression test.

Change-Id: I7edf4c9de73915aad9c1760ace7df3177ed3c4e9
diff --git a/native/src/defines.h b/native/src/defines.h
index 02c1fe0..9f237c5 100644
--- a/native/src/defines.h
+++ b/native/src/defines.h
@@ -240,8 +240,8 @@
 #define MIN_USER_TYPED_LENGTH_FOR_MULTIPLE_WORD_SUGGESTION 3
 #define MIN_USER_TYPED_LENGTH_FOR_EXCESSIVE_CHARACTER_SUGGESTION 3
 
-#define min(a,b) ((a)<(b)?(a):(b))
-#define max(a,b) ((a)>(b)?(a):(b))
+template<typename T> inline T min(T a, T b) { return a < b ? a : b; }
+template<typename T> inline T max(T a, T b) { return a > b ? a : b; }
 
 // The ratio of neutral area radius to sweet spot radius.
 #define NEUTRAL_AREA_RADIUS_RATIO 1.3f