OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1999--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1999--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // Without such definition it defaults to 0, producing no predicate. | 214 // Without such definition it defaults to 0, producing no predicate. |
215 | 215 |
216 static const char *const type_p_name_; // = 0 | 216 static const char *const type_p_name_; // = 0 |
217 | 217 |
218 // LY_DECLARE_SMOB_PROC is used in the Super class definition for | 218 // LY_DECLARE_SMOB_PROC is used in the Super class definition for |
219 // making a smob callable like a function. Its first argument is a | 219 // making a smob callable like a function. Its first argument is a |
220 // function member pointer constant, to a function taking the | 220 // function member pointer constant, to a function taking the |
221 // correct number of SCM arguments and returning SCM. The function | 221 // correct number of SCM arguments and returning SCM. The function |
222 // itself has to be defined separately. | 222 // itself has to be defined separately. |
223 | 223 |
224 #define LY_DECLARE_SMOB_PROC(PMF, REQ, OPT, VAR) \ | 224 #define LY_DECLARE_STATIC_SMOB_PROC(FUN, REQ, OPT, VAR) \ |
225 static void smob_proc_init (scm_t_bits smob_tag) \ | 225 static void smob_proc_init (scm_t_bits smob_tag) \ |
226 { \ | 226 { \ |
227 scm_set_smob_apply (smob_tag, \ | 227 scm_set_smob_apply (smob_tag, (scm_t_subr)(FUN), REQ, OPT, VAR); \ |
228 (scm_t_subr)smob_trampoline<PMF>, \ | |
229 REQ, OPT, VAR); \ | |
230 } | 228 } |
231 | 229 |
| 230 #define LY_DECLARE_SMOB_PROC(PMF, REQ, OPT, VAR) \ |
| 231 LY_DECLARE_STATIC_SMOB_PROC (smob_trampoline<PMF>, REQ, OPT, VAR) |
| 232 |
232 // Template parameter packs could reduce repetition here; however, | 233 // Template parameter packs could reduce repetition here; however, |
233 // they would allow parameter types other than SCM. It turns out | 234 // they would allow parameter types other than SCM. It turns out |
234 // that GUILEĀ 1.8.8 cannot actually make callable structures with | 235 // that GUILEĀ 1.8.8 cannot actually make callable structures with |
235 // more than 3 arguments anyway. That's surprising, to say the | 236 // more than 3 arguments anyway. That's surprising, to say the |
236 // least, but in emergency situations one can always use a "rest" | 237 // least, but in emergency situations one can always use a "rest" |
237 // argument and take it apart manually. | 238 // argument and take it apart manually. |
238 | 239 |
239 template <SCM (Super::*pmf) (void)> | 240 template <SCM (Super::*pmf) (void)> |
240 static SCM smob_trampoline (SCM self) | 241 static SCM smob_trampoline (SCM self) |
241 { | 242 { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 if (parsed_objects_should_be_dead) \ | 387 if (parsed_objects_should_be_dead) \ |
387 pass_here.checkin (arg); \ | 388 pass_here.checkin (arg); \ |
388 } while (0) | 389 } while (0) |
389 #else | 390 #else |
390 #define ASSERT_LIVE_IS_ALLOWED(arg) do { (void)(arg); } \ | 391 #define ASSERT_LIVE_IS_ALLOWED(arg) do { (void)(arg); } \ |
391 while (0) | 392 while (0) |
392 #endif | 393 #endif |
393 | 394 |
394 #include "smobs.tcc" | 395 #include "smobs.tcc" |
395 #endif /* SMOBS_HH */ | 396 #endif /* SMOBS_HH */ |
OLD | NEW |