/*
- lily-guile-macros.hh -- declare GUILE interaction macros.
+ This file is part of LilyPond, the GNU music typesetter.
- source file of the GNU LilyPond music typesetter
+ Copyright (C) 2005--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
- (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ LilyPond is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ LilyPond is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LILY_GUILE_MACROS_HH
TODO: include modification callback support here, perhaps
through intermediate Grob::instrumented_set_property( .. __LINE__ ).
*/
-#define set_property(x, y) internal_set_property (ly_symbol2scm (x), y)
+#define set_property(x, y) instrumented_set_property (ly_symbol2scm (x), y, __FILE__, __LINE__, __FUNCTION__)
#else
#define set_property(x, y) internal_set_property (ly_symbol2scm (x), y)
#endif
-extern int function_argument_direction;
-
-#define LY_FUNC_NOTE_FIRST_ARG(a) \
- SCM *first_arg_ptr = &a;
-#define LY_ASSERT_TYPE(pred, number) \
+#define LY_ASSERT_TYPE(pred, var, number) \
{ \
- if (!pred (first_arg_ptr[(number-1)*function_argument_direction])) \
+ if (!pred (var)) \
{ \
scm_wrong_type_arg_msg(mangle_cxx_identifier (__FUNCTION__).c_str(), \
- number, first_arg_ptr[(number-1)*function_argument_direction], \
+ number, var, \
predicate_to_typename ((void*) &pred).c_str()); \
} \
}
-#define LY_ASSERT_SMOB(klass, number) LY_ASSERT_TYPE(klass::unsmob, number)
-
-
-#define LY_ASSERT_FIRST_TYPE(pred, var) \
- LY_FUNC_NOTE_FIRST_ARG(var); \
- LY_ASSERT_TYPE(pred, 1);
+#define LY_ASSERT_SMOB(klass, var, number) LY_ASSERT_TYPE(klass::unsmob, var, number)
-#define LY_ASSERT_FIRST_SMOB(klass, var) \
- LY_ASSERT_FIRST_TYPE(klass::unsmob, var)
#endif /* LILY_GUILE_MACROS_HH */