mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 13:44:32 +02:00
Fix portGET_ARGUMENT_COUNT macro
portGET_ARGUMENT_COUNT uses a GCC extension ##__VA_ARGS__. It forces the user to compile the code with GNU extensions enabled instead of ISO language standard. The suggested change is to replace ##__VA_ARGS__ with __VA_OPT__(,) __VA_ARGS__ which is supported by the current version of GCC used in ESP-IDF for both C and C++ ISO standards. This fix would enable ESP-IDF users to compile their code with ISO C++20 standard in future releases. Signed-off-by: Jakob Hasse <jakob.hasse@espressif.com>
This commit is contained in:
committed by
Jakob Hasse
parent
afe14a5ed2
commit
1d74652b5e
@@ -312,7 +312,7 @@ void _frxt_setup_switch( void );
|
||||
* Macro to count number of arguments of a __VA_ARGS__ used to support portYIELD_FROM_ISR with,
|
||||
* or without arguments.
|
||||
*/
|
||||
#define portGET_ARGUMENT_COUNT(...) portGET_ARGUMENT_COUNT_INNER(0, ##__VA_ARGS__,1,0)
|
||||
#define portGET_ARGUMENT_COUNT(...) portGET_ARGUMENT_COUNT_INNER(0 __VA_OPT__(,) __VA_ARGS__,1,0)
|
||||
#define portGET_ARGUMENT_COUNT_INNER(zero, one, count, ...) count
|
||||
|
||||
_Static_assert(portGET_ARGUMENT_COUNT() == 0, "portGET_ARGUMENT_COUNT() result does not match for 0 arguments");
|
||||
|
Reference in New Issue
Block a user