helper/compiler fix build with gcc on MacOS
On MacOS libc includes files from MacOSX.sdk that define the macro #define __nonnull without arguments, causing compile error. Extend the existing check for clang on MacOS and undefine the macro for gcc too. Change-Id: Ic99de78348c6aa86561212a3aded9342e5d32e02 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reported-by: Erhan Kurubas <erhan.kurubas@espressif.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7571 Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com> Tested-by: jenkins
This commit is contained in:
parent
7e0797d19a
commit
561f27fde9
|
@ -36,9 +36,11 @@
|
|||
* clang for Apple defines
|
||||
* #define __nonnull _Nonnull
|
||||
* that is a per argument attribute, incompatible with the gcc per function attribute __nonnull__.
|
||||
* Undefine it to keep compatibility among compilers.
|
||||
* gcc for Apple includes sys/cdefs.h from MacOSX.sdk that defines
|
||||
* #define __nonnull
|
||||
* In both cases, undefine __nonnull to keep compatibility among compilers and platforms.
|
||||
*/
|
||||
#if defined(__clang__) && defined(__APPLE__)
|
||||
#if defined(__APPLE__)
|
||||
# undef __nonnull
|
||||
#endif
|
||||
#ifndef __nonnull
|
||||
|
|
Loading…
Reference in New Issue