summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-06-04 14:36:02 -0400
committerJakob Kaivo <jkk@ung.org>2024-06-04 14:36:02 -0400
commitfcc00236a16a2c32f1d0693dad580b6e6613dbf1 (patch)
treeca13070113c244d12648903236af02c87f123023
parente987f327d6c7991d14fb7661d4efe320c8ec7161 (diff)
add __fpclassify_error()
-rw-r--r--mk/__fpclassify_error.d9
-rw-r--r--src/math/__fpclassify_error.c12
2 files changed, 21 insertions, 0 deletions
diff --git a/mk/__fpclassify_error.d b/mk/__fpclassify_error.d
new file mode 100644
index 00000000..5b5efc4d
--- /dev/null
+++ b/mk/__fpclassify_error.d
@@ -0,0 +1,9 @@
+libc_C.0: libc.a(__fpclassify_error.o)
+libc.a(__fpclassify_error.o): $(OBJDIR)/__fpclassify_error.o
+ @$(AR) $(ARFLAGS) $@ $(OBJDIR)/$%
+
+$(OBJDIR)/__fpclassify_error.o: src/math/__fpclassify_error.c
+$(OBJDIR)/__fpclassify_error.o: src/_safety.h
+$(OBJDIR)/__fpclassify_error.o:
+ @mkdir -p $(@D)
+ $(CC) -c -o $@ $(CFLAGS) src/math/__fpclassify_error.c
diff --git a/src/math/__fpclassify_error.c b/src/math/__fpclassify_error.c
new file mode 100644
index 00000000..8684e8ae
--- /dev/null
+++ b/src/math/__fpclassify_error.c
@@ -0,0 +1,12 @@
+#include "_safety.h"
+
+int __fpclassify_error(void)
+{
+ UNDEFINED("Argument to fpclassify() macro was not a real floating type");
+ return 0;
+}
+
+/*
+STDC(0)
+SIGNAL_SAFE(0)
+*/