Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ed82326 authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki
Browse files

ACPICA: gcc-specific: Fix possible issue with the strchr function.



Some versions of gcc implement strchr via a macro, which either
contains bugs or can provoke a bug in the compiler. This change
fixes a possible compile-time error when using this function.
The problem is usually seen when compiling the getopt.c module.

Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 6085bb18
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -64,4 +64,15 @@
 */
#define ACPI_UNUSED_VAR __attribute__ ((unused))

/*
 * 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__ */