debug output macro
Posted: Wed Oct 11, 2006 3:00 pm
Hi,
I' trying to get some decent debug output, which I may enable or disable in the makefile. I searched around the web, but I just don't get it working. It just doesn't print a single thing although I think it should ...
I just called them like this:
could this be an issue to not using the builtin va_args of gcc? Any hint how I could test, what happens to this macros?
I' trying to get some decent debug output, which I may enable or disable in the makefile. I searched around the web, but I just don't get it working. It just doesn't print a single thing although I think it should ...
Code: Select all
void kerror(char *msg,...);
Code: Select all
#undef FD_ERROR
# define FD_ERROR(msg, args...) kerror(msg, ## args)
#undef FD_DEBUG
# ifdef KFD_DEBUG
# define FD_DEBUG(msg, args...) kprintf(msg, ## args)
# else
# define FD_DEBUG(msg, args...)
# endif
#undef FD_INFO
# ifdef KFD_INFO
# define FD_INFO(msg, args...) kprintf(msg, ## args)
# else
# define FD_INFO(msg, args...)
# endif
Code: Select all
KFD_DO_DEBUG=y
KFD_DO_INFO=y
ifeq ($(KFD_DO_DEBUG),y)
DEBFLAGS += -DKFD_DEBUG
else
DEBFLAGS += -UDKFD_DEBUG
endif
ifeq ($(KFD_DO_INFO),y)
DEBFLAGS += -DKFD_INFO
else
DEBFLAGS += -UDKFD_INFO
endif
CFLAGS += $(DEBFLAGS)
Code: Select all
if(!kfd_reset()){
FD_DEBUG("reset failed\n");
return FD_ERR;
}