lkml.org 
[lkml]   [2018]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] tools: fix another redefinition of BITS_PER_LONG
If BITS_PER_LONG gets already defined in
linux/tools/include/linux/bitops.h it shouldn't be
redefined in tools/include/asm-generic/bitsperlong.h.

This patch prevents such compilation error:
[..]/linux/tools/include/asm-generic/bitsperlong.h:8:0:
error: "BITS_PER_LONG" redefined [-Werror]
#define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)

In file included from [..]/linux/tools/include/linux/hashtable.h:13:0,
from elf.h:24,
from check.h:22,
from builtin-check.c:30:
[..]/linux/tools/include/linux/bitops.h:13:0:
note: this is the location of the previous definition

Signed-off-by: Wladislav Wiebe <wladislav.kw@gmail.com>
---
tools/include/asm-generic/bitsperlong.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/include/asm-generic/bitsperlong.h
b/tools/include/asm-generic/bitsperlong.h
index 8f2283052333..c69a5fa3a096 100644
--- a/tools/include/asm-generic/bitsperlong.h
+++ b/tools/include/asm-generic/bitsperlong.h
@@ -4,11 +4,13 @@

#include <uapi/asm-generic/bitsperlong.h>

+#ifndef BITS_PER_LONG
#ifdef __SIZEOF_LONG__
#define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
#else
#define BITS_PER_LONG __WORDSIZE
#endif
+#endif

#if BITS_PER_LONG != __BITS_PER_LONG
#error Inconsistent word size. Check asm/bitsperlong.h
--
2.16.1
\
 
 \ /
  Last update: 2018-03-20 13:45    [W:0.029 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site