summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-09-12 23:33:11 +0800
committerruki <[email protected]>2023-09-12 23:33:11 +0800
commit4c15d81befef5bccd05f1a4afeacd3451c295e79 (patch)
tree81bffcc81a2a7132eb2b503e03491c2bd68e8c4b
parent08a917b94646d99aabcad09b7ab76e601945a08f (diff)
improve check func
-rw-r--r--xmake/modules/lib/detect/check_cxsnippets.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/xmake/modules/lib/detect/check_cxsnippets.lua b/xmake/modules/lib/detect/check_cxsnippets.lua
index 08055c3d8..bbcb15e23 100644
--- a/xmake/modules/lib/detect/check_cxsnippets.lua
+++ b/xmake/modules/lib/detect/check_cxsnippets.lua
@@ -56,19 +56,15 @@ end
-- sigsetjmp{int a = 0; sigsetjmp((void*)a, a);}
--
function _funccode(funcinfo)
-
- -- parse function code
local code = string.match(funcinfo, ".+{(.+)}")
if code == nil then
local pos = funcinfo:find("%(")
if pos then
code = funcinfo
else
- code = string.format("volatile void* p%s = (void*)&%s;", funcinfo, funcinfo)
+ code = string.format("volatile void* p%s = (void*)&%s; if (p%s) {}", funcinfo, funcinfo, funcinfo)
end
end
-
- -- ok
return code
end