Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: fusl/src/fenv/__flt_rounds.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/src/fcntl/posix_fallocate.c ('k') | fusl/src/fenv/aarch64/fenv.s » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/fenv/__flt_rounds.c
diff --git a/fusl/src/fenv/__flt_rounds.c b/fusl/src/fenv/__flt_rounds.c
new file mode 100644
index 0000000000000000000000000000000000000000..ec0b3689e5ca2e093a8bac8608f12889b36f18db
--- /dev/null
+++ b/fusl/src/fenv/__flt_rounds.c
@@ -0,0 +1,19 @@
+#include <float.h>
+#include <fenv.h>
+
+int __flt_rounds()
+{
+ switch (fegetround()) {
+#ifdef FE_TOWARDZERO
+ case FE_TOWARDZERO: return 0;
+#endif
+ case FE_TONEAREST: return 1;
+#ifdef FE_UPWARD
+ case FE_UPWARD: return 2;
+#endif
+#ifdef FE_DOWNWARD
+ case FE_DOWNWARD: return 3;
+#endif
+ }
+ return -1;
+}
« no previous file with comments | « fusl/src/fcntl/posix_fallocate.c ('k') | fusl/src/fenv/aarch64/fenv.s » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698