Skip to content

Commit 103b581

Browse files
committed
Fix error when umm_malloc.h is included from sketch (#1652)
1 parent 55e5bdf commit 103b581

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

cores/esp8266/umm_malloc/umm_malloc.h

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
#include "umm_malloc_cfg.h" /* user-dependent */
1414

15+
#ifdef __cplusplus
16+
extern "C" {
17+
#endif
18+
1519
typedef struct UMM_HEAP_INFO_t {
1620
unsigned short int totalEntries;
1721
unsigned short int usedEntries;
@@ -38,6 +42,9 @@ void umm_free( void *ptr );
3842

3943
size_t umm_free_heap_size( void );
4044

45+
#ifdef __cplusplus
46+
}
47+
#endif
4148

4249
/* ------------------------------------------------------------------------ */
4350

cores/esp8266/umm_malloc/umm_malloc_cfg.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include <debug.h>
99
#ifdef __cplusplus
10-
#extern "C" {
10+
extern "C" {
1111
#endif
1212
#include "c_types.h"
1313
#ifdef __cplusplus

tests/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
hardware
2+
tmp
3+
.env
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// test that we can include umm_malloc.h from sketch (#1652)
2+
#include <umm_malloc/umm_malloc.h>
3+
4+
5+
void setup() {
6+
Serial.begin(115200);
7+
delay(1000);
8+
umm_info(NULL, 1);
9+
}
10+
11+
void loop() {
12+
13+
}

0 commit comments

Comments
 (0)