Skip to content

Commit e1d6500

Browse files
committed
Add functions stub for compatibility with very minimal libc
In case the user needs to call the functions from Print/String, these placeholders should be implemented (with C++ scope)
1 parent 5b9faf6 commit e1d6500

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

api/Print.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
using namespace arduino;
2727

2828
// Public Methods //////////////////////////////////////////////////////////////
29+
#ifdef __VERY_MINIMAL_LIBC__
30+
// These functions should be implemented in the user code (C++)
31+
bool isnan(float x);
32+
bool isinf(float x);
33+
#endif
2934

3035
/* default implementation: may be overridden */
3136
size_t Print::write(const uint8_t *buffer, size_t size)

api/String.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626

2727
#include <float.h>
2828

29+
#ifdef __VERY_MINIMAL_LIBC__
30+
// These functions should be implemented in the user code (C++)
31+
long atol(char* c);
32+
float atof(char* c);
33+
#endif
34+
2935
namespace arduino {
3036

3137
/*********************************************/

0 commit comments

Comments
 (0)