mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 03:01:26 +00:00
scst: Make scst/include/backport.h again compatible with MOFED
Fix the following build failure on RHEL 7 + MOFED 5.0:
In file included from <command-line>:0:0:
/usr/src/ofa_kernel/default/include/linux/compat-2.6.h:40:29: warning: "__GCC4_has_attribute___fallthrough__" is not defined [-Wundef]
# define __has_attribute(x) __GCC4_has_attribute_##x
^
/usr/src/packages/BUILD/scst-3.5.0.7946/iscsi-scst/kernel/isert-scst/../../../scst/include/backport.h:250:5: note: in expansion of macro '__has_attribute'
#if __has_attribute(__fallthrough__)
Reported-by: Chesnokov Gleb <Chesnokov.G@raidix.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9163 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -246,13 +246,14 @@ static inline void cpu_to_be32_array(__be32 *dst, const u32 *src, size_t len)
|
||||
* pseudo keyword for switch/case use") # v5.4
|
||||
*/
|
||||
#ifndef fallthrough
|
||||
#ifdef __has_attribute
|
||||
#if __GNUC__ >= 5
|
||||
#if __has_attribute(__fallthrough__)
|
||||
#define fallthrough __attribute__((__fallthrough__))
|
||||
#else
|
||||
#define fallthrough do {} while (0) /* fallthrough */
|
||||
#endif
|
||||
#else
|
||||
/* gcc 4.x doesn't support __has_attribute() */
|
||||
#define fallthrough do {} while (0) /* fallthrough */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user