|
From: openocd-gerrit <ope...@us...> - 2023-04-07 23:02:20
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 561f27fde9dc51f014b672c227dc7c8ca2530fcf (commit)
from 7e0797d19ac1837e3001df9d45030b5eb97ca36d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 561f27fde9dc51f014b672c227dc7c8ca2530fcf
Author: Antonio Borneo <bor...@gm...>
Date: Sun Apr 2 14:24:23 2023 +0200
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 <bor...@gm...>
Reported-by: Erhan Kurubas <erh...@es...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7571
Reviewed-by: Erhan Kurubas <erh...@es...>
Tested-by: jenkins
diff --git a/src/helper/compiler.h b/src/helper/compiler.h
index 33a075d64..312d261fc 100644
--- a/src/helper/compiler.h
+++ b/src/helper/compiler.h
@@ -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
-----------------------------------------------------------------------
Summary of changes:
src/helper/compiler.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|