You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2024/05/15 13:34:53 UTC
svn commit: r1917741 - in /apr/apr/trunk/include: apr.h.in apr.hnw apr.hw apr.hwc
Author: ylavic
Date: Wed May 15 13:34:53 2024
New Revision: 1917741
URL: http://svn.apache.org/viewvc?rev=1917741&view=rev
Log:
apr.h: __attribute__ and __has_attribute exist for !__GNUC__ compilers. PR 69009.
There are more compilers than __GNUC__ that provide __attribute__ so let's not
no-op it based on (un)known compilers but simply if it's not already defined
(it should be provided as a pre-defined macro if defined by the compiler).
While at, do the same for __has_attribute.
Submitted by: Petr Sumbera <petr.sumbera oracle.com>
Modified:
apr/apr/trunk/include/apr.h.in
apr/apr/trunk/include/apr.hnw
apr/apr/trunk/include/apr.hw
apr/apr/trunk/include/apr.hwc
Modified: apr/apr/trunk/include/apr.h.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.h.in?rev=1917741&r1=1917740&r2=1917741&view=diff
==============================================================================
--- apr/apr/trunk/include/apr.h.in (original)
+++ apr/apr/trunk/include/apr.h.in Wed May 15 13:34:53 2024
@@ -59,15 +59,18 @@
#if !defined(__GNUC__) || __GNUC__ < 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
defined(NEXT)
-#ifndef __attribute__
-#define __attribute__(__x)
-#endif
#define APR_INLINE
#define APR_HAS_INLINE 0
#else
#define APR_INLINE __inline__
#define APR_HAS_INLINE 1
#endif
+#ifndef __has_attribute
+#define __has_attribute(__x) 0
+#endif
+#ifndef __attribute__
+#define __attribute__(__x)
+#endif
#define APR_HAVE_ARPA_INET_H @arpa_ineth@
#define APR_HAVE_CONIO_H @conioh@
Modified: apr/apr/trunk/include/apr.hnw
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.hnw?rev=1917741&r1=1917740&r2=1917741&view=diff
==============================================================================
--- apr/apr/trunk/include/apr.hnw (original)
+++ apr/apr/trunk/include/apr.hnw Wed May 15 13:34:53 2024
@@ -75,6 +75,9 @@ extern "C" {
#define APR_INLINE
#define APR_HAS_INLINE 0
+#ifndef __has_attribute
+#define __has_attribute(__x) 0
+#endif
#ifndef __attribute__
#define __attribute__(__x)
#endif
Modified: apr/apr/trunk/include/apr.hw
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.hw?rev=1917741&r1=1917740&r2=1917741&view=diff
==============================================================================
--- apr/apr/trunk/include/apr.hw (original)
+++ apr/apr/trunk/include/apr.hw Wed May 15 13:34:53 2024
@@ -107,21 +107,21 @@
#if defined(_MSC_VER)
#define APR_INLINE __inline
#define APR_HAS_INLINE 1
-#ifndef __attribute__
-#define __attribute__(__x)
-#endif
#elif !defined(__GNUC__) || __GNUC__ < 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
defined(NEXT)
-#ifndef __attribute__
-#define __attribute__(__x)
-#endif
#define APR_INLINE
#define APR_HAS_INLINE 0
#else
#define APR_INLINE __inline__
#define APR_HAS_INLINE 1
#endif
+#ifndef __has_attribute
+#define __has_attribute(__x) 0
+#endif
+#ifndef __attribute__
+#define __attribute__(__x)
+#endif
#define APR_HAVE_ARPA_INET_H 0
#define APR_HAVE_CONIO_H 1
Modified: apr/apr/trunk/include/apr.hwc
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr.hwc?rev=1917741&r1=1917740&r2=1917741&view=diff
==============================================================================
--- apr/apr/trunk/include/apr.hwc (original)
+++ apr/apr/trunk/include/apr.hwc Wed May 15 13:34:53 2024
@@ -97,21 +97,21 @@
#if defined(_MSC_VER)
#define APR_INLINE __inline
#define APR_HAS_INLINE 1
-#ifndef __attribute__
-#define __attribute__(__x)
-#endif
#elif !defined(__GNUC__) || __GNUC__ < 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
defined(NEXT)
-#ifndef __attribute__
-#define __attribute__(__x)
-#endif
#define APR_INLINE
#define APR_HAS_INLINE 0
#else
#define APR_INLINE __inline__
#define APR_HAS_INLINE 1
#endif
+#ifndef __has_attribute
+#define __has_attribute(__x) 0
+#endif
+#ifndef __attribute__
+#define __attribute__(__x)
+#endif
#define APR_HAVE_ARPA_INET_H 0
#define APR_HAVE_CONIO_H 1