Browse Source

do not redefine INFINITY

Xℹ Ruoyao 4 years ago
parent
commit
16fc0ef9d4
1 changed files with 6 additions and 2 deletions
  1. 6 2
      jump_rope_count_device.c

+ 6 - 2
jump_rope_count_device.c

@@ -18,7 +18,9 @@ float _fmodf(float x, float y)
 }
 #define fmodf _fmodf
 
-/* Before C99, INFINITY is not avaliable.  */
+/* Before C99, INFINITY may be unavaliable.  */
+#ifndef INFINITY
+
 #if defined __GNUC__ && (__GNUC__ > 3 || \
 			 (__GNUC__ == 3 && __GNUC_MINOR >= 3))
 #define INFINITY (__builtin_inff())
@@ -26,7 +28,9 @@ float _fmodf(float x, float y)
 #define INFINITY 1e10000f
 #endif
 
-#endif
+#endif /* INFINITY */
+
+#endif /* __STDC_VERSION__ < 199901L */
 
 static int less(float a, float b)
 {