Date: Tue, 31 May 2016 13:31:19 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301037 - head/sys/x86/include Message-ID: <201605311331.u4VDVJsx026326@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Tue May 31 13:31:19 2016 New Revision: 301037 URL: https://svnweb.freebsd.org/changeset/base/301037 Log: Implement _ALIGN() using internal integer types. The existing version depends on register_t and uintptr_t, which are only available when including headers such as <sys/types.h>. As this macro is used by <sys/socket.h>, for example, it should be written in such a way that it doesn't depend on those types. Modified: head/sys/x86/include/_align.h Modified: head/sys/x86/include/_align.h ============================================================================== --- head/sys/x86/include/_align.h Tue May 31 12:39:54 2016 (r301036) +++ head/sys/x86/include/_align.h Tue May 31 13:31:19 2016 (r301037) @@ -46,7 +46,7 @@ * for all data types (int, long, ...). The result is unsigned int * and must be cast to any desired pointer type. */ -#define _ALIGNBYTES (sizeof(register_t) - 1) -#define _ALIGN(p) (((uintptr_t)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) +#define _ALIGNBYTES (sizeof(__register_t) - 1) +#define _ALIGN(p) (((__uintptr_t)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #endif /* !_X86_INCLUDE__ALIGN_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605311331.u4VDVJsx026326>