aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2017-06-13 18:19:30 -0700
committerPaul Eggert2017-06-13 18:20:07 -0700
commit27bb4de72bedaa5fdecae24069ea7db1cfd0b5d4 (patch)
treea486e05371d45dbc76376bcefc64aceff6485b8d
parent510a67428071ef06375c75506bdc6afa151f4c91 (diff)
downloademacs-27bb4de72bedaa5fdecae24069ea7db1cfd0b5d4.tar.gz
emacs-27bb4de72bedaa5fdecae24069ea7db1cfd0b5d4.zip
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.
-rw-r--r--INSTALL5
-rw-r--r--src/conf_post.h1
-rw-r--r--src/emacs-module.c5
3 files changed, 5 insertions, 6 deletions
diff --git a/INSTALL b/INSTALL
index a99f1078044..b569cf116c5 100644
--- a/INSTALL
+++ b/INSTALL
@@ -322,8 +322,9 @@ typical 32-bit host, Emacs integers have 62 bits instead of 30.
322 322
323Use --with-cairo to compile Emacs with Cairo drawing. 323Use --with-cairo to compile Emacs with Cairo drawing.
324 324
325Use --with-modules to build Emacs with support for loading dynamic 325Use --with-modules to build Emacs with support for dynamic modules.
326modules. 326This needs a C compiler that supports '__attribute__ ((cleanup (...)))',
327as in GCC 3.4 and later.
327 328
328Use --enable-gcc-warnings to enable compile-time checks that warn 329Use --enable-gcc-warnings to enable compile-time checks that warn
329about possibly-questionable C code. This is intended for developers 330about possibly-questionable C code. This is intended for developers
diff --git a/src/conf_post.h b/src/conf_post.h
index 5e1d8457deb..18b096e2cf6 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -61,7 +61,6 @@ typedef bool bool_bf;
61#ifndef __has_attribute 61#ifndef __has_attribute
62# define __has_attribute(a) __has_attribute_##a 62# define __has_attribute(a) __has_attribute_##a
63# define __has_attribute_alloc_size GNUC_PREREQ (4, 3, 0) 63# define __has_attribute_alloc_size GNUC_PREREQ (4, 3, 0)
64# define __has_attribute_cleanup GNUC_PREREQ (3, 4, 0)
65# define __has_attribute_externally_visible GNUC_PREREQ (4, 1, 0) 64# define __has_attribute_externally_visible GNUC_PREREQ (4, 1, 0)
66# define __has_attribute_no_address_safety_analysis false 65# define __has_attribute_no_address_safety_analysis false
67# define __has_attribute_no_sanitize_address GNUC_PREREQ (4, 8, 0) 66# define __has_attribute_no_sanitize_address GNUC_PREREQ (4, 8, 0)
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 9be481a271e..de62329b3b8 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 *,
127static void module_non_local_exit_throw_1 (emacs_env *, 127static void module_non_local_exit_throw_1 (emacs_env *,
128 Lisp_Object, Lisp_Object); 128 Lisp_Object, Lisp_Object);
129static void module_out_of_memory (emacs_env *); 129static void module_out_of_memory (emacs_env *);
130static void module_reset_handlerlist (struct handler *const *); 130static void module_reset_handlerlist (struct handler **);
131 131
132/* We used to return NULL when emacs_value was a different type from 132/* We used to return NULL when emacs_value was a different type from
133 Lisp_Object, but nowadays we just use Qnil instead. Although they 133 Lisp_Object, but nowadays we just use Qnil instead. Although they
@@ -191,7 +191,6 @@ static struct emacs_env_private global_env_private;
191 module_out_of_memory (env); \ 191 module_out_of_memory (env); \
192 return retval; \ 192 return retval; \
193 } \ 193 } \
194 verify (__has_attribute (cleanup)); \
195 struct handler *c __attribute__ ((cleanup (module_reset_handlerlist))) \ 194 struct handler *c __attribute__ ((cleanup (module_reset_handlerlist))) \
196 = c0; \ 195 = c0; \
197 if (sys_setjmp (c->jmp)) \ 196 if (sys_setjmp (c->jmp)) \
@@ -1144,7 +1143,7 @@ mark_modules (void)
1144 function to be called automatically. PHANDLERLIST points to a word 1143 function to be called automatically. PHANDLERLIST points to a word
1145 containing the handler list, for sanity checking. */ 1144 containing the handler list, for sanity checking. */
1146static void 1145static void
1147module_reset_handlerlist (struct handler *const *phandlerlist) 1146module_reset_handlerlist (struct handler **phandlerlist)
1148{ 1147{
1149 eassert (handlerlist == *phandlerlist); 1148 eassert (handlerlist == *phandlerlist);
1150 handlerlist = handlerlist->next; 1149 handlerlist = handlerlist->next;