Skip to content

Commit 81c9edb

Browse files
committed
Fix math functions calling themselves recursively (#233, #354)
1 parent d506dac commit 81c9edb

File tree

1 file changed

+2
-69
lines changed

1 file changed

+2
-69
lines changed

hardware/esp8266com/esp8266/cores/esp8266/libc_replacements.c

+2-69
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "osapi.h"
3737
#include "mem.h"
3838
#include "user_interface.h"
39+
#include "debug.h"
3940

4041
void* malloc(size_t size) {
4142
size = ((size + 3) & ~((size_t)0x3));
@@ -471,75 +472,7 @@ int isblank(int c) {
471472
static int errno_var = 0;
472473

473474
int* ICACHE_FLASH_ATTR __errno(void) {
474-
os_printf("__errno is called last error: %d (not current)\n", errno_var);
475+
DEBUGV("__errno is called last error: %d (not current)\n", errno_var);
475476
return &errno_var;
476477
}
477478

478-
// ##########################################################################
479-
// __ieee754 functions
480-
// ##########################################################################
481-
482-
double ICACHE_FLASH_ATTR __ieee754_sinh(double x) {
483-
return sinh(x);
484-
}
485-
486-
double ICACHE_FLASH_ATTR __ieee754_hypot(double x, double y) {
487-
return hypot(x, y);
488-
}
489-
490-
float ICACHE_FLASH_ATTR __ieee754_hypotf(float x, float y) {
491-
return hypotf(x, y);
492-
}
493-
494-
float ICACHE_FLASH_ATTR __ieee754_logf(float x) {
495-
return logf(x);
496-
}
497-
498-
double ICACHE_FLASH_ATTR __ieee754_log10(double x) {
499-
return log10(x);
500-
}
501-
502-
double ICACHE_FLASH_ATTR __ieee754_exp(double x) {
503-
return exp(x);
504-
}
505-
506-
double ICACHE_FLASH_ATTR __ieee754_cosh(double x) {
507-
return cosh(x);
508-
}
509-
510-
float ICACHE_FLASH_ATTR __ieee754_expf(float x) {
511-
return expf(x);
512-
}
513-
514-
float ICACHE_FLASH_ATTR __ieee754_log10f(float x) {
515-
return log10f(x);
516-
}
517-
518-
double ICACHE_FLASH_ATTR __ieee754_atan2(double x, double y) {
519-
return atan2(x, y);
520-
}
521-
522-
float ICACHE_FLASH_ATTR __ieee754_sqrtf(float x) {
523-
return sqrtf(x);
524-
}
525-
526-
float ICACHE_FLASH_ATTR __ieee754_sinhf(float x) {
527-
return sinhf(x);
528-
}
529-
530-
double ICACHE_FLASH_ATTR __ieee754_log(double x) {
531-
return log(x);
532-
}
533-
534-
double ICACHE_FLASH_ATTR __ieee754_sqrt(double x) {
535-
return sqrt(x);
536-
}
537-
538-
float ICACHE_FLASH_ATTR __ieee754_coshf(float x) {
539-
return coshf(x);
540-
}
541-
542-
float ICACHE_FLASH_ATTR __ieee754_atan2f(float x, float y) {
543-
return atan2f(x, y);
544-
}
545-

0 commit comments

Comments
 (0)