Path: blob/main/sys/contrib/edk2/Include/Library/DebugLib.h
48383 views
/** @file1Provides services to print debug and assert messages to a debug output device.23The Debug library supports debug print and asserts based on a combination of macros and code.4The debug library can be turned on and off so that the debug code does not increase the size of an image.56Note that a reserved macro named MDEPKG_NDEBUG is introduced for the intention7of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is8defined, then debug and assert related macros wrapped by it are the NULL implementations.910The implementations of the macros used when MDEPKG_NDEBUG is defined rely on the fact that11directly unreachable code is pruned, even with compiler optimization disabled (which has12been confirmed by generated code size tests on supported compilers). The advantage of13implementations which consume their arguments within directly unreachable code is that14compilers understand this, and stop warning about variables which would become unused when15MDEPKG_NDEBUG is defined if the macros had completely empty definitions.1617Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>18SPDX-License-Identifier: BSD-2-Clause-Patent1920**/2122#ifndef __DEBUG_LIB_H__23#define __DEBUG_LIB_H__2425//26// Declare bits for PcdDebugPropertyMask27//28#define DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED 0x0129#define DEBUG_PROPERTY_DEBUG_PRINT_ENABLED 0x0230#define DEBUG_PROPERTY_DEBUG_CODE_ENABLED 0x0431#define DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED 0x0832#define DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED 0x1033#define DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED 0x203435//36// Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter of DebugPrint()37//38#define DEBUG_INIT 0x00000001 // Initialization39#define DEBUG_WARN 0x00000002 // Warnings40#define DEBUG_LOAD 0x00000004 // Load events41#define DEBUG_FS 0x00000008 // EFI File system42#define DEBUG_POOL 0x00000010 // Alloc & Free (pool)43#define DEBUG_PAGE 0x00000020 // Alloc & Free (page)44#define DEBUG_INFO 0x00000040 // Informational debug messages45#define DEBUG_DISPATCH 0x00000080 // PEI/DXE/SMM Dispatchers46#define DEBUG_VARIABLE 0x00000100 // Variable47#define DEBUG_BM 0x00000400 // Boot Manager48#define DEBUG_BLKIO 0x00001000 // BlkIo Driver49#define DEBUG_NET 0x00004000 // Network Io Driver50#define DEBUG_UNDI 0x00010000 // UNDI Driver51#define DEBUG_LOADFILE 0x00020000 // LoadFile52#define DEBUG_EVENT 0x00080000 // Event messages53#define DEBUG_GCD 0x00100000 // Global Coherency Database changes54#define DEBUG_CACHE 0x00200000 // Memory range cachability changes55#define DEBUG_VERBOSE 0x00400000 // Detailed debug messages that may56// significantly impact boot performance57#define DEBUG_MANAGEABILITY 0x00800000 // Detailed debug and payload manageability messages58// related to modules such as Redfish, IPMI, MCTP etc.59#define DEBUG_ERROR 0x80000000 // Error6061//62// Aliases of debug message mask bits63//64#define EFI_D_INIT DEBUG_INIT65#define EFI_D_WARN DEBUG_WARN66#define EFI_D_LOAD DEBUG_LOAD67#define EFI_D_FS DEBUG_FS68#define EFI_D_POOL DEBUG_POOL69#define EFI_D_PAGE DEBUG_PAGE70#define EFI_D_INFO DEBUG_INFO71#define EFI_D_DISPATCH DEBUG_DISPATCH72#define EFI_D_VARIABLE DEBUG_VARIABLE73#define EFI_D_BM DEBUG_BM74#define EFI_D_BLKIO DEBUG_BLKIO75#define EFI_D_NET DEBUG_NET76#define EFI_D_UNDI DEBUG_UNDI77#define EFI_D_LOADFILE DEBUG_LOADFILE78#define EFI_D_EVENT DEBUG_EVENT79#define EFI_D_VERBOSE DEBUG_VERBOSE80#define EFI_D_ERROR DEBUG_ERROR8182//83// Source file line number.84// Default is use the to compiler provided __LINE__ macro value. The __LINE__85// mapping can be overriden by predefining DEBUG_LINE_NUMBER86//87// Defining DEBUG_LINE_NUMBER to a fixed value is useful when comparing builds88// across source code formatting changes that may add/remove lines in a source89// file.90//91#ifdef DEBUG_LINE_NUMBER92#else93#define DEBUG_LINE_NUMBER __LINE__94#endif9596/**97Macro that converts a Boolean expression to a Null-terminated ASCII string.9899The default is to use the C pre-processor stringizing operator '#' to add100quotes around the C expression. If DEBUG_EXPRESSION_STRING_VALUE is defined101then the C expression is converted to the fixed string value.102103Defining DEBUG_EXPRESSION_STRING_VALUE to a fixed value is useful when104comparing builds across source code formatting changes that may make105changes to spaces or parenthesis in a Boolean expression.106107@param Expression Boolean expression.108109**/110111#ifdef DEBUG_EXPRESSION_STRING_VALUE112#define DEBUG_EXPRESSION_STRING(Expression) DEBUG_EXPRESSION_STRING_VALUE113#else114#define DEBUG_EXPRESSION_STRING(Expression) #Expression115#endif116117/**118Prints a debug message to the debug output device if the specified error level is enabled.119120If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function121GetDebugPrintErrorLevel (), then print the message specified by Format and the122associated variable argument list to the debug output device.123124If Format is NULL, then ASSERT().125126@param ErrorLevel The error level of the debug message.127@param Format The format string for the debug message to print.128@param ... The variable argument list whose contents are accessed129based on the format string specified by Format.130131**/132VOID133EFIAPI134DebugPrint (135IN UINTN ErrorLevel,136IN CONST CHAR8 *Format,137...138);139140/**141Prints a debug message to the debug output device if the specified142error level is enabled.143144If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function145GetDebugPrintErrorLevel (), then print the message specified by Format and146the associated variable argument list to the debug output device.147148If Format is NULL, then ASSERT().149150@param ErrorLevel The error level of the debug message.151@param Format Format string for the debug message to print.152@param VaListMarker VA_LIST marker for the variable argument list.153154**/155VOID156EFIAPI157DebugVPrint (158IN UINTN ErrorLevel,159IN CONST CHAR8 *Format,160IN VA_LIST VaListMarker161);162163/**164Prints a debug message to the debug output device if the specified165error level is enabled.166This function use BASE_LIST which would provide a more compatible167service than VA_LIST.168169If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function170GetDebugPrintErrorLevel (), then print the message specified by Format and171the associated variable argument list to the debug output device.172173If Format is NULL, then ASSERT().174175@param ErrorLevel The error level of the debug message.176@param Format Format string for the debug message to print.177@param BaseListMarker BASE_LIST marker for the variable argument list.178179**/180VOID181EFIAPI182DebugBPrint (183IN UINTN ErrorLevel,184IN CONST CHAR8 *Format,185IN BASE_LIST BaseListMarker186);187188/**189Prints an assert message containing a filename, line number, and description.190This may be followed by a breakpoint or a dead loop.191192Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"193to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of194PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if195DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then196CpuDeadLoop() is called. If neither of these bits are set, then this function197returns immediately after the message is printed to the debug output device.198DebugAssert() must actively prevent recursion. If DebugAssert() is called while199processing another DebugAssert(), then DebugAssert() must return immediately.200201If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.202If Description is NULL, then a <Description> string of "(NULL) Description" is printed.203204@param FileName The pointer to the name of the source file that generated the assert condition.205@param LineNumber The line number in the source file that generated the assert condition206@param Description The pointer to the description of the assert condition.207208**/209VOID210EFIAPI211DebugAssert (212IN CONST CHAR8 *FileName,213IN UINTN LineNumber,214IN CONST CHAR8 *Description215);216217/**218Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.219220This function fills Length bytes of Buffer with the value specified by221PcdDebugClearMemoryValue, and returns Buffer.222223If Buffer is NULL, then ASSERT().224If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().225226@param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue.227@param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.228229@return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue.230231**/232VOID *233EFIAPI234DebugClearMemory (235OUT VOID *Buffer,236IN UINTN Length237);238239/**240Returns TRUE if ASSERT() macros are enabled.241242This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of243PcdDebugProperyMask is set. Otherwise, FALSE is returned.244245@retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.246@retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.247248**/249BOOLEAN250EFIAPI251DebugAssertEnabled (252VOID253);254255/**256Returns TRUE if DEBUG() macros are enabled.257258This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of259PcdDebugProperyMask is set. Otherwise, FALSE is returned.260261@retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.262@retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.263264**/265BOOLEAN266EFIAPI267DebugPrintEnabled (268VOID269);270271/**272Returns TRUE if DEBUG_CODE() macros are enabled.273274This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of275PcdDebugProperyMask is set. Otherwise, FALSE is returned.276277@retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.278@retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.279280**/281BOOLEAN282EFIAPI283DebugCodeEnabled (284VOID285);286287/**288Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.289290This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of291PcdDebugProperyMask is set. Otherwise, FALSE is returned.292293@retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.294@retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.295296**/297BOOLEAN298EFIAPI299DebugClearMemoryEnabled (300VOID301);302303/**304Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.305306This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.307308@retval TRUE Current ErrorLevel is supported.309@retval FALSE Current ErrorLevel is not supported.310311**/312BOOLEAN313EFIAPI314DebugPrintLevelEnabled (315IN CONST UINTN ErrorLevel316);317318/**319Internal worker macro that calls DebugAssert().320321This macro calls DebugAssert(), passing in the filename, line number, and an322expression that evaluated to FALSE.323324@param Expression Boolean expression that evaluated to FALSE325326**/327#if defined (EDKII_UNIT_TEST_FRAMEWORK_ENABLED)328329/**330Unit test library replacement for DebugAssert() in DebugLib.331332If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.333If Description is NULL, then a <Description> string of "(NULL) Description" is printed.334335@param FileName The pointer to the name of the source file that generated the assert condition.336@param LineNumber The line number in the source file that generated the assert condition337@param Description The pointer to the description of the assert condition.338339**/340VOID341EFIAPI342UnitTestDebugAssert (343IN CONST CHAR8 *FileName,344IN UINTN LineNumber,345IN CONST CHAR8 *Description346);347348#if defined (_ASSERT)349#undef _ASSERT350#endif351#if defined (__FILE_NAME__)352#define _ASSERT(Expression) UnitTestDebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))353#else354#define _ASSERT(Expression) UnitTestDebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))355#endif356#else357#if defined (__FILE_NAME__)358#define _ASSERT(Expression) DebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))359#else360#define _ASSERT(Expression) DebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))361#endif362#endif363364/**365Internal worker macro that calls DebugPrint().366367This macro calls DebugPrint() passing in the debug error level, a format368string, and a variable argument list.369__VA_ARGS__ is not supported by EBC compiler, Microsoft Visual Studio .NET 2003370and Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830.371372@param Expression Expression containing an error level, a format string,373and a variable argument list based on the format string.374375**/376377#if !defined (MDE_CPU_EBC) && (!defined (_MSC_VER) || _MSC_VER > 1400)378#define _DEBUG_PRINT(PrintLevel, ...) \379do { \380if (DebugPrintLevelEnabled (PrintLevel)) { \381DebugPrint (PrintLevel, ##__VA_ARGS__); \382} \383} while (FALSE)384#define _DEBUGLIB_DEBUG(Expression) _DEBUG_PRINT Expression385#else386#define _DEBUGLIB_DEBUG(Expression) DebugPrint Expression387#endif388389/**390Macro that calls DebugAssert() if an expression evaluates to FALSE.391392If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED393bit of PcdDebugProperyMask is set, then this macro evaluates the Boolean394expression specified by Expression. If Expression evaluates to FALSE, then395DebugAssert() is called passing in the source filename, source line number,396and Expression.397398@param Expression Boolean expression.399400**/401#if !defined (MDEPKG_NDEBUG)402#define ASSERT(Expression) \403do { \404if (DebugAssertEnabled ()) { \405if (!(Expression)) { \406_ASSERT (Expression); \407ANALYZER_UNREACHABLE (); \408} \409} \410} while (FALSE)411#else412#define ASSERT(Expression) \413do { \414if (FALSE) { \415(VOID) (Expression); \416} \417} while (FALSE)418#endif419420/**421Macro that calls DebugPrint().422423If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED424bit of PcdDebugProperyMask is set, then this macro passes Expression to425DebugPrint().426427@param Expression Expression containing an error level, a format string,428and a variable argument list based on the format string.429430431**/432#if !defined (MDEPKG_NDEBUG)433#define DEBUG(Expression) \434do { \435if (DebugPrintEnabled ()) { \436_DEBUGLIB_DEBUG (Expression); \437} \438} while (FALSE)439#else440#define DEBUG(Expression) \441do { \442if (FALSE) { \443_DEBUGLIB_DEBUG (Expression); \444} \445} while (FALSE)446#endif447448/**449Macro that calls DebugAssert() if an EFI_STATUS evaluates to an error code.450451If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED452bit of PcdDebugProperyMask is set, then this macro evaluates the EFI_STATUS453value specified by StatusParameter. If StatusParameter is an error code,454then DebugAssert() is called passing in the source filename, source line455number, and StatusParameter.456457@param StatusParameter EFI_STATUS value to evaluate.458459**/460#if !defined (MDEPKG_NDEBUG)461#define ASSERT_EFI_ERROR(StatusParameter) \462do { \463if (DebugAssertEnabled ()) { \464if (EFI_ERROR (StatusParameter)) { \465DEBUG ((DEBUG_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter)); \466_ASSERT (!EFI_ERROR (StatusParameter)); \467} \468} \469} while (FALSE)470#else471#define ASSERT_EFI_ERROR(StatusParameter) \472do { \473if (FALSE) { \474(VOID) (StatusParameter); \475} \476} while (FALSE)477#endif478479/**480Macro that calls DebugAssert() if a RETURN_STATUS evaluates to an error code.481482If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED483bit of PcdDebugProperyMask is set, then this macro evaluates the484RETURN_STATUS value specified by StatusParameter. If StatusParameter is an485error code, then DebugAssert() is called passing in the source filename,486source line number, and StatusParameter.487488@param StatusParameter RETURN_STATUS value to evaluate.489490**/491#if !defined (MDEPKG_NDEBUG)492#define ASSERT_RETURN_ERROR(StatusParameter) \493do { \494if (DebugAssertEnabled ()) { \495if (RETURN_ERROR (StatusParameter)) { \496DEBUG ((DEBUG_ERROR, "\nASSERT_RETURN_ERROR (Status = %r)\n", \497StatusParameter)); \498_ASSERT (!RETURN_ERROR (StatusParameter)); \499} \500} \501} while (FALSE)502#else503#define ASSERT_RETURN_ERROR(StatusParameter) \504do { \505if (FALSE) { \506(VOID) (StatusParameter); \507} \508} while (FALSE)509#endif510511/**512Macro that calls DebugAssert() if a protocol is already installed in the513handle database.514515If MDEPKG_NDEBUG is defined or the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit516of PcdDebugProperyMask is clear, then return.517518If Handle is NULL, then a check is made to see if the protocol specified by Guid519is present on any handle in the handle database. If Handle is not NULL, then520a check is made to see if the protocol specified by Guid is present on the521handle specified by Handle. If the check finds the protocol, then DebugAssert()522is called passing in the source filename, source line number, and Guid.523524If Guid is NULL, then ASSERT().525526@param Handle The handle to check for the protocol. This is an optional527parameter that may be NULL. If it is NULL, then the entire528handle database is searched.529530@param Guid The pointer to a protocol GUID.531532**/533#if !defined (MDEPKG_NDEBUG)534#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \535do { \536if (DebugAssertEnabled ()) { \537VOID *Instance; \538ASSERT (Guid != NULL); \539if (Handle == NULL) { \540if (!EFI_ERROR (gBS->LocateProtocol ((EFI_GUID *)Guid, NULL, &Instance))) { \541_ASSERT (Guid already installed in database); \542} \543} else { \544if (!EFI_ERROR (gBS->HandleProtocol (Handle, (EFI_GUID *)Guid, &Instance))) { \545_ASSERT (Guid already installed on Handle); \546} \547} \548} \549} while (FALSE)550#else551#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)552#endif553554/**555Macro that marks the beginning of debug source code.556557If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,558then this macro marks the beginning of source code that is included in a module.559Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END()560are not included in a module.561562**/563#define DEBUG_CODE_BEGIN() \564do { \565if (DebugCodeEnabled ()) { \566do { } while (FALSE)567568/**569The macro that marks the end of debug source code.570571If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,572then this macro marks the end of source code that is included in a module.573Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END()574are not included in a module.575576**/577#define DEBUG_CODE_END() \578} \579} while (FALSE)580581/**582The macro that declares a section of debug source code.583584If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,585then the source code specified by Expression is included in a module.586Otherwise, the source specified by Expression is not included in a module.587588**/589#define DEBUG_CODE(Expression) \590DEBUG_CODE_BEGIN (); \591Expression \592DEBUG_CODE_END ()593594/**595The macro that calls DebugClearMemory() to clear a buffer to a default value.596597If the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set,598then this macro calls DebugClearMemory() passing in Address and Length.599600@param Address The pointer to a buffer.601@param Length The number of bytes in the buffer to set.602603**/604#define DEBUG_CLEAR_MEMORY(Address, Length) \605do { \606if (DebugClearMemoryEnabled ()) { \607DebugClearMemory (Address, Length); \608} \609} while (FALSE)610611/**612Macro that calls DebugAssert() if the containing record does not have a613matching signature. If the signatures matches, then a pointer to the data614structure that contains a specified field of that data structure is returned.615This is a lightweight method hide information by placing a public data616structure inside a larger private data structure and using a pointer to the617public data structure to retrieve a pointer to the private data structure.618619If MDEPKG_NDEBUG is defined or the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit620of PcdDebugProperyMask is clear, then this macro computes the offset, in bytes,621of the field specified by Field from the beginning of the data structure specified622by TYPE. This offset is subtracted from Record, and is used to compute a pointer623to a data structure of the type specified by TYPE. The Signature field of the624data structure specified by TYPE is compared to TestSignature. If the signatures625match, then a pointer to the pointer to a data structure of the type specified by626TYPE is returned. If the signatures do not match, then NULL is returned to627signify that the passed in data structure is invalid.628629If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit630of PcdDebugProperyMask is set, then this macro computes the offset, in bytes,631of field specified by Field from the beginning of the data structure specified632by TYPE. This offset is subtracted from Record, and is used to compute a pointer633to a data structure of the type specified by TYPE. The Signature field of the634data structure specified by TYPE is compared to TestSignature. If the signatures635match, then a pointer to the pointer to a data structure of the type specified by636TYPE is returned. If the signatures do not match, then DebugAssert() is called637with a description of "CR has a bad signature" and Record is returned.638639If the data type specified by TYPE does not contain the field specified by Field,640then the module will not compile.641642If TYPE does not contain a field called Signature, then the module will not643compile.644645@param Record The pointer to the field specified by Field within a data646structure of type TYPE.647648@param TYPE The name of the data structure type to return This649data structure must contain the field specified by Field.650651@param Field The name of the field in the data structure specified652by TYPE to which Record points.653654@param TestSignature The 32-bit signature value to match.655656**/657#if !defined (MDEPKG_NDEBUG)658#define CR(Record, TYPE, Field, TestSignature) \659(DebugAssertEnabled () && (BASE_CR (Record, TYPE, Field)->Signature != TestSignature)) ? \660(TYPE *) (_ASSERT (CR has Bad Signature), Record) : \661(BASE_CR (Record, TYPE, Field)->Signature != TestSignature) ? \662NULL : \663BASE_CR (Record, TYPE, Field)664#else665#define CR(Record, TYPE, Field, TestSignature) \666(BASE_CR (Record, TYPE, Field)->Signature != TestSignature) ? \667NULL : \668BASE_CR (Record, TYPE, Field)669#endif670671#endif672673674