2022-12-21 00:47:00 -05:00
|
|
|
/*
|
2024-03-06 02:21:10 -05:00
|
|
|
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
2022-12-21 00:47:00 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2024-03-06 02:21:10 -05:00
|
|
|
/*
|
|
|
|
* NOTE: This file is deprecated and will be removed in the future.
|
|
|
|
* Use include sys/cdefs.h instead, it will also include
|
|
|
|
* the corresponding libbsd header. TODO: IDF-9391
|
|
|
|
*/
|
|
|
|
|
2022-12-21 00:47:00 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2023-04-03 14:31:51 -04:00
|
|
|
#if CONFIG_IDF_TARGET_LINUX && !defined(__containerof)
|
2022-12-21 00:47:00 -05:00
|
|
|
#define __containerof(ptr, type, member) ({ \
|
|
|
|
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
|
|
|
(type *)( (char *)__mptr - offsetof(type,member) );})
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|