mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
refactor(linux): Unified libbsd handling
* Users can now use libbsd string.h and sys/cdefs.h functionality (e.g., strlcpy, containerof) on Linux by just including string.h or sys/cdefs.h. In other words, the includes are the same on the Linux target as well as on chips targets (ESP32, etc.). * libbsd linking is done by the linux component (belongs to common components) now instead of handling it separately in each component
This commit is contained in:
15
components/linux/linux_include/string.h
Normal file
15
components/linux/linux_include/string.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
* This header file also includes the additional libbsd string.h with functions such as strlcpy(),
|
||||
* which are present in the ESP-IDF toolchain and on MacOS, but not on Linux.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <bsd/string.h>
|
||||
#include_next <string.h>
|
Reference in New Issue
Block a user