summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2016-06-24 18:25:25 +0800
committerruki <[email protected]>2016-06-24 18:25:25 +0800
commit5dba31860c53d079d40e11e425cad01c3f470dbb (patch)
treec8f242ceb174fa85bbd2060a3f573d0d1a84b636 /xmake
parent0ea567263539b6ce80987b7985c21e904d7aa4d0 (diff)
fix check function bug
Diffstat (limited to 'xmake')
-rw-r--r--xmake/core/project/option.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/core/project/option.lua b/xmake/core/project/option.lua
index 192660d74..6d1b86f06 100644
--- a/xmake/core/project/option.lua
+++ b/xmake/core/project/option.lua
@@ -138,7 +138,9 @@ function option:_check_function(interface, srcpath, objpath)
srcfile:print("{")
-- make interfaces
- srcfile:print(" volatile void* p%s = (void*)&%s;\n", interface, interface)
+ srcfile:print("#ifndef %s\n", interface)
+ srcfile:print(" volatile void* p%s = (void*)&%s;", interface, interface)
+ srcfile:print("#endif")
-- make the main function tailer
srcfile:print(" return 0;")
@@ -192,7 +194,7 @@ function option:_check_typedef(typedef, srcpath, objpath)
srcfile:print("{")
-- make interfaces
- srcfile:print(" typedef %s __type_xxx;\n", typedef)
+ srcfile:print(" typedef %s __type_xxx;", typedef)
-- make the main function tailer
srcfile:print(" return 0;")