Allow compile under Windows Subsystem for Linux (#15606)

This commit is contained in:
Marcio T 2019-10-24 13:57:20 -06:00 committed by Scott Lahteine
parent 82fb046013
commit f6a799c7b3
2 changed files with 9 additions and 1 deletions

View file

@ -38,6 +38,14 @@
#include <avr/interrupt.h>
#include <avr/io.h>
#ifndef pgm_read_ptr
// Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for
// Windows Subsystem for Linux on Windows 10 as of 10/18/2019
#define pgm_read_ptr_far(address_long) (void*)__ELPM_word((uint32_t)(address_long))
#define pgm_read_ptr_near(address_short) (void*)__LPM_word((uint16_t)(address_short))
#define pgm_read_ptr(address_short) pgm_read_ptr_near(address_short)
#endif
// ------------------------
// Defines
// ------------------------

View file

@ -279,7 +279,7 @@
#define ATAN2(y, x) atan2f(y, x)
#define POW(x, y) powf(x, y)
#define SQRT(x) sqrtf(x)
#define RSQRT(x) (1 / sqrtf(x))
#define RSQRT(x) (1.0f / sqrtf(x))
#define CEIL(x) ceilf(x)
#define FLOOR(x) floorf(x)
#define LROUND(x) lroundf(x)