summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--xmake/core/project/option.lua6
2 files changed, 6 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b331a11ca..ee109f361 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@
* [#9](https://github.com/waruqi/xmake/issues/9): Support clang with c++11
* Fix api scope leaks bug
* Fix path bug for windows
+* Fix check function bug
## v2.0.1
@@ -105,6 +106,7 @@
* [#9](https://github.com/waruqi/xmake/issues/9): �޸�clang��֧��c++11������
* �޸�api������й¶����
* �޸���windows�ϵ�һЩ·������
+* �޸����꺯��ʧ������
## v2.0.1
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;")