&& INTPTR_MAX == EMACS_INT_MAX)
};
+/* Function prototype for module user-pointer finalizers. These
+ should not throw C++ exceptions, so emacs-module.h declares the
+ corresponding interfaces with EMACS_NOEXCEPT. There is only C code
+ in this module, though, so this constraint is not enforced here. */
+typedef void (*emacs_finalizer_function) (void *);
+
\f
/* Private runtime and environment members. */
#if defined __cplusplus && __cplusplus >= 201103L
# define EMACS_NOEXCEPT noexcept
-
-/* Function prototype for module user-pointer finalizers.
-
- NOTE: C++11 15.4: An exception-specification shall not appear in a
- typedef declaration or alias-declaration.
-
-*/
-void emacs_dummy_finalizer_function (void *) noexcept;
-typedef decltype(emacs_dummy_finalizer_function) *emacs_finalizer_function;
-
#else
# define EMACS_NOEXCEPT
-typedef void (*emacs_finalizer_function) (void *);
#endif
#ifdef __cplusplus
/* Embedded pointer type. */
emacs_value (*make_user_ptr) (emacs_env *env,
- emacs_finalizer_function fin,
+ void (*fin) (void *) EMACS_NOEXCEPT,
void *ptr);
void *(*get_user_ptr) (emacs_env *env, emacs_value uptr);
void (*set_user_ptr) (emacs_env *env, emacs_value uptr, void *ptr);
- emacs_finalizer_function (*get_user_finalizer) (emacs_env *env,
- emacs_value uptr);
+ void (*(*get_user_finalizer) (emacs_env *env, emacs_value uptr))
+ (void *) EMACS_NOEXCEPT;
void (*set_user_finalizer) (emacs_env *env,
emacs_value uptr,
- emacs_finalizer_function fin);
+ void (*fin) (void *) EMACS_NOEXCEPT);
/* Vector functions. */
emacs_value (*vec_get) (emacs_env *env, emacs_value vec, ptrdiff_t i);