]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Define __WORDSIZE if not available
authorArnaldo Carvalho de Melo <acme@kernel.org>
Tue, 9 Jun 2020 21:16:53 +0000 (18:16 -0300)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 9 Jun 2020 23:19:25 +0000 (01:19 +0200)
commitc1058ee28d49067b641211041811840cebd36097
treeb699f3f002299f989c1cd419c759eaab9fcc23e3
parentc55291014f2cc28903b2d88f690242e01c186019
libbpf: Define __WORDSIZE if not available

Some systems, such as Android, don't have a define for __WORDSIZE, do it
in terms of __SIZEOF_LONG__, as done in perf since 2012:

   http://git.kernel.org/torvalds/c/42252802c41575ea56

For reference: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

I build tested it here and Andrii did some Travis CI build tests too.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200608161150.GA3073@kernel.org
tools/lib/bpf/hashmap.h