Add optional warnings to bad libm functions

This commit is contained in:
K. Lange 2018-09-21 20:36:05 +09:00
parent 9dbfa0fe87
commit 379b262d64

View File

@ -1,22 +1,31 @@
/* STUB MATH LIBRARY */
#include <stdio.h>
#include <stdlib.h>
#define BAD do { if (getenv("LIBM_DEBUG")) { fprintf(stderr, "Called bad math function %s\n", __func__); } } while (0)
double acos(double x) {
BAD;
return 0.0;
}
double asin(double x) {
BAD;
return 0.0;
}
double atan(double x) {
BAD;
return 0.0;
}
double ceil(double x) {
BAD;
return 0.0; /* extract and convert? */
}
double cosh(double x) {
BAD;
return 0.0;
}
@ -30,26 +39,32 @@ double ldexp(double a, int exp) {
}
double log(double x) {
BAD;
return 0.0;
}
double log10(double x) {
BAD;
return 0.0;
}
double log2(double x) {
BAD;
return 0.0;
}
double sinh(double x) {
BAD;
return 0.0;
}
double tan(double x) {
BAD;
return 0.0;
}
double tanh(double x) {
BAD;
return 0.0;
}