mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
03109eb013
Before newlib 3.3.0, <dirent.h> bundled in newlib did not include any function declarations. Instead, the file included the platform- specific <sys/dirent.h>. This inclusion was inside a C++ guard block. ESP-IDF provided sys/dirent.h inside newlib component, and this file contained all the necessary function and structure declarations. Since https://github.com/espressif/newlib-esp32/commit/da418955f5dca2f8570561c5dd6e79e25ebaeba2, common function declarations have been added to <dirent.h> in newlib. However, the inclusion of sys/dirent.h has been moved out of the C++ guard block. However we didn't notice this change and did not update sys/dirent.h in ESP-IDF newlib component to and the now-required C++ guards there. This commit adds the missing C++ guards to the platform-specific sys/dirent.h. The declarations of common dirent.h functions are now present both in <dirent.h> (provided by newlib) and in sys/dirent.h (provided by IDF). We keep the declarations in sys/dirent.h for compatibility, since some ESP-IDF files and applications may include <sys/dirent.h> directly, rather than <dirent.h>. Closes https://github.com/espressif/esp-idf/issues/7204