Skip to content

Commit 577d777

Browse files
committed
Add C++ guards to public headers
Fixes #53 Fixes #32
1 parent c72d252 commit 577d777

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

emubd/lfs_emubd.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
#include "lfs.h"
1111
#include "lfs_util.h"
1212

13+
#ifdef __cplusplus
14+
extern "C"
15+
{
16+
#endif
17+
1318

1419
// Config options
1520
#ifndef LFS_EMUBD_READ_SIZE
@@ -75,4 +80,8 @@ int lfs_emubd_erase(const struct lfs_config *cfg, lfs_block_t block);
7580
int lfs_emubd_sync(const struct lfs_config *cfg);
7681

7782

83+
#ifdef __cplusplus
84+
} /* extern "C" */
85+
#endif
86+
7887
#endif

lfs.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
#include <stdint.h>
1111
#include <stdbool.h>
1212

13+
#ifdef __cplusplus
14+
extern "C"
15+
{
16+
#endif
17+
1318

1419
/// Version info ///
1520

@@ -460,4 +465,8 @@ int lfs_traverse(lfs_t *lfs, int (*cb)(void*, lfs_block_t), void *data);
460465
int lfs_deorphan(lfs_t *lfs);
461466

462467

468+
#ifdef __cplusplus
469+
} /* extern "C" */
470+
#endif
471+
463472
#endif

lfs_util.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
#include <stdio.h>
3535
#endif
3636

37+
#ifdef __cplusplus
38+
extern "C"
39+
{
40+
#endif
41+
3742

3843
// Macros, may be replaced by system specific wrappers. Arguments to these
3944
// macros must not have side-effects as the macros can be removed for a smaller
@@ -173,5 +178,9 @@ static inline void lfs_free(void *p) {
173178
}
174179

175180

181+
#ifdef __cplusplus
182+
} /* extern "C" */
183+
#endif
184+
176185
#endif
177186
#endif

0 commit comments

Comments
 (0)