libc: change some math debugging

This commit is contained in:
K. Lange 2018-11-08 15:23:40 +09:00
parent be02291b53
commit b73316b5f5
2 changed files with 7 additions and 2 deletions

View File

@ -2,7 +2,8 @@
#include <stdio.h>
#include <stdlib.h>
#define BAD do { if (getenv("LIBM_DEBUG")) { fprintf(stderr, "Called bad math function %s\n", __func__); } } while (0)
extern char * _argv_0;
#define BAD do { if (getenv("LIBM_DEBUG")) { fprintf(stderr, "%s called bad math function %s\n", _argv_0, __func__); } } while (0)
double acos(double x) {
BAD;

View File

@ -3,8 +3,12 @@
#include <string.h>
#include <stdio.h>
//#define MATH do { fprintf(stderr, "Executed math function %s\n", __func__); } while (0)
#if 0
extern char * _argv_0;
#define MATH do { if (getenv("LIBM_DEBUG")) { fprintf(stderr, "%s called math function %s\n", _argv_0, __func__); } } while (0)
#else
#define MATH (void)0
#endif
double exp(double x) {
return pow(2.71828182846, x);