summaryrefslogtreecommitdiff
path: root/src/emacs-module.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-01-17 14:10:26 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2016-01-17 14:11:09 -0800
commitfabb1fa31d1fd60764c025925e6c76c9145e5a59 (patch)
tree9bb5e66cb3fac71c258e37954210e2be056a44b2 /src/emacs-module.c
parent05e8148a24ebe51fbe758dd16265e8fb81f85953 (diff)
downloademacs-fabb1fa31d1fd60764c025925e6c76c9145e5a59.tar.gz
emacs-fabb1fa31d1fd60764c025925e6c76c9145e5a59.tar.bz2
emacs-fabb1fa31d1fd60764c025925e6c76c9145e5a59.zip
Port cleanup attribute to OpenBSD
The OpenBSD C compiler issues false alarms about strcpy, strcat, and sprintf, and this messes up 'configure' when it tests for the cleanup attribute. Work around the problem by using __has_attribute directly. Problem reported by Joakim Jalap (Bug#22385). * configure.ac: Don’t use AX_GCC_VAR_ATTRIBUTE. * m4/ax_gcc_var_attribute.m4: Remove. * src/conf_post.h (__has_attribute): Provide a substitute, for non-GCC or older GCC compilers. All uses changed to assume the substitute. Check for the cleanup attribute. * src/emacs-module.c (module_has_cleanup): Just use __has_attribute.
Diffstat (limited to 'src/emacs-module.c')
-rw-r--r--src/emacs-module.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c
index b5e044e758f..79a077b3cb4 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -35,8 +35,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Feature tests. */
-/* True if __attribute__ ((cleanup (...))) works, false otherwise. */
-#ifdef HAVE_VAR_ATTRIBUTE_CLEANUP
+#if __has_attribute (cleanup)
enum { module_has_cleanup = true };
#else
enum { module_has_cleanup = false };