diff options
| author | Paul Eggert | 2017-06-14 11:01:02 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-06-14 11:01:41 -0700 |
| commit | d715e6d8c6a7f3507f4faca0961ac87d58fbfab8 (patch) | |
| tree | fac2105d5874ebf6cbd93bd1f7e349a98d499a7f /src | |
| parent | b657de7f7a9917ed82a0fd9b540db837ac1a02c5 (diff) | |
| download | emacs-d715e6d8c6a7f3507f4faca0961ac87d58fbfab8.tar.gz emacs-d715e6d8c6a7f3507f4faca0961ac87d58fbfab8.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/conf_post.h | 5 | ||||
| -rw-r--r-- | src/emacs-module.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/conf_post.h b/src/conf_post.h index 18b096e2cf6..e1d6a9397d3 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -57,10 +57,13 @@ typedef bool bool_bf; | |||
| 57 | #endif | 57 | #endif |
| 58 | 58 | ||
| 59 | /* Simulate __has_attribute on compilers that lack it. It is used only | 59 | /* Simulate __has_attribute on compilers that lack it. It is used only |
| 60 | on arguments like alloc_size that are handled in this simulation. */ | 60 | on arguments like alloc_size that are handled in this simulation. |
| 61 | __has_attribute should be used only in #if expressions, as Oracle | ||
| 62 | Studio 12.5's __has_attribute does not work in plain code. */ | ||
| 61 | #ifndef __has_attribute | 63 | #ifndef __has_attribute |
| 62 | # define __has_attribute(a) __has_attribute_##a | 64 | # define __has_attribute(a) __has_attribute_##a |
| 63 | # define __has_attribute_alloc_size GNUC_PREREQ (4, 3, 0) | 65 | # define __has_attribute_alloc_size GNUC_PREREQ (4, 3, 0) |
| 66 | # define __has_attribute_cleanup GNUC_PREREQ (3, 4, 0) | ||
| 64 | # define __has_attribute_externally_visible GNUC_PREREQ (4, 1, 0) | 67 | # define __has_attribute_externally_visible GNUC_PREREQ (4, 1, 0) |
| 65 | # define __has_attribute_no_address_safety_analysis false | 68 | # define __has_attribute_no_address_safety_analysis false |
| 66 | # define __has_attribute_no_sanitize_address GNUC_PREREQ (4, 8, 0) | 69 | # define __has_attribute_no_sanitize_address GNUC_PREREQ (4, 8, 0) |
diff --git a/src/emacs-module.c b/src/emacs-module.c index de62329b3b8..5c413ee0556 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -170,6 +170,10 @@ static struct emacs_env_private global_env_private; | |||
| 170 | internal_handler_##handlertype, \ | 170 | internal_handler_##handlertype, \ |
| 171 | internal_cleanup_##handlertype) | 171 | internal_cleanup_##handlertype) |
| 172 | 172 | ||
| 173 | #if !__has_attribute (cleanup) | ||
| 174 | #error "__attribute__ ((cleanup)) not supported by this compiler; try GCC" | ||
| 175 | #endif | ||
| 176 | |||
| 173 | /* It is very important that pushing the handler doesn't itself raise | 177 | /* It is very important that pushing the handler doesn't itself raise |
| 174 | a signal. Install the cleanup only after the handler has been | 178 | a signal. Install the cleanup only after the handler has been |
| 175 | pushed. Use __attribute__ ((cleanup)) to avoid | 179 | pushed. Use __attribute__ ((cleanup)) to avoid |