1433d6423SLionel Sambuc /****************************************************************************** 2433d6423SLionel Sambuc * 3433d6423SLionel Sambuc * Name: acgcc.h - GCC specific defines, etc. 4433d6423SLionel Sambuc * 5433d6423SLionel Sambuc *****************************************************************************/ 6433d6423SLionel Sambuc 7*29492bb7SDavid van Moolenbroek /* 8*29492bb7SDavid van Moolenbroek * Copyright (C) 2000 - 2014, Intel Corp. 9433d6423SLionel Sambuc * All rights reserved. 10433d6423SLionel Sambuc * 11*29492bb7SDavid van Moolenbroek * Redistribution and use in source and binary forms, with or without 12*29492bb7SDavid van Moolenbroek * modification, are permitted provided that the following conditions 13*29492bb7SDavid van Moolenbroek * are met: 14*29492bb7SDavid van Moolenbroek * 1. Redistributions of source code must retain the above copyright 15*29492bb7SDavid van Moolenbroek * notice, this list of conditions, and the following disclaimer, 16*29492bb7SDavid van Moolenbroek * without modification. 17*29492bb7SDavid van Moolenbroek * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18*29492bb7SDavid van Moolenbroek * substantially similar to the "NO WARRANTY" disclaimer below 19*29492bb7SDavid van Moolenbroek * ("Disclaimer") and any redistribution must be conditioned upon 20*29492bb7SDavid van Moolenbroek * including a substantially similar Disclaimer requirement for further 21*29492bb7SDavid van Moolenbroek * binary redistribution. 22*29492bb7SDavid van Moolenbroek * 3. Neither the names of the above-listed copyright holders nor the names 23*29492bb7SDavid van Moolenbroek * of any contributors may be used to endorse or promote products derived 24*29492bb7SDavid van Moolenbroek * from this software without specific prior written permission. 25433d6423SLionel Sambuc * 26*29492bb7SDavid van Moolenbroek * Alternatively, this software may be distributed under the terms of the 27*29492bb7SDavid van Moolenbroek * GNU General Public License ("GPL") version 2 as published by the Free 28*29492bb7SDavid van Moolenbroek * Software Foundation. 29433d6423SLionel Sambuc * 30*29492bb7SDavid van Moolenbroek * NO WARRANTY 31*29492bb7SDavid van Moolenbroek * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32*29492bb7SDavid van Moolenbroek * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33*29492bb7SDavid van Moolenbroek * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34*29492bb7SDavid van Moolenbroek * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35*29492bb7SDavid van Moolenbroek * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36*29492bb7SDavid van Moolenbroek * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37*29492bb7SDavid van Moolenbroek * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38*29492bb7SDavid van Moolenbroek * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39*29492bb7SDavid van Moolenbroek * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40*29492bb7SDavid van Moolenbroek * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41*29492bb7SDavid van Moolenbroek * POSSIBILITY OF SUCH DAMAGES. 42*29492bb7SDavid van Moolenbroek */ 43433d6423SLionel Sambuc 44433d6423SLionel Sambuc #ifndef __ACGCC_H__ 45433d6423SLionel Sambuc #define __ACGCC_H__ 46433d6423SLionel Sambuc 47*29492bb7SDavid van Moolenbroek #define ACPI_INLINE __inline__ 48*29492bb7SDavid van Moolenbroek 49433d6423SLionel Sambuc /* Function name is used for debug output. Non-ANSI, compiler-dependent */ 50433d6423SLionel Sambuc 51*29492bb7SDavid van Moolenbroek #define ACPI_GET_FUNCTION_NAME __func__ 52433d6423SLionel Sambuc 53433d6423SLionel Sambuc /* 54433d6423SLionel Sambuc * This macro is used to tag functions as "printf-like" because 55433d6423SLionel Sambuc * some compilers (like GCC) can catch printf format string problems. 56433d6423SLionel Sambuc */ 57433d6423SLionel Sambuc #define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1))) 58433d6423SLionel Sambuc 59433d6423SLionel Sambuc /* 60433d6423SLionel Sambuc * Some compilers complain about unused variables. Sometimes we don't want to 61433d6423SLionel Sambuc * use all the variables (for example, _AcpiModuleName). This allows us 62*29492bb7SDavid van Moolenbroek * to tell the compiler warning in a per-variable manner that a variable 63433d6423SLionel Sambuc * is unused. 64433d6423SLionel Sambuc */ 65433d6423SLionel Sambuc #define ACPI_UNUSED_VAR __attribute__ ((unused)) 66433d6423SLionel Sambuc 67*29492bb7SDavid van Moolenbroek /* 68*29492bb7SDavid van Moolenbroek * Some versions of gcc implement strchr() with a buggy macro. So, 69*29492bb7SDavid van Moolenbroek * undef it here. Prevents error messages of this form (usually from the 70*29492bb7SDavid van Moolenbroek * file getopt.c): 71*29492bb7SDavid van Moolenbroek * 72*29492bb7SDavid van Moolenbroek * error: logical '&&' with non-zero constant will always evaluate as true 73*29492bb7SDavid van Moolenbroek */ 74*29492bb7SDavid van Moolenbroek #ifdef strchr 75*29492bb7SDavid van Moolenbroek #undef strchr 76*29492bb7SDavid van Moolenbroek #endif 77*29492bb7SDavid van Moolenbroek 78433d6423SLionel Sambuc #endif /* __ACGCC_H__ */ 79