1a9f12690SJung-uk Kim /****************************************************************************** 2a9f12690SJung-uk Kim * 3a9f12690SJung-uk Kim * Name: acgcc.h - GCC specific defines, etc. 4a9f12690SJung-uk Kim * 5a9f12690SJung-uk Kim *****************************************************************************/ 6a9f12690SJung-uk Kim 7d244b227SJung-uk Kim /* 81c0e1b6dSJung-uk Kim * Copyright (C) 2000 - 2015, Intel Corp. 9a9f12690SJung-uk Kim * All rights reserved. 10a9f12690SJung-uk Kim * 11d244b227SJung-uk Kim * Redistribution and use in source and binary forms, with or without 12d244b227SJung-uk Kim * modification, are permitted provided that the following conditions 13d244b227SJung-uk Kim * are met: 14d244b227SJung-uk Kim * 1. Redistributions of source code must retain the above copyright 15d244b227SJung-uk Kim * notice, this list of conditions, and the following disclaimer, 16d244b227SJung-uk Kim * without modification. 17d244b227SJung-uk Kim * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18d244b227SJung-uk Kim * substantially similar to the "NO WARRANTY" disclaimer below 19d244b227SJung-uk Kim * ("Disclaimer") and any redistribution must be conditioned upon 20d244b227SJung-uk Kim * including a substantially similar Disclaimer requirement for further 21d244b227SJung-uk Kim * binary redistribution. 22d244b227SJung-uk Kim * 3. Neither the names of the above-listed copyright holders nor the names 23d244b227SJung-uk Kim * of any contributors may be used to endorse or promote products derived 24d244b227SJung-uk Kim * from this software without specific prior written permission. 25a9f12690SJung-uk Kim * 26d244b227SJung-uk Kim * Alternatively, this software may be distributed under the terms of the 27d244b227SJung-uk Kim * GNU General Public License ("GPL") version 2 as published by the Free 28d244b227SJung-uk Kim * Software Foundation. 29a9f12690SJung-uk Kim * 30d244b227SJung-uk Kim * NO WARRANTY 31d244b227SJung-uk Kim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32d244b227SJung-uk Kim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33d244b227SJung-uk Kim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34d244b227SJung-uk Kim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35d244b227SJung-uk Kim * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36d244b227SJung-uk Kim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37d244b227SJung-uk Kim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38d244b227SJung-uk Kim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39d244b227SJung-uk Kim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40d244b227SJung-uk Kim * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41d244b227SJung-uk Kim * POSSIBILITY OF SUCH DAMAGES. 42d244b227SJung-uk Kim */ 43a9f12690SJung-uk Kim 44a9f12690SJung-uk Kim #ifndef __ACGCC_H__ 45a9f12690SJung-uk Kim #define __ACGCC_H__ 46a9f12690SJung-uk Kim 4742fecd12SJung-uk Kim #define ACPI_INLINE __inline__ 4842fecd12SJung-uk Kim 49a9f12690SJung-uk Kim /* Function name is used for debug output. Non-ANSI, compiler-dependent */ 50a9f12690SJung-uk Kim 51313a0c13SJung-uk Kim #define ACPI_GET_FUNCTION_NAME __func__ 52a9f12690SJung-uk Kim 53a9f12690SJung-uk Kim /* 54a9f12690SJung-uk Kim * This macro is used to tag functions as "printf-like" because 55a9f12690SJung-uk Kim * some compilers (like GCC) can catch printf format string problems. 56a9f12690SJung-uk Kim */ 57a9f12690SJung-uk Kim #define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1))) 58a9f12690SJung-uk Kim 59a9f12690SJung-uk Kim /* 60a9f12690SJung-uk Kim * Some compilers complain about unused variables. Sometimes we don't want to 61a9f12690SJung-uk Kim * use all the variables (for example, _AcpiModuleName). This allows us 62efcc2a30SJung-uk Kim * to tell the compiler warning in a per-variable manner that a variable 63a9f12690SJung-uk Kim * is unused. 64a9f12690SJung-uk Kim */ 65a9f12690SJung-uk Kim #define ACPI_UNUSED_VAR __attribute__ ((unused)) 66a9f12690SJung-uk Kim 67313a0c13SJung-uk Kim /* 68313a0c13SJung-uk Kim * Some versions of gcc implement strchr() with a buggy macro. So, 69313a0c13SJung-uk Kim * undef it here. Prevents error messages of this form (usually from the 70313a0c13SJung-uk Kim * file getopt.c): 71313a0c13SJung-uk Kim * 72313a0c13SJung-uk Kim * error: logical '&&' with non-zero constant will always evaluate as true 73313a0c13SJung-uk Kim */ 74313a0c13SJung-uk Kim #ifdef strchr 75313a0c13SJung-uk Kim #undef strchr 76313a0c13SJung-uk Kim #endif 77313a0c13SJung-uk Kim 785ef50723SJung-uk Kim /* GCC supports __VA_ARGS__ in macros */ 795ef50723SJung-uk Kim 805ef50723SJung-uk Kim #define COMPILER_VA_MACRO 1 815ef50723SJung-uk Kim 82a9f12690SJung-uk Kim #endif /* __ACGCC_H__ */ 83