refactor adjtime function using adjtimex function instead of syscall
[musl] / src / internal / libm.h
index 5212bab..b5bd26b 100644 (file)
@@ -64,6 +64,29 @@ union ldshape {
 /* Support signaling NaNs.  */
 #define WANT_SNAN 0
 
+#if WANT_SNAN
+#error SNaN is unsupported
+#else
+#define issignalingf_inline(x) 0
+#define issignaling_inline(x) 0
+#endif
+
+#ifndef TOINT_INTRINSICS
+#define TOINT_INTRINSICS 0
+#endif
+
+#if TOINT_INTRINSICS
+/* Round x to nearest int in all rounding modes, ties have to be rounded
+   consistently with converttoint so the results match.  If the result
+   would be outside of [-2^31, 2^31-1] then the semantics is unspecified.  */
+static double_t roundtoint(double_t);
+
+/* Convert x to nearest int in all rounding modes, ties have to be rounded
+   consistently with roundtoint.  If the result is not representible in an
+   int32_t then the semantics is unspecified.  */
+static int32_t converttoint(double_t);
+#endif
+
 /* Helps static branch prediction so hot path can be better optimized.  */
 #ifdef __GNUC__
 #define predict_true(x) __builtin_expect(!!(x), 1)
@@ -131,7 +154,8 @@ static inline long double fp_barrierl(long double x)
 #define fp_force_evalf fp_force_evalf
 static inline void fp_force_evalf(float x)
 {
-       volatile float y = x;
+       volatile float y;
+       y = x;
 }
 #endif
 
@@ -139,7 +163,8 @@ static inline void fp_force_evalf(float x)
 #define fp_force_eval fp_force_eval
 static inline void fp_force_eval(double x)
 {
-       volatile double y = x;
+       volatile double y;
+       y = x;
 }
 #endif
 
@@ -147,7 +172,8 @@ static inline void fp_force_eval(double x)
 #define fp_force_evall fp_force_evall
 static inline void fp_force_evall(long double x)
 {
-       volatile long double y = x;
+       volatile long double y;
+       y = x;
 }
 #endif