Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Oct 2022 20:32:44 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: ce9e720af2f8 - main - <sys/_pv_entry>: Add a fallback for __LONG_WIDTH__ for older compilers.
Message-ID:  <202210072032.297KWiuG035424@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=ce9e720af2f8fa378e36134bab8a82ebf67c159d

commit ce9e720af2f8fa378e36134bab8a82ebf67c159d
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-10-07 19:44:31 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-10-07 19:44:31 +0000

    <sys/_pv_entry>: Add a fallback for __LONG_WIDTH__ for older compilers.
    
    clang only includes a __LONG_WIDTH__ builtin in clang 14 and later.
---
 sys/sys/_pv_entry.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/sys/_pv_entry.h b/sys/sys/_pv_entry.h
index 411643cf49ec..3cd0d9c687f6 100644
--- a/sys/sys/_pv_entry.h
+++ b/sys/sys/_pv_entry.h
@@ -77,6 +77,11 @@ typedef struct pv_entry {
 #error Unsupported page size
 #endif
 
+/* Support clang < 14 */
+#ifndef __LONG_WIDTH__
+#define	__LONG_WIDTH__	(__CHAR_BIT__ * __SIZEOF_LONG__)
+#endif
+
 #define	_NPCM		howmany(_NPCPV, __LONG_WIDTH__)
 #define	PC_FREEN	~0ul
 #define	PC_FREEL	((1ul << (_NPCPV % __LONG_WIDTH__)) - 1)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210072032.297KWiuG035424>