* libguile/__scm.h (scm_t_subr): New typedef.
* libguile/deprecated.h (scm_make_gsubr, scm_make_gsubr_with_generic,
scm_call_catching_errors): Use it.
* libguile/gsubr.h (scm_c_make_gsubr, scm_c_define_gsubr,
scm_c_define_gsubr_with_generic): Likewise.
* libguile/smob.h (scm_smob_descriptor)[apply]: Likewise.
(scm_set_smob_apply): Likewise.
* libguile/snarf.h (SCM_FUNC_CAST_ARBITRARY_ARGS): Likewise.
#ifndef SCM___SCM_H
#define SCM___SCM_H
-/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002,2003, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2006,
+ * 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
#include "libguile/tags.h"
+
+/* The type of subrs, i.e., Scheme procedures implemented in C. Empty
+ function declarators are used internally for pointers to functions of
+ any arity. However, these are equivalent to `(void)' in C++, are
+ obsolescent as of C99, and trigger `strict-prototypes' GCC warnings
+ (bug #23681). */
+
+#ifdef BUILDING_LIBGUILE
+typedef SCM (* scm_t_subr) ();
+#else
+typedef void *scm_t_subr;
+#endif
+
\f
#ifdef vms
# ifndef CHEAP_CONTINUATIONS
SCM_DEPRECATED SCM scm_make_gsubr (const char *name,
int req, int opt, int rst,
- SCM (*fcn)());
+ scm_t_subr fcn);
SCM_DEPRECATED SCM scm_make_gsubr_with_generic (const char *name,
int req,
int opt,
int rst,
- SCM (*fcn)(),
+ scm_t_subr fcn,
SCM *gf);
SCM_DEPRECATED SCM scm_create_hook (const char* name, int n_args);
#define SCM_SUBR_DOC(x) SCM_BOOL_F
-SCM_DEPRECATED SCM scm_call_catching_errors (SCM (*thunk)(), SCM (*err_filter)(),
+SCM_DEPRECATED SCM scm_call_catching_errors (scm_t_subr thunk,
+ scm_t_subr err_filter,
void * closure);
SCM_DEPRECATED long scm_make_smob_type_mfpe (char *name, size_t size,
#ifndef SCM_GSUBR_H
#define SCM_GSUBR_H
-/* Copyright (C) 1995,1996,1998,2000,2001, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1998, 2000, 2001, 2006, 2008, 2009,
+ * 2010, 2011 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
\f
-SCM_API SCM scm_c_make_gsubr (const char *name,
- int req, int opt, int rst, SCM (*fcn) ());
+SCM_API SCM scm_c_make_gsubr (const char *name,
+ int req, int opt, int rst, scm_t_subr fcn);
SCM_API SCM scm_c_make_gsubr_with_generic (const char *name,
int req, int opt, int rst,
- SCM (*fcn) (), SCM *gf);
-SCM_API SCM scm_c_define_gsubr (const char *name,
- int req, int opt, int rst, SCM (*fcn) ());
+ scm_t_subr fcn, SCM *gf);
+SCM_API SCM scm_c_define_gsubr (const char *name,
+ int req, int opt, int rst, scm_t_subr fcn);
SCM_API SCM scm_c_define_gsubr_with_generic (const char *name,
int req, int opt, int rst,
- SCM (*fcn) (), SCM *gf);
+ scm_t_subr fcn, SCM *gf);
SCM_INTERNAL void scm_init_gsubr (void);
#ifndef SCM_SMOB_H
#define SCM_SMOB_H
-/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2004, 2006, 2009,
+ * 2010, 2011 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
size_t (*free) (SCM);
int (*print) (SCM exp, SCM port, scm_print_state *pstate);
SCM (*equalp) (SCM, SCM);
- SCM (*apply) ();
+ scm_t_subr apply;
SCM apply_trampoline_objcode;
} scm_smob_descriptor;
int (*print) (SCM, SCM, scm_print_state*));
SCM_API void scm_set_smob_equalp (scm_t_bits tc, SCM (*equalp) (SCM, SCM));
SCM_API void scm_set_smob_apply (scm_t_bits tc,
- SCM (*apply) (),
+ scm_t_subr apply,
unsigned int req,
unsigned int opt,
unsigned int rst);
#ifndef SCM_SNARF_H
#define SCM_SNARF_H
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ * 2004, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
/* Macros for snarfing initialization actions from C source. */
-#if defined(__cplusplus) || defined(GUILE_CPLUSPLUS_SNARF)
+/* Casting to a function that can take any number of arguments. */
+#define SCM_FUNC_CAST_ARBITRARY_ARGS scm_t_subr
-/* This used to be "SCM (*)(...)" but GCC on RedHat 7.1 doesn't seem
- to like it.
- */
-#define SCM_FUNC_CAST_ARBITRARY_ARGS SCM (*)()
-
-#else
-#define SCM_FUNC_CAST_ARBITRARY_ARGS SCM (*)()
-#endif
#if (defined SCM_ALIGNED) && (SCM_DEBUG_TYPING_STRICTNESS <= 1)
/* We support static allocation of some `SCM' objects. */