Skip to content

Commit

Permalink
cpu/esp32: fix C linkage compilatio error
Browse files Browse the repository at this point in the history
With the new toolchain version required to fix issue RIOT-OS#13133, the compilation of `examples/posix_socket` fails due to a C linkage error in `atomic_base.h`. The reason is that including `drivers/include/mtd.h` in `boards/esp32/board_common.h` inside the `extern C` block finally leads to including `atomic_base.h` inside the `extern C` block which in turn to the C linkage error for the template definitions in this file.
  • Loading branch information
gschorcht committed Jan 16, 2020
1 parent 3672502 commit 416e8ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions boards/common/esp32/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@
#include "periph/gpio.h"
#include "sdk_conf.h"

#if MODULE_MTD
#include "mtd.h"
#endif

#ifdef __cplusplus
extern "C" {
extern "C" {
#endif

/**
Expand Down Expand Up @@ -103,7 +107,6 @@
* Built-in SPI flash memory is used as MTD system drive.
* @{
*/
#include "mtd.h"

/**
* @brief MTD drive start address in SPI flash memory
Expand Down
4 changes: 2 additions & 2 deletions cpu/esp32/include/sdk_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

#ifndef DOXYGEN

#include "board.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "board.h"

/**
* @brief Defines the CPU frequency [values = 2, 40, 80, 160 and 240]
*/
Expand Down

0 comments on commit 416e8ce

Please sign in to comment.