diff options
| author | ruki <[email protected]> | 2023-09-12 23:33:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-09-12 23:33:11 +0800 |
| commit | 4c15d81befef5bccd05f1a4afeacd3451c295e79 (patch) | |
| tree | 81bffcc81a2a7132eb2b503e03491c2bd68e8c4b | |
| parent | 08a917b94646d99aabcad09b7ab76e601945a08f (diff) | |
improve check func
| -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 |
