diff options
| author | ruki <[email protected]> | 2016-06-24 18:25:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-06-24 18:25:25 +0800 |
| commit | 5dba31860c53d079d40e11e425cad01c3f470dbb (patch) | |
| tree | c8f242ceb174fa85bbd2060a3f573d0d1a84b636 | |
| parent | 0ea567263539b6ce80987b7985c21e904d7aa4d0 (diff) | |
fix check function bug
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | xmake/core/project/option.lua | 6 |
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;") |
