emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 27bb4de: Port cleanup attribute to Oracle Studio 12


From: Paul Eggert
Subject: [Emacs-diffs] master 27bb4de: Port cleanup attribute to Oracle Studio 12.5
Date: Tue, 13 Jun 2017 21:20:12 -0400 (EDT)

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

    Port cleanup attribute to Oracle Studio 12.5
    
    * INSTALL (--with-modules): List cleanup attribute as prereq.
    * src/conf_post.h (__has_attribute_cleanup): Remove; no longer needed.
    * src/emacs-module.c (MODULE_SETJMP_1): Don’t attempt to verify
    (__has_attribute (cleanup)), as Oracle Studio 12.5 supports
    __has_attribute only inside preprocessor expressions.  The C
    compiler should check the cleanup attribute in the next line anyway.
    (module_reset_handlerlist): Remove an unnecessary ‘const’
    that causes Oracle Studio 12.5 to refuse to compile.
---
 INSTALL            | 5 +++--
 src/conf_post.h    | 1 -
 src/emacs-module.c | 5 ++---
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/INSTALL b/INSTALL
index a99f107..b569cf1 100644
--- a/INSTALL
+++ b/INSTALL
@@ -322,8 +322,9 @@ typical 32-bit host, Emacs integers have 62 bits instead of 
30.
 
 Use --with-cairo to compile Emacs with Cairo drawing.
 
-Use --with-modules to build Emacs with support for loading dynamic
-modules.
+Use --with-modules to build Emacs with support for dynamic modules.
+This needs a C compiler that supports '__attribute__ ((cleanup (...)))',
+as in GCC 3.4 and later.
 
 Use --enable-gcc-warnings to enable compile-time checks that warn
 about possibly-questionable C code.  This is intended for developers
diff --git a/src/conf_post.h b/src/conf_post.h
index 5e1d845..18b096e 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -61,7 +61,6 @@ typedef bool bool_bf;
 #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 9be481a..de62329 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -127,7 +127,7 @@ static void module_non_local_exit_signal_1 (emacs_env *,
 static void module_non_local_exit_throw_1 (emacs_env *,
                                           Lisp_Object, Lisp_Object);
 static void module_out_of_memory (emacs_env *);
-static void module_reset_handlerlist (struct handler *const *);
+static void module_reset_handlerlist (struct handler **);
 
 /* We used to return NULL when emacs_value was a different type from
    Lisp_Object, but nowadays we just use Qnil instead.  Although they
@@ -191,7 +191,6 @@ static struct emacs_env_private global_env_private;
       module_out_of_memory (env);                                      \
       return retval;                                                   \
     }                                                                  \
-  verify (__has_attribute (cleanup));                                   \
   struct handler *c __attribute__ ((cleanup (module_reset_handlerlist))) \
     = c0;                                                              \
   if (sys_setjmp (c->jmp))                                             \
@@ -1144,7 +1143,7 @@ mark_modules (void)
    function to be called automatically.  PHANDLERLIST points to a word
    containing the handler list, for sanity checking.  */
 static void
-module_reset_handlerlist (struct handler *const *phandlerlist)
+module_reset_handlerlist (struct handler **phandlerlist)
 {
   eassert (handlerlist == *phandlerlist);
   handlerlist = handlerlist->next;



reply via email to

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