From aff68423976e2c8a4feb97f19edf6716d271f0f0 Mon Sep 17 00:00:00 2001 From: Karuro Chari Date: Fri, 22 May 2026 11:47:53 +0100 Subject: Introduced alignof support like the one for check_sizeof --- xmake/core/project/target.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'xmake/core/project/target.lua') diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 6861ba2e6..03891563b 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -2994,6 +2994,19 @@ function _instance:check_sizeof(typename, opt) return sandbox_module.import("lib.detect.check_sizeof", {anonymous = true})(typename, opt) end +-- check the alignment of type +-- +-- @param typename the typename +-- @param opt the argument options, e.g. {includes = "xxx.h", configs = {defines = ""}} +-- +-- @return the type alignment +-- +function _instance:check_alignof(typename, opt) + opt = opt or {} + opt.target = self:_checked_target() + return sandbox_module.import("lib.detect.check_alignof", {anonymous = true})(typename, opt) +end + -- check the endianness of compiler -- -- @param opt the argument options, e.g. {includes = "xxx.h", configs = {defines = ""}} -- cgit v1.3.1