/************************************************************** * * File: debug.h * Author: Steve Wolfman * * Description: This file contains the declaration for the * debug_printf command used in CSE142. This command allows students * to leave debugging statements in the code even at submission time * because the debug_printf statements become empty statements in * release mode. * **************************************************************/ /* If this file has been touched before, fix things up to allow it to be touched again. */ #ifdef __DEBUG_H #undef debug_printf #endif /* __DEBUG_H */ /* Define debug_printf to do nothing if NDEBUG is defined. If NDEBUG is defined, it means no debugging information should be provided. This is the same constant used to control assert statements. */ #ifdef NDEBUG /* Prototype for empty_debug only needed if NDEBUG is defined. */ /* Does nothing but return 0. */ int empty_debug(const char *format, ...); /* Make debug_printf become a null call. */ #define debug_printf empty_debug #else /* debug_printf acts just like printf. This actually *makes* it printf. */ #define debug_printf printf #endif /* NDEBUG */