mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-28 03:23:14 +00:00
30 lines
514 B
C
30 lines
514 B
C
/*
|
|
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
#pragma once
|
|
#include_next "stdatomic.h"
|
|
#ifndef __clang__
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#pragma GCC diagnostic push
|
|
#pragma GCC diagnostic ignored "-Wshadow"
|
|
|
|
static inline bool __atomic_test_and_set(volatile void *ptr, int memorder)
|
|
{
|
|
return __atomic_exchange_1((bool *)ptr, true, memorder);
|
|
}
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|