diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2013-01-17 21:32:03 +0000 | 
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2013-01-17 21:32:03 +0000 | 
| commit | ee39d6d85cfcfa8e856c410c0ad4cd96e8fded55 (patch) | |
| tree | 4bd397d55198bfd01fc6744430f25faf08f18b0c /source/include/acoutput.h | |
| parent | b28e481ae9b051dab150e9b5a89730cdc1103a9c (diff) | |
Notes
Diffstat (limited to 'source/include/acoutput.h')
| -rw-r--r-- | source/include/acoutput.h | 38 | 
1 files changed, 21 insertions, 17 deletions
| diff --git a/source/include/acoutput.h b/source/include/acoutput.h index 236124dda2781..e5da2a23501d1 100644 --- a/source/include/acoutput.h +++ b/source/include/acoutput.h @@ -5,7 +5,7 @@   *****************************************************************************/  /* - * Copyright (C) 2000 - 2012, Intel Corp. + * Copyright (C) 2000 - 2013, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -285,7 +285,16 @@   * debug message outside of the print function itself. This improves overall   * performance at a relatively small code cost. Implementation involves the   * use of variadic macros supported by C99. + * + * Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from + * complaining about these constructs. On other compilers the do...while + * adds some extra code, so this feature is optional.   */ +#ifdef ACPI_USE_DO_WHILE_0 +#define ACPI_DO_WHILE0(a)               do a while(0) +#else +#define ACPI_DO_WHILE0(a)               a +#endif  /* DEBUG_PRINT functions */ @@ -294,17 +303,21 @@  /* Helper macros for DEBUG_PRINT */ -#define ACPI_DEBUG(Function, Level, Line, Filename, Modulename, Component, ...) \ -    if (ACPI_IS_DEBUG_ENABLED (Level, Component)) \ -    { \ -        Function (Level, Line, Filename, Modulename, Component, __VA_ARGS__); \ -    } +#define ACPI_DO_DEBUG_PRINT(Function, Level, Line, Filename, Modulename, Component, ...) \ +    ACPI_DO_WHILE0 ({ \ +        if (ACPI_IS_DEBUG_ENABLED (Level, Component)) \ +        { \ +            Function (Level, Line, Filename, Modulename, Component, __VA_ARGS__); \ +        } \ +    })  #define ACPI_ACTUAL_DEBUG(Level, Line, Filename, Modulename, Component, ...) \ -    ACPI_DEBUG (AcpiDebugPrint, Level, Line, Filename, Modulename, Component, __VA_ARGS__) +    ACPI_DO_DEBUG_PRINT (AcpiDebugPrint, Level, Line, \ +        Filename, Modulename, Component, __VA_ARGS__)  #define ACPI_ACTUAL_DEBUG_RAW(Level, Line, Filename, Modulename, Component, ...) \ -    ACPI_DEBUG (AcpiDebugPrintRaw, Level, Line, Filename, Modulename, Component, __VA_ARGS__) +    ACPI_DO_DEBUG_PRINT (AcpiDebugPrintRaw, Level, Line, \ +        Filename, Modulename, Component, __VA_ARGS__)  /* @@ -348,16 +361,7 @@   *   * One of the FUNCTION_TRACE macros above must be used in conjunction   * with these macros so that "_AcpiFunctionName" is defined. - * - * Note: the DO_WHILE0 macro is used to prevent some compilers from - * complaining about these constructs. On other compilers the do...while - * adds some extra code, so this feature is optional.   */ -#ifdef ACPI_USE_DO_WHILE_0 -#define ACPI_DO_WHILE0(a)               do a while(0) -#else -#define ACPI_DO_WHILE0(a)               a -#endif  /* Exit trace helper macro */ | 
