diff options
Diffstat (limited to 'include/acpi/platform/acgcc.h')
| -rw-r--r-- | include/acpi/platform/acgcc.h | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 91fda36b042..384875da371 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2014, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,16 +44,35 @@ #ifndef __ACGCC_H__ #define __ACGCC_H__ -/* This macro is used to tag functions as "printf-like" because +#define ACPI_INLINE __inline__ + +/* Function name is used for debug output. Non-ANSI, compiler-dependent */ + +#define ACPI_GET_FUNCTION_NAME __func__ + +/* + * This macro is used to tag functions as "printf-like" because * some compilers (like GCC) can catch printf format string problems. */ -#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 4, 5))) +#define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1))) -/* Some compilers complain about unused variables. Sometimes we don't want to - * use all the variables (most specifically for _THIS_MODULE). This allow us - * to to tell the compiler warning in a per-variable manner that a variable +/* + * Some compilers complain about unused variables. Sometimes we don't want to + * use all the variables (for example, _acpi_module_name). This allows us + * to tell the compiler warning in a per-variable manner that a variable * is unused. */ #define ACPI_UNUSED_VAR __attribute__ ((unused)) -#endif /* __ACGCC_H__ */ +/* + * Some versions of gcc implement strchr() with a buggy macro. So, + * undef it here. Prevents error messages of this form (usually from the + * file getopt.c): + * + * error: logical '&&' with non-zero constant will always evaluate as true + */ +#ifdef strchr +#undef strchr +#endif + +#endif /* __ACGCC_H__ */ |
