diff options
| -rw-r--r-- | xmake/modules/lib/detect/check_cxsnippets.lua | 6 |
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 |
