167754Smsmith/******************************************************************************
267754Smsmith *
367754Smsmith * Name: acgcc.h - GCC specific defines, etc.
467754Smsmith *
567754Smsmith *****************************************************************************/
667754Smsmith
7217365Sjkim/*
8281075Sdim * Copyright (C) 2000 - 2015, Intel Corp.
970243Smsmith * All rights reserved.
1067754Smsmith *
11217365Sjkim * Redistribution and use in source and binary forms, with or without
12217365Sjkim * modification, are permitted provided that the following conditions
13217365Sjkim * are met:
14217365Sjkim * 1. Redistributions of source code must retain the above copyright
15217365Sjkim *    notice, this list of conditions, and the following disclaimer,
16217365Sjkim *    without modification.
17217365Sjkim * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18217365Sjkim *    substantially similar to the "NO WARRANTY" disclaimer below
19217365Sjkim *    ("Disclaimer") and any redistribution must be conditioned upon
20217365Sjkim *    including a substantially similar Disclaimer requirement for further
21217365Sjkim *    binary redistribution.
22217365Sjkim * 3. Neither the names of the above-listed copyright holders nor the names
23217365Sjkim *    of any contributors may be used to endorse or promote products derived
24217365Sjkim *    from this software without specific prior written permission.
2567754Smsmith *
26217365Sjkim * Alternatively, this software may be distributed under the terms of the
27217365Sjkim * GNU General Public License ("GPL") version 2 as published by the Free
28217365Sjkim * Software Foundation.
2967754Smsmith *
30217365Sjkim * NO WARRANTY
31217365Sjkim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32217365Sjkim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33217365Sjkim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34217365Sjkim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35217365Sjkim * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36217365Sjkim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37217365Sjkim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38217365Sjkim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39217365Sjkim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40217365Sjkim * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41217365Sjkim * POSSIBILITY OF SUCH DAMAGES.
42217365Sjkim */
4367754Smsmith
4467754Smsmith#ifndef __ACGCC_H__
4567754Smsmith#define __ACGCC_H__
4667754Smsmith
47212761Sjkim#define ACPI_INLINE             __inline__
48212761Sjkim
49151937Sjkim/* Function name is used for debug output. Non-ANSI, compiler-dependent */
50151937Sjkim
51281075Sdim#define ACPI_GET_FUNCTION_NAME          __func__
52151937Sjkim
53167802Sjkim/*
54167802Sjkim * This macro is used to tag functions as "printf-like" because
5585756Smsmith * some compilers (like GCC) can catch printf format string problems.
5685756Smsmith */
57167802Sjkim#define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1)))
5885756Smsmith
59167802Sjkim/*
60167802Sjkim * Some compilers complain about unused variables. Sometimes we don't want to
61151937Sjkim * use all the variables (for example, _AcpiModuleName). This allows us
62245582Sjkim * to tell the compiler warning in a per-variable manner that a variable
63114237Snjl * is unused.
64114237Snjl */
65114237Snjl#define ACPI_UNUSED_VAR __attribute__ ((unused))
66114237Snjl
67281075Sdim/*
68281075Sdim * Some versions of gcc implement strchr() with a buggy macro. So,
69281075Sdim * undef it here. Prevents error messages of this form (usually from the
70281075Sdim * file getopt.c):
71281075Sdim *
72281075Sdim * error: logical '&&' with non-zero constant will always evaluate as true
73281075Sdim */
74281075Sdim#ifdef strchr
75281075Sdim#undef strchr
76281075Sdim#endif
77281075Sdim
7867754Smsmith#endif /* __ACGCC_H__ */
79