emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master d715e6d: Port cleanup check to Oracle Studio 12.5


From: Paul Eggert
Subject: [Emacs-diffs] master d715e6d: Port cleanup check to Oracle Studio 12.5
Date: Wed, 14 Jun 2017 14:01:46 -0400 (EDT)

branch: master
commit d715e6d8c6a7f3507f4faca0961ac87d58fbfab8
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Port cleanup check to Oracle Studio 12.5
    
    * src/conf_post.h (__has_attribute_cleanup): Resurrect.
    * src/emacs-module.c: Verify __has_attribute (cleanup), but in an
    #if this time.
---
 src/conf_post.h    | 5 ++++-
 src/emacs-module.c | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/conf_post.h b/src/conf_post.h
index 18b096e..e1d6a93 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -57,10 +57,13 @@ typedef bool bool_bf;
 #endif
 
 /* Simulate __has_attribute on compilers that lack it.  It is used only
-   on arguments like alloc_size that are handled in this simulation.  */
+   on arguments like alloc_size that are handled in this simulation.
+   __has_attribute should be used only in #if expressions, as Oracle
+   Studio 12.5's __has_attribute does not work in plain code.  */
 #ifndef __has_attribute
 # define __has_attribute(a) __has_attribute_##a
 # define __has_attribute_alloc_size GNUC_PREREQ (4, 3, 0)
+# define __has_attribute_cleanup GNUC_PREREQ (3, 4, 0)
 # define __has_attribute_externally_visible GNUC_PREREQ (4, 1, 0)
 # define __has_attribute_no_address_safety_analysis false
 # define __has_attribute_no_sanitize_address GNUC_PREREQ (4, 8, 0)
diff --git a/src/emacs-module.c b/src/emacs-module.c
index de62329..5c413ee 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -170,6 +170,10 @@ static struct emacs_env_private global_env_private;
                   internal_handler_##handlertype,                             \
                   internal_cleanup_##handlertype)
 
+#if !__has_attribute (cleanup)
+ #error "__attribute__ ((cleanup)) not supported by this compiler; try GCC"
+#endif
+
 /* It is very important that pushing the handler doesn't itself raise
    a signal.  Install the cleanup only after the handler has been
    pushed.  Use __attribute__ ((cleanup)) to avoid



reply via email to

[Prev in Thread] Current Thread [Next in Thread]