diff --git a/.code.yaml b/.code.yaml
new file mode 100644
index 000000000..50d30c9cf
--- /dev/null
+++ b/.code.yaml
@@ -0,0 +1,17 @@
+source:
+ # 文件或目录使用绝对路径,绝对路径按代码库根目录计算,以/开头。
+ # 提供产品代码库中编写的测试代码存放目录或文件名格式,以便后续代码统计环节进行排除等特殊处理
+ # 不要使用.*/等正则表达式屏蔽掉所有代码,会导致部门代码量骤减从而影响部门代码得分,还会导致Coverity扫不到任何代码而失败
+ # 请勿使用Tab键,将会导致yaml解析出错
+ # test_source:
+ # #用于匹配文件; 匹配方式为正则表达式。
+ # filepath_regex: [".*/java/test/.*", ".*/test.java"]
+ # 提供产品代码库中工具或框架自动生成的且在代码库中的代码,没有可为空。以便后续代码统计环节进行排除等特殊处理。
+ # auto_generate_source:
+ # # 自动生成代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例
+ # filepath_regex:
+ # 提供产品代码库中直接以源码形式存在的第三方代码目录或代码文件名的正则表达。
+ # 此处备注的第三方代码在后续统计代码量环节会被排除,若代码库中不存在需要排除的第三方代码,该项配置标识可为空
+ third_party_source:
+ #第三方代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例
+ filepath_regex:[".*/mars/zstd/.*", ".*/mars/googletest/.*", ".*/mars/googlemock/.*", ".*/mars/boost/.*"]
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 8fa7d3a4c..2e1821d84 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,13 +6,12 @@
build/
/mars/captures
obj/
-
+.vscode/
*.swp
*.pyc
xcuserdata
xcshareddata
-/mars/comm/verinfo.h
/mars/libraries/*/
/mars/*/libs/
!/mars/boost/libs/
@@ -56,7 +55,7 @@ xcshareddata
/mars/log/win32proj/Debug/*.pdb
/mars/log/win32proj/Debug/log.tlog/*.tlog
/mars/log/win32proj/Debug/log.tlog/*.lastbuildstate
-/mars/log/win32proj/Debug/log.tlog/*
+/mars/xlog/win32proj/Debug/log.tlog/*
/samples/win32test/Debug/*.obj
/samples/win32test/Debug/*.idb
/samples/win32test/Debug/*.pdb
@@ -89,3 +88,31 @@ xcshareddata
.autotools
.cproject
.project
+*.lib
+*.pdb
+mars/win32proj/Debug/mars.lastbuildstate
+mars/win32proj/Debug/mars.unsuccessfulbuild
+mars/comm/verinfo.h
+
+# cmake
+CMakeCache.txt
+CMakeFiles
+CMakeScripts
+Testing
+Makefile
+cmake_install.cmake
+install_manifest.txt
+compile_commands.json
+CTestTestfile.cmake
+.vs
+mars/*/Win32/Debug
+mars/Win32/Debug
+*.dir
+*.out
+Debug-iphonesimulator
+*.xcodeproj
+*.build
+cmake_build
+*.settings
+mars/cmake-build-debug
+mars/openssl/include/openssl/*
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 15d446552..9f5d98004 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -19,21 +19,21 @@ There are three main branches here:
1. `master` branch.
1. It is the latest (pre-)release branch. We use `master` for tags, with version number `1.1.0`, `1.2.0`, `1.3.0`...
2. **Don't submit any PR on `master` branch.**
-2. `dev` branch.
- 1. It is our stable developing branch. After full testing, `dev` will be merged to `master` branch for the next release.
- 2. **You are recommended to submit bugfix or feature PR on `dev` branch.**
+2. `develop` branch.
+ 1. It is our stable developing branch. After full testing, `develop` will be merged to `master` branch for the next release.
+ 2. **You are recommended to submit bugfix or feature PR on `develop` branch.**
3. `hotfix` branch.
1. It is the latest tag version for hot fix. If we accept your pull request, we may just tag with version number `1.1.1`, `1.2.3`.
2. **Only submit urgent PR on `hotfix` branch for next specific release.**
-Normal bugfix or feature request should be submitted to `dev` branch. After full testing, we will merge them to `master` branch for the next release.
+Normal bugfix or feature request should be submitted to `develop` branch. After full testing, we will merge them to `master` branch for the next release.
-If you have some urgent bugfixes on a published version, but the `master` branch have already far away with the latest tag version, you can submit a PR on hotfix. And it will be cherry picked to `dev` branch if it is possible.
+If you have some urgent bugfixes on a published version, but the `master` branch have already far away with the latest tag version, you can submit a PR on hotfix. And it will be cherry picked to `develop` branch if it is possible.
```
master
↑
-dev <--- hotfix PR
+develop <--- hotfix PR
↑
feature/bugfix PR
```
@@ -48,7 +48,7 @@ Before submitting a pull request, please make sure the followings are done:
3. Add the copyright notice to the top of any new files you've added.
4. Check your code lints and checkstyles.
5. Test and test again your code.
-6. Now, you can submit your pull request on `dev` or `hotfix` branch.
+6. Now, you can submit your pull request on `develop` or `hotfix` branch.
## Code Style Guide
Use [Code Style for C/C++](http://zh-google-styleguide.readthedocs.io/en/latest/google-cpp-styleguide/).
diff --git a/LICENSE b/LICENSE
index 2109939ac..9fcda23d1 100644
--- a/LICENSE
+++ b/LICENSE
@@ -31,6 +31,9 @@ All rights reserved.
Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches
All right reserved
+5. google protobuf
+Copyright 2014, Google Inc. All rights reserved.
+
Terms of the BSD 3-Clause License:
--------------------------------------------------------------------
@@ -262,3 +265,22 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+BSD 2-clause "Simplified" License
+--------------------------------------------------------------------
+micro-ecc
+
+Copyright (c) 2014, Kenneth MacKay
+All rights reserved.
+
+
+Terms of the BSD 2-clause "Simplified" License:
+--------------------------------------------------------------------
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index 85b8db59a..53ff68ceb
--- a/README.md
+++ b/README.md
@@ -1,15 +1,15 @@
## Mars
[](https://github.com/Tencent/mars/blob/master/LICENSE)
-[](https://github.com/Tencent/mars/releases)
+[](https://github.com/Tencent/mars/releases)
[](https://github.com/Tencent/mars/pulls)
-[](https://github.com/Tencent/mars/wiki)
-[](https://github.com/Tencent/mars/wiki)
+[](https://github.com/Tencent/mars/wiki)
+[-%20iOS%20%7C%20OS%20X%20%7C%20Android(ndkr20)%20%7C%20Windows(vs2015)%20-brightgreen.svg)](https://github.com/Tencent/mars/wiki)
(中文版本请参看[这里](#mars_cn))
Mars is a cross-platform infrastructure component developed by WeChat Mobile Team.
-It is proved to be effective by billions of WeChat users.
+It has been proved to be effective by billions of WeChat users.
1. Cross platform, easy to deploy if you are developing multi-platform or multi-business application.
2. Suitable for small amount data transmission
@@ -29,11 +29,13 @@ Start with sample usage [here](https://github.com/Tencent/mars/wiki/Mars-sample-
## Getting started
-Choose [Android](#android) or [iOS/OS X](#apple).
+python scripts only support python3.10 or higher
+
+Choose [Android](#android) or [iOS/OS X](#apple) or [Windows](#windows).
### [Android](https://github.com/Tencent/mars/wiki/Mars-Android-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97)
-You can use either [mars-wrapper](#wrapper) or [mars-core](#core). We recommend you to use mars-wrapper when you just wanna build a sample or demo, while mars-core is preferred to be used in your APP.
+You can use either [mars-wrapper](#wrapper) or [mars-core](#core). We recommend you to use mars-wrapper when you just want to build a sample or demo, while mars-core is preferred to be used in your APP.
#### mars-wrapper
@@ -41,7 +43,7 @@ Add dependencies by adding the following lines to your app/build.gradle.
```xml
dependencies {
- compile 'com.tencent.mars:mars-wrapper:1.1.3'
+ compile 'com.tencent.mars:mars-wrapper:1.2.5'
}
```
@@ -53,11 +55,21 @@ Add dependencies by adding the following lines to your app/build.gradle.
```xml
dependencies {
- compile 'com.tencent.mars:mars-core:1.1.3'
+ compile 'com.tencent.mars:mars-core:1.2.5'
}
```
+**OR**
+#### mars-xlog
+If you just want to user xlog, add dependencies by adding the following lines to your app/build.gradle.
+note: xlog is included in mars-core and mars-wrapper.
-If you read here, make sure you have added dependencies of mars-wrapper or mars-core.
+```xml
+dependencies {
+ compile 'com.tencent.mars:mars-xlog:1.2.5'
+}
+```
+
+If you read here, make sure you have added dependencies of mars-wrapper, mars-core or mars-xlog.
#### Xlog Init
@@ -66,23 +78,27 @@ Initialize Xlog when your APP starts. Remember to use an exclusive folder to sav
When multiple processes is used in your app, make sure that each process owns its exclusive log file.
```java
-System.loadLibrary("stlport_shared");
+System.loadLibrary("c++_shared");
System.loadLibrary("marsxlog");
final String SDCARD = Environment.getExternalStorageDirectory().getAbsolutePath();
final String logPath = SDCARD + "/marssample/log";
+// this is necessary, or may crash for SIGBUS
+final String cachePath = this.getFilesDir() + "/xlog"
+
//init xlog
-if (BuildConfig.DEBUG) {
- Xlog.appenderOpen(Xlog.LEVEL_DEBUG, Xlog.AppednerModeAsync, "", logPath, "MarsSample");
- Xlog.setConsoleLogOpen(true);
+Xlog xlog = new Xlog();
+Log.setLogImp(xlog);
+if (BuildConfig.DEBUG) {
+ Log.setConsoleLogOpen(true);
+ Log.appenderOpen(Xlog.LEVEL_DEBUG, Xlog.AppednerModeAsync, "", logPath, logFileName, 0);
} else {
- Xlog.appenderOpen(Xlog.LEVEL_INFO, Xlog.AppednerModeAsync, "", logPath, "MarsSample");
- Xlog.setConsoleLogOpen(false);
+ Log.setConsoleLogOpen(false);
+ Log.appenderOpen(Xlog.LEVEL_INFO, Xlog.AppednerModeAsync, "", logPath, logFileName, 0);
}
-Log.setLogImp(new Xlog());
```
Uninitialized Xlog when your app exits
@@ -94,7 +110,7 @@ Log.appenderClose();
#### STN Init
-If you add dependencies of mars-core to your project, you need to initialize and release STN.
+If you add dependencies of mars-core to your project, you need to initialize and release STN.
Initialize STN before you use it
```java
@@ -156,13 +172,18 @@ If you want to modify the encryption algorithm of Xlog, the packer/unpacker of l
### [iOS/OS X](https://github.com/Tencent/mars/wiki/Mars-iOS%EF%BC%8FOS-X-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97)
Compile
+```python
+python build_ios.py
```
-python build_apple.py
+
+or
+```python
+python build_osx.py
```
1. Add mars.framework as a dependency of your project.
-2. Rename files with .rewriteme extension to .cc extension.
-3. Add header files and source files into your project.
+2. Rename files in mars/libraries/mars_android_sdk/jni with .rewriteme extension to .cc extension.
+3. Add header files in mars/libraries/mars_android_sdk/jni and source files from step 2 into your project.
#### Xlog Init
@@ -184,17 +205,26 @@ appender_set_console_log(true);
xlogger_SetLevel(kLevelInfo);
appender_set_console_log(false);
#endif
-appender_open(kAppednerAsync, [logPath UTF8String], "Test");
+XLogConfig config;
+config.mode_ = kAppenderAsync;
+config.logdir_ = [logPath UTF8String];
+config.nameprefix_ = "Test";
+config.pub_key_ = "";
+config.compress_mode_ = kZlib;
+config.compress_level_ = 0;
+config.cachedir_ = "";
+config.cache_days_ = 0;
+appender_open(config);
```
-Uninitialized xlog in function "applicationWillTerminate"
+Close xlog in function "applicationWillTerminate"
```cpp
appender_close();
```
-####STN Init
+#### STN Init
Initialize STN before you use it:
@@ -237,7 +267,7 @@ Initialize STN before you use it:
}
- (void)reportEvent_OnForeground:(BOOL)isForeground {
- mars::baseevent::OnForeground(isForground);
+ mars::baseevent::OnForeground(isForeground);
}
- (void)makesureLongLinkConnect {
@@ -245,7 +275,7 @@ Initialize STN before you use it:
}
```
-Firstly, you should call the setCalBack interface, and secondly, the Mars.init. Then, to initialize the Mars, there is to need to strictly follow the orders of the four commands. Finally, after Mars are initialized, onForeground and makesureLongLinkConnect can be called.
+Firstly, you should call the setCallBack interface, and secondly, the Mars.init. Then, to initialize the Mars, there is to need to strictly follow the orders of the four commands. Finally, after Mars are initialized, onForeground and makesureLongLinkConnect can be called.
If you want to destroy STN or exit App:
@@ -261,7 +291,7 @@ When the App's state of background or foreground is changed:
```objc
- (void)reportEvent_OnForeground:(BOOL)isForeground {
- mars::baseevent::OnForeground(isForground);
+ mars::baseevent::OnForeground(isForeground);
}
```
@@ -273,6 +303,88 @@ Network change:
}
```
+### [Windows](https://github.com/Tencent/mars/wiki/Mars-Windows-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97)
+Install Visual Studio 2015.
+
+Compile
+```python
+python build_windows.py
+```
+
+1. Add mars.lib as a dependency of your project.
+2. Rename files in mars/libraries/mars_android_sdk/jni with .rewriteme extension to .cc extension.
+3. Add header files in mars/libraries/mars_android_sdk/jni and source files from step 2 into your project.
+
+#### Xlog Init
+
+Initialize Xlog when your app starts. Remember to use an exclusive folder to save the log files, no other files are acceptable in the folder since they would be removed by the cleansing function in Xlog automatically.
+
+```cpp
+std::string logPath = ""; //use your log path
+std::string pubKey = ""; //use you pubkey for log encrypt
+
+// init xlog
+#if DEBUG
+xlogger_SetLevel(kLevelDebug);
+appender_set_console_log(true);
+#else
+xlogger_SetLevel(kLevelInfo);
+appender_set_console_log(false);
+#endif
+appender_open(kAppenderAsync, logPath.c_str(), "Test", 0, pubKey.c_str());
+```
+
+Uninitialized xlog before your app exits
+
+
+```cpp
+appender_close();
+```
+
+#### STN Init
+
+Initialize STN before you use it:
+
+```cpp
+void setShortLinkDebugIP(const std::string& _ip, unsigned short _port)
+{
+ mars::stn::SetShortlinkSvrAddr(_port, _ip);
+}
+void setShortLinkPort(unsigned short _port)
+{
+ mars::stn::SetShortlinkSvrAddr(_port, "");
+}
+void setLongLinkAddress(const std::string& _ip, unsigned short _port, const std::string& _debug_ip)
+{
+ vector ports;
+ ports.push_back(_port);
+ mars::stn::SetLonglinkSvrAddr(_ip, ports, _debug_ip);
+}
+
+void Init()
+{
+ mars::stn::SetCallback(mars::stn::StnCallBack::Instance());
+ mars::app::SetCallback(mars::app::AppCallBack::Instance());
+ mars::baseevent::OnCreate();
+
+ //todo
+ //mars::stn::SetClientVersion(version);
+ //setShortLinkDebugIP(...)
+ //setLongLinkAddress(...)
+
+ mars::baseevent::OnForeground(true);
+ mars::stn::MakesureLonglinkConnected();
+}
+```
+
+Firstly, you should call the setCalBack interface, and secondly, the Mars.init. Then, to initialize the Mars, there is to need to strictly follow the orders of the four commands. Finally, after Mars are initialized, onForeground and makesureLongLinkConnect can be called.
+
+If you want to destroy STN or exit App:
+
+```cpp
+mars::baseevent::OnDestroy();
+```
+
## Support
Any problem?
@@ -290,15 +402,14 @@ For more information about contributing issues or pull requests, see our [Mars C
Mars is under the MIT license. See the [LICENSE](https://github.com/Tencent/mars/blob/master/LICENSE) file for details.
-
------------------------------
## Mars
[](https://github.com/Tencent/mars/blob/master/LICENSE)
-[](https://github.com/Tencent/mars/releases)
+[](https://github.com/Tencent/mars/releases)
[](https://github.com/Tencent/mars/pulls)
-[](https://github.com/Tencent/mars/wiki)
-[](https://github.com/Tencent/mars/wiki)
+[](https://github.com/Tencent/mars/wiki)
+[](https://github.com/Tencent/mars/wiki)
Mars 是微信官方的跨平台跨业务的终端基础组件。
@@ -310,15 +421,16 @@ Mars 是微信官方的跨平台跨业务的终端基础组件。
* SDT: 网络诊断组件;
* STN: 信令分发网络模块,也是 Mars 最主要的部分。
-##Samples
+## Samples
sample 的使用请参考[这里](https://github.com/Tencent/mars/wiki/Mars-sample-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E)。
-##Getting started
+## Getting started
-接入 [Android](#android) 或者 [iOS/OS X](#apple)。
+python >= 3,10
+接入 [Android](#android_cn) 或者 [iOS/OS X](#apple_cn) 或者 [Windows](#windows_cn) 。
-###[Android](https://github.com/Tencent/mars/wiki/Mars-Android-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97)
+### [Android](https://github.com/Tencent/mars/wiki/Mars-Android-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97)
gradle 接入我们提供了两种接入方式:[mars-wrapper](#wrapper) 或者 [mars-core](#core)。如果你只是想做个 sample 推荐使用 mars-wrapper,可以快速开发;但是如果你想把 mars 用到你的 app 中的话,推荐使用 mars-core,可定制性更高。
@@ -329,7 +441,7 @@ gradle 接入我们提供了两种接入方式:[mars-wrapper](#wrapper) 或者
```xml
dependencies {
- compile 'com.tencent.mars:mars-wrapper:1.1.3'
+ compile 'com.tencent.mars:mars-wrapper:1.2.5'
}
```
@@ -342,10 +454,18 @@ dependencies {
```xml
dependencies {
- compile 'com.tencent.mars:mars-core:1.1.3'
+ compile 'com.tencent.mars:mars-core:1.2.5'
}
```
-接着往下操作之前,请先确保你已经添加了 mars-wrapper 或者 mars-core 的依赖
+**或者**
+#### mars-xlog
+如果只想使用 xlog,可以只加 xlog 的依赖(mars-core,mars-wrapper 中都已经包括 xlog):
+```xml
+dependencies {
+ compile 'com.tencent.mars:mars-xlog:1.2.5'
+}
+```
+接着往下操作之前,请先确保你已经添加了 mars-wrapper 或者 mars-core 或者 mars-xlog 的依赖
#### Xlog Init
@@ -353,19 +473,30 @@ dependencies {
```java
-System.loadLibrary("stlport_shared");
+System.loadLibrary("c++_shared");
System.loadLibrary("marsxlog");
final String SDCARD = Environment.getExternalStorageDirectory().getAbsolutePath();
final String logPath = SDCARD + "/marssample/log";
+// this is necessary, or may crash for SIGBUS
+final String cachePath = this.getFilesDir() + "/xlog"
+
//init xlog
+Xlog.XLogConfig logConfig = new Xlog.XLogConfig();
+logConfig.mode = Xlog.AppednerModeAsync;
+logConfig.logdir = logPath;
+logConfig.nameprefix = logFileName;
+logConfig.pubkey = "";
+logConfig.compressmode = Xlog.ZLIB_MODE;
+logConfig.compresslevel = 0;
+logConfig.cachedir = "";
+logConfig.cachedays = 0;
if (BuildConfig.DEBUG) {
- Xlog.appenderOpen(Xlog.LEVEL_DEBUG, Xlog.AppednerModeAsync, "", logPath, "MarsSample");
+ logConfig.level = Xlog.LEVEL_VERBOSE;
Xlog.setConsoleLogOpen(true);
-
} else {
- Xlog.appenderOpen(Xlog.LEVEL_INFO, Xlog.AppednerModeAsync, "", logPath, "MarsSample");
+ logConfig.level = Xlog.LEVEL_INFO;
Xlog.setConsoleLogOpen(false);
}
@@ -441,17 +572,21 @@ BaseEvent.onForeground(boolean);
StnLogic.reset();
```
-如果你想修改 Xlog 的加密算法或者长短连的加解包部分甚至更改组件的其他部分,可以参考[这里]
-(https://github.com/Tencent/mars/wiki/Mars-Android-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97)
+如果你想修改 Xlog 的加密算法或者长短连的加解包部分甚至更改组件的其他部分,可以参考[这里](https://github.com/Tencent/mars/wiki/Mars-Android-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97)
-### [iOS/OS X](https://github.com/Tencent/mars/wiki/Mars-iOS%EF%BC%8FOS-X-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97)
+### [iOS/OS X](https://github.com/Tencent/mars/wiki/Mars-iOS%EF%BC%8FOS-X-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97)
编译
```
-python build_apple.py
+python build_ios.py
+```
+
+or
+```python
+python build_osx.py
```
-把 mars.framework 作为依赖加入到你的项目中,把和 mars.framework 同目录的后缀名为 rewriteme 的文件名删掉".rewriteme"和头文件一起加入到你的项目中。
+把 mars.framework 作为依赖加入到你的项目中,把mars/libraries/mars_android_sdk/jni 目录的后缀名为 rewriteme 的文件名删掉".rewriteme"和头文件一起加入到你的项目中。
#### Xlog Init
@@ -474,7 +609,17 @@ appender_set_console_log(true);
xlogger_SetLevel(kLevelInfo);
appender_set_console_log(false);
#endif
-appender_open(kAppednerAsync, [logPath UTF8String], "Test");
+
+XLogConfig config;
+config.mode_ = kAppenderAsync;
+config.logdir_ = [logPath UTF8String];
+config.nameprefix_ = "Test";
+config.pub_key_ = "";
+config.compress_mode_ = kZlib;
+config.compress_level_ = 0;
+config.cachedir_ = "";
+config.cache_days_ = 0;
+appender_open(config);
```
在函数 "applicationWillTerminate" 中反初始化 Xlog
@@ -562,6 +707,86 @@ appender_close();
mars::baseevent::OnNetworkChange();
}
```
+### [Windows](https://github.com/Tencent/mars/wiki/Mars-Windows-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97)
+安装Visual Studio 2015
+
+编译
+
+```python
+python build_windows.py
+```
+
+把 mars.lib作为依赖加入到你的项目中,把mars/libraries/mars_android_sdk/jni 目录的后缀名为 rewriteme 的文件名删掉".rewriteme"和头文件一起加入到你的项目中。
+
+#### Xlog Init
+
+在程序启动加载 Xlog 后紧接着初始化 Xlog。但要注意保存 log 的目录请使用单独的目录,不要存放任何其他文件防止被 xlog 自动清理功能误删。
+
+```cpp
+std::string logPath = ""; //use your log path
+std::string pubKey = ""; //use you pubkey for log encrypt
+
+// init xlog
+#if DEBUG
+xlogger_SetLevel(kLevelDebug);
+appender_set_console_log(true);
+#else
+xlogger_SetLevel(kLevelInfo);
+appender_set_console_log(false);
+#endif
+appender_open(kAppenderAsync, logPath.c_str(), "Test", 0, pubKey.c_str());
+```
+
+在程序退出前反初始化 Xlog
+
+```cpp
+appender_close();
+```
+
+#### STN Init
+
+在你用 STN 之前初始化:
+
+```cpp
+void setShortLinkDebugIP(const std::string& _ip, unsigned short _port)
+{
+ mars::stn::SetShortlinkSvrAddr(_port, _ip);
+}
+void setShortLinkPort(unsigned short _port)
+{
+ mars::stn::SetShortlinkSvrAddr(_port, "");
+}
+void setLongLinkAddress(const std::string& _ip, unsigned short _port, const std::string& _debug_ip)
+{
+ vector ports;
+ ports.push_back(_port);
+ mars::stn::SetLonglinkSvrAddr(_ip, ports, _debug_ip);
+}
+
+void Init()
+{
+ mars::stn::SetCallback(mars::stn::StnCallBack::Instance());
+ mars::app::SetCallback(mars::app::AppCallBack::Instance());
+ mars::baseevent::OnCreate();
+
+ //todo
+ //mars::stn::SetClientVersion(version);
+ //setShortLinkDebugIP(...)
+ //setLongLinkAddress(...)
+
+ mars::baseevent::OnForeground(true);
+ mars::stn::MakesureLonglinkConnected();
+}
+```
+
+初始化顺序不一定要严格遵守上述代码的顺序,但在初始化时首先要调用 setCallBack 接口 (callback 文件的编写可以参考 demo),再调用 Mars.init,最后再调用 onForeground 和 makesureLongLinkConnect,中间顺序可以随意更改。**注意:STN 默认是后台,所以初始化 STN 后需要主动调用一次**```BaseEvent.onForeground(true)```
+
+
+需要释放 STN 或者退出程序时:
+
+```cpp
+mars::baseevent::OnDestroy();
+```
## Support
@@ -577,3 +802,11 @@ appender_close();
## License
Mars 使用的 MIT 协议,详细请参考 [LICENSE](https://github.com/Tencent/mars/blob/master/LICENSE)。
+
+## 信息公示
+* SDK名称:Mars
+* 版本号:0.2.0
+* 开发者:深圳市腾讯计算机系统有限公司
+* 主要功能:Mars 是微信官方的跨平台跨业务的终端基础组件。支持iOS、macOS 和Android。Mars 针对移动网络的特点进行了优化,最终提供了高性能的网络功能。
+* [Mars 使用说明](https://github.com/Tencent/mars)
+* [Mars 个人信息保护规则](https://support.weixin.qq.com/cgi-bin/mmsupportacctnodeweb-bin/pages/L60iIjTc9G2A383f)
\ No newline at end of file
diff --git a/clang_format_ignore.txt b/clang_format_ignore.txt
new file mode 100644
index 000000000..95a69c95c
--- /dev/null
+++ b/clang_format_ignore.txt
@@ -0,0 +1,34 @@
+mars/mars/boost
+mars/mars/googletest
+mars/mars/googlemock
+mars/mars/rapidjson
+mars/mars/log/crypt/micro-ecc-master
+mars/mars/comm/UWP/zlib
+mars/mars/openssl
+mars/mars/zstd/tests
+mars/samples
+
+mars-private/mars/mmjpeg
+mars-private/mars/protobuf
+mars-private/mars/cdn/src/proto
+mars-private/mars/cdn/src/protocol
+mars-private/mars/openssl
+mars-private/mars/vfs
+mars-private/mars/smc/src/protobuf
+
+mars-private/mars/andromeda/andromeda.h
+mars-private/mars/andromeda/cronet_android_jni_callback.h
+mars-private/mars/andromeda/cronet_file_task_runer_wrapper.h
+mars-private/mars/andromeda/http_cronet_context_builder.h
+mars-private/mars/andromeda/http_network_estimate_callback.h
+mars-private/mars/andromeda/http_result_callback.h
+mars-private/mars/andromeda/http_with_cronet.h
+
+mars-wechat/mars/webp
+mars-wechat/mars/accessory
+
+build
+cmake_build
+tools
+mmnet
+openssl-build-tools
diff --git a/codecc.sh b/codecc.sh
new file mode 100755
index 000000000..fc0f5d096
--- /dev/null
+++ b/codecc.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# build libraries for android
+export ANDROID_NDK_HOME=/usr/local/android-ndks/android-ndk-r16b
+export NDK_ROOT=/usr/local/android-ndks/android-ndk-r16b
+python mars/build_android.py 1 armeabi
diff --git a/mars/CMakeLists.txt b/mars/CMakeLists.txt
new file mode 100644
index 000000000..1107a05b7
--- /dev/null
+++ b/mars/CMakeLists.txt
@@ -0,0 +1,87 @@
+cmake_minimum_required (VERSION 3.6)
+
+set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE)
+message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
+
+include_directories(openssl/include)
+
+add_subdirectory(comm comm)
+add_subdirectory(boot boot)
+add_subdirectory(boost boost)
+add_subdirectory(app app)
+add_subdirectory(baseevent baseevent)
+add_subdirectory(xlog xlog)
+add_subdirectory(sdt sdt)
+add_subdirectory(stn stn)
+
+# for zstd
+option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON)
+option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF)
+set(ZSTD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zstd")
+set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
+include(GNUInstallDirs)
+add_subdirectory(zstd/build/cmake/lib zstd)
+
+project (mars)
+
+include(comm/utils.cmake)
+
+include_directories(.)
+include_directories(..)
+
+set(SELF_LIBS_OUT ${CMAKE_SYSTEM_NAME}.out)
+
+if(ANDROID)
+
+ if(NATIVE_CALLBACK)
+ message("common native callback")
+ add_definitions(-DNATIVE_CALLBACK)
+ endif()
+
+ find_library(log-lib log)
+ find_library(z-lib z)
+
+ link_directories(app baseevent xlog sdt stn comm boost zstd)
+
+ # marsxlog
+ set(SELF_LIB_NAME marsxlog)
+ file(GLOB SELF_SRC_FILES libraries/mars_android_sdk/jni/JNI_OnLoad.cc
+ libraries/mars_xlog_sdk/jni/import.cc)
+ add_library(${SELF_LIB_NAME} SHARED ${SELF_SRC_FILES})
+ install(TARGETS ${SELF_LIB_NAME} LIBRARY DESTINATION ${SELF_LIBS_OUT} ARCHIVE DESTINATION ${SELF_LIBS_OUT})
+ get_filename_component(EXPORT_XLOG_EXP_FILE libraries/mars_android_sdk/jni/export.exp ABSOLUTE)
+ set(SELF_XLOG_LINKER_FLAG "-Wl,--gc-sections -Wl,--version-script='${EXPORT_XLOG_EXP_FILE}'")
+ if(ANDROID_ABI STREQUAL "x86_64" OR ANDROID_ABI STREQUAL "x86")
+ set(SELF_XLOG_LINKER_FLAG "-Wl,--gc-sections -Wl,--version-script='${EXPORT_XLOG_EXP_FILE}' -Wl,--no-warn-shared-textrel")
+ endif()
+ target_link_libraries(${SELF_LIB_NAME} "${SELF_XLOG_LINKER_FLAG}"
+ xlog
+ mars-boost
+ comm
+ libzstd_static
+ ${log-lib}
+ ${z-lib}
+ )
+
+ # marsstn
+ set(SELF_LIB_NAME marsstn)
+ file(GLOB SELF_SRC_FILES libraries/mars_android_sdk/jni/*.cc)
+ add_library(${SELF_LIB_NAME} SHARED ${SELF_SRC_FILES})
+ install(TARGETS ${SELF_LIB_NAME} LIBRARY DESTINATION ${SELF_LIBS_OUT} ARCHIVE DESTINATION ${SELF_LIBS_OUT})
+ link_directories(${SELF_LIBS_OUT})
+ find_library(CRYPT_LIB crypto PATHS openssl/openssl_lib_android/${ANDROID_ABI} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ find_library(SSL_LIB ssl PATHS openssl/openssl_lib_android/${ANDROID_ABI} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ target_link_libraries(${SELF_LIB_NAME} "-Wl,--gc-sections"
+ ${log-lib}
+ stn
+ sdt
+ app
+ baseevent
+ comm
+ boot
+ mars-boost
+ marsxlog
+ libzstd_static
+ ${SSL_LIB}
+ ${CRYPT_LIB})
+endif()
diff --git a/mars/app/.cproject b/mars/app/.cproject
deleted file mode 100644
index e73ca549e..000000000
--- a/mars/app/.cproject
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mars/app/.project b/mars/app/.project
deleted file mode 100644
index 448cccbf7..000000000
--- a/mars/app/.project
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
- appcomm_mars
-
-
- comm_mars
- log_mars
-
-
-
- org.eclipse.cdt.managedbuilder.core.genmakebuilder
- clean,full,incremental,
-
-
- ?name?
-
-
-
- org.eclipse.cdt.make.core.append_environment
- true
-
-
- org.eclipse.cdt.make.core.buildArguments
-
-
-
- org.eclipse.cdt.make.core.buildCommand
- ndk-build
-
-
- org.eclipse.cdt.make.core.cleanBuildTarget
- clean
-
-
- org.eclipse.cdt.make.core.contents
- org.eclipse.cdt.make.core.activeConfigSettings
-
-
- org.eclipse.cdt.make.core.enableAutoBuild
- false
-
-
- org.eclipse.cdt.make.core.enableCleanBuild
- true
-
-
- org.eclipse.cdt.make.core.enableFullBuild
- true
-
-
- org.eclipse.cdt.make.core.fullBuildTarget
- V=1 NDK_DEBUG=0 -j2 LIBPREFIX=wechat
-
-
- org.eclipse.cdt.make.core.stopOnError
- true
-
-
- org.eclipse.cdt.make.core.useDefaultBuildCmd
- true
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
- full,incremental,
-
-
-
-
-
- org.eclipse.cdt.core.cnature
- org.eclipse.cdt.core.ccnature
- org.eclipse.cdt.managedbuilder.core.managedBuildNature
- org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
-
-
diff --git a/mars/app/CMakeLists.txt b/mars/app/CMakeLists.txt
new file mode 100644
index 000000000..75a47ef38
--- /dev/null
+++ b/mars/app/CMakeLists.txt
@@ -0,0 +1,42 @@
+cmake_minimum_required (VERSION 3.6)
+
+set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE)
+message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
+
+project (app)
+
+include(../comm/utils.cmake)
+include(../comm/CMakeExtraFlags.txt)
+
+include_directories(.)
+include_directories(src)
+include_directories(..)
+include_directories(../..)
+include_directories(../comm)
+include_directories(../../..)
+include_directories(../boot)
+
+file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} *.cc *.h)
+list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES})
+
+file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h)
+source_group(src FILES ${SELF_TEMP_SRC_FILES})
+list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES})
+
+
+if(MSVC)
+ add_definitions(/FI"../../comm/projdef.h")
+ include_directories(../comm/windows)
+elseif(ANDROID)
+ if(NOT CPP_CALL_BACK)
+ file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc)
+ endif()
+ if(NATIVE_CALLBACK)
+ message("applogic native callback")
+ add_definitions(-DNATIVE_CALLBACK)
+ endif()
+
+ list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES})
+endif()
+
+BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}")
diff --git a/mars/app/app-mac.xcodeproj/project.pbxproj b/mars/app/app-mac.xcodeproj/project.pbxproj
deleted file mode 100644
index 48b1aa01c..000000000
--- a/mars/app/app-mac.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,511 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 1F25BF0F1CD3647300AC1003 /* app_logic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF0C1CD3647300AC1003 /* app_logic.cc */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 3170A025177887B0004F5DDA /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "include/${PRODUCT_NAME}";
- dstSubfolderSpec = 16;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 1F25BF0C1CD3647300AC1003 /* app_logic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = app_logic.cc; sourceTree = ""; };
- 1F25BF0D1CD3647300AC1003 /* app_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = app_logic.h; sourceTree = ""; };
- 1F25BF0E1CD3647300AC1003 /* app.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = app.h; sourceTree = ""; };
- 55D9C0821CC7B1C90076CBD9 /* libapp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libapp.a; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 3170A024177887B0004F5DDA /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 3170A01E177887B0004F5DDA = {
- isa = PBXGroup;
- children = (
- 1F25BF0C1CD3647300AC1003 /* app_logic.cc */,
- 1F25BF0D1CD3647300AC1003 /* app_logic.h */,
- 1F25BF0E1CD3647300AC1003 /* app.h */,
- 55D9C0821CC7B1C90076CBD9 /* libapp.a */,
- );
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 3170A026177887B0004F5DDA /* app */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "app" */;
- buildPhases = (
- 3170A023177887B0004F5DDA /* Sources */,
- 3170A024177887B0004F5DDA /* Frameworks */,
- 3170A025177887B0004F5DDA /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = app;
- productName = PublicComponent;
- productReference = 55D9C0821CC7B1C90076CBD9 /* libapp.a */;
- productType = "com.apple.product-type.library.static";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 3170A01F177887B0004F5DDA /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0460;
- ORGANIZATIONNAME = felixzhou;
- };
- buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "app-mac" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 3170A01E177887B0004F5DDA;
- productRefGroup = 3170A01E177887B0004F5DDA;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 3170A026177887B0004F5DDA /* app */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 3170A023177887B0004F5DDA /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 1F25BF0F1CD3647300AC1003 /* app_logic.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 3170A033177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = YES;
- ARCHS = "$(ARCHS_STANDARD_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 6.1;
- MACOSX_DEPLOYMENT_TARGET = 10.7;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx10.10;
- };
- name = Debug;
- };
- 3170A034177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = YES;
- ARCHS = "$(ARCHS_STANDARD_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 6.1;
- MACOSX_DEPLOYMENT_TARGET = 10.7;
- SDKROOT = macosx10.10;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 3170A036177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = /tmp/PublicComponent.dst;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "NETWORK=1",
- "KVCOMM=1",
- "XLOGGER=1",
- "DEBUG=1",
- "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = YES;
- GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = (
- $SOURCE_ROOT/,
- $SOURCE_ROOT/src,
- $SOURCE_ROOT/../,
- $SOURCE_ROOT/../../,
- $SOURCE_ROOT/../comm,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/comm/build/Release-iphoneos",
- "$(PROJECT_DIR)/comm/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/i386",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/netchecker/build/Release-iphoneos",
- "$(PROJECT_DIR)/netchecker/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdntran/build/Release-iphoneos",
- "$(PROJECT_DIR)/cdntran/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/streamcdn/build/Release-iphoneos",
- "$(PROJECT_DIR)/streamcdn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/i386",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmjpeg/build/Release-iphoneos",
- "$(PROJECT_DIR)/mmjpeg/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmjpeg/obj/local/armeabi",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/i386",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/app/build/Release-iphoneos",
- "$(PROJECT_DIR)/app/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/i386",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/i386",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/baseevent/build/Release-iphoneos",
- "$(PROJECT_DIR)/baseevent/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdn/build/Release-iphoneos",
- "$(PROJECT_DIR)/cdn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/i386",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/log/build/Release-iphoneos",
- "$(PROJECT_DIR)/log/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/i386",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/magicbox/build/Release-iphoneos",
- "$(PROJECT_DIR)/magicbox/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmcomm/build/Release-iphoneos",
- "$(PROJECT_DIR)/mmcomm/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmcomm/obj/local/armeabi",
- "$(PROJECT_DIR)/mmjpeg/build/Release",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/i386",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/protobuf/build/Release-iphoneos",
- "$(PROJECT_DIR)/protobuf/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/sdt/build/Release-iphoneos",
- "$(PROJECT_DIR)/sdt/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/i386",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/smc/build/Release-iphoneos",
- "$(PROJECT_DIR)/smc/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/i386",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/stn/build/Release-iphoneos",
- "$(PROJECT_DIR)/stn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/i386",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/openssl/build/Release-iphoneos",
- "$(PROJECT_DIR)/openssl/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/openssl/obj/local/armeabi",
- );
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = macosx;
- SKIP_INSTALL = YES;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 x86_64";
- };
- name = Debug;
- };
- 3170A037177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = /tmp/PublicComponent.dst;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "NETWORK=1",
- "KVCOMM=1",
- "XLOGGER=1",
- "NDEBUG=1",
- "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = YES;
- GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = (
- $SOURCE_ROOT/,
- $SOURCE_ROOT/src,
- $SOURCE_ROOT/../,
- $SOURCE_ROOT/../../,
- $SOURCE_ROOT/../comm,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/comm/build/Release-iphoneos",
- "$(PROJECT_DIR)/comm/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/i386",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/netchecker/build/Release-iphoneos",
- "$(PROJECT_DIR)/netchecker/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdntran/build/Release-iphoneos",
- "$(PROJECT_DIR)/cdntran/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/streamcdn/build/Release-iphoneos",
- "$(PROJECT_DIR)/streamcdn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/i386",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmjpeg/build/Release-iphoneos",
- "$(PROJECT_DIR)/mmjpeg/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmjpeg/obj/local/armeabi",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/i386",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/app/build/Release-iphoneos",
- "$(PROJECT_DIR)/app/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/i386",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/i386",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/baseevent/build/Release-iphoneos",
- "$(PROJECT_DIR)/baseevent/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdn/build/Release-iphoneos",
- "$(PROJECT_DIR)/cdn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/i386",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/log/build/Release-iphoneos",
- "$(PROJECT_DIR)/log/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/i386",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/magicbox/build/Release-iphoneos",
- "$(PROJECT_DIR)/magicbox/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmcomm/build/Release-iphoneos",
- "$(PROJECT_DIR)/mmcomm/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmcomm/obj/local/armeabi",
- "$(PROJECT_DIR)/mmjpeg/build/Release",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/i386",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/protobuf/build/Release-iphoneos",
- "$(PROJECT_DIR)/protobuf/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/sdt/build/Release-iphoneos",
- "$(PROJECT_DIR)/sdt/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/i386",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/smc/build/Release-iphoneos",
- "$(PROJECT_DIR)/smc/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/i386",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/stn/build/Release-iphoneos",
- "$(PROJECT_DIR)/stn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/i386",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/openssl/build/Release-iphoneos",
- "$(PROJECT_DIR)/openssl/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/openssl/obj/local/armeabi",
- );
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = macosx;
- SKIP_INSTALL = YES;
- STRIP_INSTALLED_PRODUCT = NO;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 x86_64";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "app-mac" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A033177887B0004F5DDA /* Debug */,
- 3170A034177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "app" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A036177887B0004F5DDA /* Debug */,
- 3170A037177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 3170A01F177887B0004F5DDA /* Project object */;
-}
diff --git a/mars/app/app.h b/mars/app/app.h
index cb1a6929e..1d3948658 100644
--- a/mars/app/app.h
+++ b/mars/app/app.h
@@ -1,7 +1,7 @@
// Tencent is pleased to support the open source community by making Mars available.
// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-// Licensed under the MIT License (the "License"); you may not use this file except in
+// Licensed under the MIT License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://opensource.org/licenses/MIT
@@ -20,29 +20,80 @@
#ifndef APPCOMM_INTERFACE_APPCOMM_H_
#define APPCOMM_INTERFACE_APPCOMM_H_
-#include
#include
+#include
+#include
+
+#include "mars/comm/comm_data.h"
+
namespace mars {
namespace app {
struct AccountInfo {
- AccountInfo():uin(0){}
- int64_t uin;
- std::string username;
+ AccountInfo() : uin(0), is_logoned(false) {
+ }
+ int64_t uin;
+ std::string username;
+ bool is_logoned;
};
struct DeviceInfo {
- std::string devicename;
- std::string devicetype;
+ std::string devicename;
+ std::string devicetype;
};
-
+
+/* mars2
+extern mars::comm::ProxyInfo GetProxyInfo(const std::string& _host);
extern std::string GetAppFilePath();
extern AccountInfo GetAccountInfo();
-extern std::string GetUserName();
+extern std::string GetAppUserName();
extern std::string GetRecentUserName();
extern unsigned int GetClientVersion();
extern DeviceInfo GetDeviceInfo();
-}}
+extern double GetOsVersion();
+*/
+
+// mars2
+class Callback {
+ public:
+ virtual ~Callback(){};
+
+ virtual bool GetProxyInfo(const std::string& _host, mars::comm::ProxyInfo& _proxy_info) {
+ return false;
+ }
+
+ virtual std::string GetAppFilePath() = 0;
+
+ virtual AccountInfo GetAccountInfo() = 0;
+
+ virtual unsigned int GetClientVersion() = 0;
+
+ virtual DeviceInfo GetDeviceInfo() = 0;
+};
+
+/* mars2
+#ifdef NATIVE_CALLBACK
+
+ class AppLogicNativeCallback {
+ public:
+ AppLogicNativeCallback() = default;
+ virtual ~AppLogicNativeCallback() = default;
+
+ virtual mars::comm::ProxyInfo GetProxyInfo(const std::string& _host) {return mars::comm::ProxyInfo();}
+ virtual std::string GetAppFilePath() {return "";}
+ virtual AccountInfo GetAccountInfo() {return AccountInfo();}
+ virtual std::string GetAppUserName() {return "";}
+ virtual std::string GetRecentUserName() {return "";}
+ virtual unsigned int GetClientVersion() {return 0;}
+ virtual DeviceInfo GetDeviceInfo() {return DeviceInfo();}
+ };
+ extern void SetAppLogicNativeCallback(std::shared_ptr _cb);
+
+#endif //NATIVE_CALLBACK
+*/
+
+} // namespace app
+} // namespace mars
#endif /* APPCOMM_INTERFACE_APPCOMM_H_ */
diff --git a/mars/app/app.xcodeproj/project.pbxproj b/mars/app/app.xcodeproj/project.pbxproj
deleted file mode 100644
index d33a3ba41..000000000
--- a/mars/app/app.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,312 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 1F25B30E1CD335FD00AC1003 /* app_logic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F25B30B1CD335FD00AC1003 /* app_logic.cc */; };
- 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3170A02A177887B0004F5DDA /* Foundation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 3170A025177887B0004F5DDA /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "include/${PRODUCT_NAME}";
- dstSubfolderSpec = 16;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 1F25B30B1CD335FD00AC1003 /* app_logic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = app_logic.cc; sourceTree = ""; };
- 1F25B30C1CD335FD00AC1003 /* app_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = app_logic.h; sourceTree = ""; };
- 1F25B30D1CD335FD00AC1003 /* app.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = app.h; sourceTree = ""; };
- 3170A027177887B0004F5DDA /* libapp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libapp.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 3170A02A177887B0004F5DDA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 3170A024177887B0004F5DDA /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 136359EA1981F37600EED49B /* src */ = {
- isa = PBXGroup;
- children = (
- );
- path = src;
- sourceTree = "";
- };
- 3170A01E177887B0004F5DDA = {
- isa = PBXGroup;
- children = (
- 1F25B30B1CD335FD00AC1003 /* app_logic.cc */,
- 1F25B30C1CD335FD00AC1003 /* app_logic.h */,
- 1F25B30D1CD335FD00AC1003 /* app.h */,
- 136359EA1981F37600EED49B /* src */,
- 3170A029177887B0004F5DDA /* Frameworks */,
- 3170A028177887B0004F5DDA /* Products */,
- );
- sourceTree = "";
- };
- 3170A028177887B0004F5DDA /* Products */ = {
- isa = PBXGroup;
- children = (
- 3170A027177887B0004F5DDA /* libapp.a */,
- );
- name = Products;
- sourceTree = "";
- };
- 3170A029177887B0004F5DDA /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 3170A02A177887B0004F5DDA /* Foundation.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 3170A026177887B0004F5DDA /* app */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "app" */;
- buildPhases = (
- 3170A023177887B0004F5DDA /* Sources */,
- 3170A024177887B0004F5DDA /* Frameworks */,
- 3170A025177887B0004F5DDA /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = app;
- productName = PublicComponent;
- productReference = 3170A027177887B0004F5DDA /* libapp.a */;
- productType = "com.apple.product-type.library.static";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 3170A01F177887B0004F5DDA /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0720;
- ORGANIZATIONNAME = Tencent;
- };
- buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "app" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 3170A01E177887B0004F5DDA;
- productRefGroup = 3170A028177887B0004F5DDA /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 3170A026177887B0004F5DDA /* app */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 3170A023177887B0004F5DDA /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 1F25B30E1CD335FD00AC1003 /* app_logic.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 3170A033177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- ENABLE_BITCODE = NO;
- ENABLE_TESTABILITY = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = iphoneos;
- };
- name = Debug;
- };
- 3170A034177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- ENABLE_BITCODE = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1";
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- SDKROOT = iphoneos;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 3170A036177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_DEBUG_INFORMATION_LEVEL = default;
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = /tmp/net_comm.dst;
- ENABLE_BITCODE = YES;
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_ENABLE_CPP_EXCEPTIONS = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = NO;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- MACOS,
- "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = YES;
- GCC_VERSION = "";
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = (
- $SOURCE_ROOT/,
- $SOURCE_ROOT/../,
- $SOURCE_ROOT/../../,
- $SOURCE_ROOT/../comm,
- );
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_CPLUSPLUSFLAGS = (
- "$(OTHER_CFLAGS)",
- "-fno-exceptions",
- );
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = app;
- SKIP_INSTALL = YES;
- STRIP_INSTALLED_PRODUCT = YES;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 armv7 arm64 x86_64";
- };
- name = Debug;
- };
- 3170A037177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_DEBUG_INFORMATION_LEVEL = "line-tables-only";
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = /tmp/net_comm.dst;
- ENABLE_BITCODE = YES;
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_ENABLE_CPP_EXCEPTIONS = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = NO;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "NDEBUG=1",
- MACOS,
- "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = YES;
- GCC_VERSION = "";
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = (
- $SOURCE_ROOT/,
- $SOURCE_ROOT/../,
- $SOURCE_ROOT/../../,
- $SOURCE_ROOT/../comm,
- );
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_CPLUSPLUSFLAGS = (
- "$(OTHER_CFLAGS)",
- "-fno-exceptions",
- );
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = app;
- SKIP_INSTALL = YES;
- STRIP_INSTALLED_PRODUCT = YES;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 armv7 arm64 x86_64";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "app" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A033177887B0004F5DDA /* Debug */,
- 3170A034177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "app" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A036177887B0004F5DDA /* Debug */,
- 3170A037177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 3170A01F177887B0004F5DDA /* Project object */;
-}
diff --git a/mars/app/app_logic.cc b/mars/app/app_logic.cc
index 5dfca205e..5b6588554 100644
--- a/mars/app/app_logic.cc
+++ b/mars/app/app_logic.cc
@@ -1,7 +1,7 @@
// Tencent is pleased to support the open source community by making Mars available.
// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-// Licensed under the MIT License (the "License"); you may not use this file except in
+// Licensed under the MIT License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://opensource.org/licenses/MIT
@@ -13,7 +13,7 @@
// Tencent is pleased to support the open source community by making Mars available.
// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-// Licensed under the MIT License (the "License"); you may not use this file except in
+// Licensed under the MIT License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://opensource.org/licenses/MIT
@@ -30,55 +30,260 @@
*/
#include "mars/app/app_logic.h"
+
+#ifdef __APPLE__
+#include
+
+#include "mars/comm/objc/data_protect_attr.h"
+#endif
+
+#include "app_manager.h"
+#include "mars/baseevent/baseprjevent.h"
+#include "mars/boot/context.h"
+#include "mars/comm/anr.h"
+#include "mars/comm/bootrun.h"
+#include "mars/comm/dns/dns.h"
+#include "mars/comm/macro.h"
+#include "mars/comm/time_utils.h"
#include "mars/comm/xlogger/xlogger.h"
+using namespace mars::boot;
+using namespace mars::comm;
namespace mars {
namespace app {
-static Callback* sg_callback = NULL;
+// mars2
+// static Callback* sg_callback = NULL;
void SetCallback(Callback* const callback) {
- sg_callback = callback;
+ /* mars2
+ sg_callback = callback;
+ */
+ AppManager* app_manager = Context::CreateContext("default")->GetManager();
+ xassert2(NULL != app_manager, "mars2 app_manager is empty.");
+ if (app_manager) {
+ app_manager->SetCallback(callback);
+ }
}
-#ifndef ANDROID
+#if !defined(ANDROID) || defined(CPP_CALL_BACK)
- std::string GetAppFilePath() {
- xassert2(sg_callback != NULL);
- return sg_callback->GetAppFilePath();
+/* mars2
+NO_DESTROY static mars::comm::ProxyInfo sg_proxyInfo;
+ static bool sg_gotProxy = false;
+NO_DESTROY static Mutex sg_slproxymutex;
+NO_DESTROY static Thread sg_slproxyThread;
+ static uint64_t sg_slporxytimetick = gettickcount();
+ static int sg_slproxycount = 0;
+*/
+
+static void __GetProxyInfo(const std::string& _host, uint64_t _timetick) {
+ /* mars2
+ xinfo_function(TSF"timetick:%_, host:%_", _timetick, _host);
+
+ mars::comm::ProxyInfo proxy_info;
+ if (!sg_callback->GetProxyInfo(_host, proxy_info)) {
+ ScopedLock lock(sg_slproxymutex);
+ if (_timetick != sg_slporxytimetick) {
+ return;
+ }
+ ++ sg_slproxycount;
+ return;
+ }
+
+ ScopedLock lock(sg_slproxymutex);
+ if (_timetick != sg_slporxytimetick) {
+ return;
+ }
+
+ ++ sg_slproxycount;
+
+ sg_proxyInfo = proxy_info;
+
+ if (mars::comm::kProxyNone == sg_proxyInfo.type || !sg_proxyInfo.ip.empty() || sg_proxyInfo.host.empty()) {
+ sg_gotProxy = true;
+ return;
+ }
+
+ std::string host = sg_proxyInfo.host;
+ lock.unlock();
+
+ static DNS s_dns;
+ std::vector ips;
+ s_dns.GetHostByName(host, ips);
+
+ if (ips.empty()) {
+ return;
}
-
- AccountInfo GetAccountInfo() {
- xassert2(sg_callback != NULL);
- return sg_callback->GetAccountInfo();
- }
- std::string GetUserName() {
- xassert2(sg_callback != NULL);
- AccountInfo info = sg_callback->GetAccountInfo();
- return info.username;
- }
+ lock.lock();
+ sg_proxyInfo.ip = ips.front();
+ sg_gotProxy = true;
+ */
+ AppManager* app_manager = Context::CreateContext("default")->GetManager();
+ xassert2(NULL != app_manager, "mars2 app_manager is empty.");
+ if (app_manager) {
+ app_manager->GetProxyInfo(_host, _timetick);
+ }
+}
- std::string GetRecentUserName() {
- xassert2(sg_callback != NULL);
- return GetUserName();
- }
+#if TARGET_OS_IPHONE
+static void __ClearProxyInfo() {
+ /*mars2
+ ScopedLock lock(sg_slproxymutex);
+ sg_slporxytimetick = gettickcount();
+ sg_slproxycount = 0;
+ sg_gotProxy = false;
+ sg_proxyInfo.type = mars::comm::kProxyNone;
+ */
+ AppManager* app_manager = Context::CreateContext("default")->GetManager();
+ xassert2(NULL != app_manager, "mars2 app_manager is empty.");
+ if (app_manager) {
+ app_manager->ClearProxyInfo();
+ }
+}
- unsigned int GetClientVersion() {
- xassert2(sg_callback != NULL);
- return sg_callback->GetClientVersion();
- }
+static void onCreate() {
+ startup_anr();
+}
+static void __InitbindBaseprjevent() {
+ GetSignalOnCreate().connect(&onCreate);
+ GetSignalOnNetworkChange().connect(&__ClearProxyInfo);
+}
+
+BOOT_RUN_STARTUP(__InitbindBaseprjevent);
- DeviceInfo GetDeviceInfo() {
- xassert2(sg_callback != NULL);
- return sg_callback->GetDeviceInfo();
- }
+#endif
+mars::comm::ProxyInfo GetProxyInfo(const std::string& _host) {
+ /* mars2
+ xassert2(sg_callback != NULL);
+#if !TARGET_OS_IPHONE
+ mars::comm::ProxyInfo proxy_info;
+ sg_callback->GetProxyInfo(_host, proxy_info);
+ return proxy_info;
#endif
+ if (sg_gotProxy) {
+ return sg_proxyInfo;
+ }
+
+ ScopedLock lock(sg_slproxymutex, false);
+ if (!lock.timedlock(500)) return mars::comm::ProxyInfo();
+
+ if (sg_slproxycount < 3 || 5 * 1000 > gettickspan(sg_slporxytimetick)) {
+ sg_slproxyThread.start(boost::bind(&__GetProxyInfo, _host, sg_slporxytimetick));
+ }
+
+ if (sg_gotProxy) {
+ return sg_proxyInfo;
+ }
+
+ return mars::comm::ProxyInfo();
+ */
+ AppManager* app_manager = Context::CreateContext("default")->GetManager();
+ xassert2(NULL != app_manager, "mars2 app_manager is empty.");
+ if (app_manager) {
+ return app_manager->GetProxyInfo(_host);
+ }
+ return mars::comm::ProxyInfo();
}
+
+std::string GetAppFilePath() {
+ /* mars2
+ xassert2(sg_callback != NULL);
+
+ std::string path = sg_callback->GetAppFilePath();
+#ifdef __APPLE__
+ setAttrProtectionNone(path.c_str());
+#endif
+
+ return path;
+ */
+ AppManager* app_manager = Context::CreateContext("default")->GetManager();
+ xassert2(NULL != app_manager, "mars2 app_manager is empty.");
+ if (app_manager) {
+ return app_manager->GetAppFilePath();
+ }
+ return "";
}
+AccountInfo GetAccountInfo() {
+ /* mars2
+ xassert2(sg_callback != NULL);
+ return sg_callback->GetAccountInfo();
+ */
+ AppManager* app_manager = Context::CreateContext("default")->GetManager();
+ xassert2(NULL != app_manager, "mars2 app_manager is empty.");
+ if (app_manager) {
+ return app_manager->GetAccountInfo();
+ }
+ return AccountInfo();
+}
+
+std::string GetAppUserName() {
+ /*mars2
+ xassert2(sg_callback != NULL);
+ AccountInfo info = sg_callback->GetAccountInfo();
+ return info.username;
+ */
+ AppManager* app_manager = Context::CreateContext("default")->GetManager();
+ xassert2(NULL != app_manager, "mars2 app_manager is empty.");
+ if (app_manager) {
+ return app_manager->GetAppUserName();
+ }
+ return "";
+}
+
+std::string GetRecentUserName() {
+ /* mars2
+ xassert2(sg_callback != NULL);
+ return GetAppUserName();
+ */
+ AppManager* app_manager = Context::CreateContext("default")->GetManager();
+ xassert2(NULL != app_manager, "mars2 app_manager is empty.");
+ if (app_manager) {
+ return app_manager->GetRecentUserName();
+ }
+ return "";
+}
+
+unsigned int GetClientVersion() {
+ /* mars2
+ xassert2(sg_callback != NULL);
+ return sg_callback->GetClientVersion();
+ */
+ AppManager* app_manager = Context::CreateContext("default")->GetManager();
+ xassert2(NULL != app_manager, "mars2 app_manager is empty.");
+ if (app_manager) {
+ return app_manager->GetClientVersion();
+ }
+ return 0;
+}
+
+DeviceInfo GetDeviceInfo() {
+ /*mars2
+ xassert2(sg_callback != NULL);
+
+static DeviceInfo device_info;
+if (!device_info.devicename.empty() || !device_info.devicetype.empty()) {
+return device_info;
+}
+
+device_info = sg_callback->GetDeviceInfo();
+return device_info;
+ */
+ AppManager* app_manager = Context::CreateContext("default")->GetManager();
+ xassert2(NULL != app_manager, "mars2 app_manager is empty.");
+ if (app_manager) {
+ return app_manager->GetDeviceInfo();
+ }
+ return DeviceInfo();
+}
+
+#endif
+} // namespace app
+} // namespace mars
\ No newline at end of file
diff --git a/mars/app/app_logic.h b/mars/app/app_logic.h
index 55c93435d..e71f68816 100644
--- a/mars/app/app_logic.h
+++ b/mars/app/app_logic.h
@@ -1,7 +1,7 @@
-// Tencent is pleased to support the open source community by making Mars available.
+// Tencent is pleased to support the open source community by making Mars available.
// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-// Licensed under the MIT License (the "License"); you may not use this file except in
+// Licensed under the MIT License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://opensource.org/licenses/MIT
@@ -23,28 +23,48 @@
#include
#include "mars/app/app.h"
+#include "mars/comm/comm_data.h"
class AutoBuffer;
namespace mars {
namespace app {
- class Callback {
- public:
- virtual ~Callback() {};
+/* mars2
+class Callback {
+public:
+ virtual ~Callback() {};
- virtual std::string GetAppFilePath() = 0;
-
- virtual AccountInfo GetAccountInfo() = 0;
+ virtual bool GetProxyInfo(const std::string& _host, mars::comm::ProxyInfo& _proxy_info) { return false; }
- virtual unsigned int GetClientVersion() = 0;
+ virtual std::string GetAppFilePath() = 0;
- virtual DeviceInfo GetDeviceInfo() = 0;
+ virtual AccountInfo GetAccountInfo() = 0;
- };
+ virtual unsigned int GetClientVersion() = 0;
- void SetCallback(Callback* const callback);
-}}
+ virtual DeviceInfo GetDeviceInfo() = 0;
+};
+*/
+void SetCallback(Callback* const callback);
+
+// start app.h
+mars::comm::ProxyInfo GetProxyInfo(const std::string& _host);
+std::string GetAppFilePath();
+AccountInfo GetAccountInfo();
+std::string GetAppUserName(); // WinBase.h里面定义了GetUserName这个宏
+std::string GetRecentUserName();
+unsigned int GetClientVersion();
+DeviceInfo GetDeviceInfo();
+double GetOsVersion();
+
+#ifdef NATIVE_CALLBACK
+void SetAppLogicNativeCallback(std::shared_ptr _cb);
+#endif
+// end app.h
+
+} // namespace app
+} // namespace mars
#endif /* APPCOMM_INTERFACE_APPCOMM_LOGIC_H_ */
diff --git a/mars/app/app_manager.cc b/mars/app/app_manager.cc
new file mode 100644
index 000000000..c7d01cdb6
--- /dev/null
+++ b/mars/app/app_manager.cc
@@ -0,0 +1,207 @@
+//
+// Created by Changpeng Pan on 2022/8/29.
+//
+
+#include "mars/app/app_manager.h"
+
+#ifdef __APPLE__
+#include
+
+#include "mars/comm/objc/data_protect_attr.h"
+#endif
+
+#include "mars/comm/dns/dns.h"
+#include "mars/comm/xlogger/xlogger.h"
+#ifdef ANDROID
+#include "mars/comm/alarm.h"
+#endif
+
+using namespace mars::comm;
+using namespace mars::boot;
+
+namespace mars {
+namespace app {
+
+AppManager::AppManager(Context* context) : context_(context) {
+ xinfo_function(TSF "mars2 context id %_", context_->GetContextId());
+}
+
+AppManager::~AppManager() {
+ xinfo_function();
+}
+
+std::string AppManager::GetName() {
+ return typeid(AppManager).name();
+}
+
+void AppManager::SetCallback(Callback* _callback) {
+ xinfo_function();
+ callback_ = _callback;
+}
+
+mars::comm::ProxyInfo AppManager::GetProxyInfo(const std::string& _host) {
+ xassert2(callback_ != NULL);
+
+#if !TARGET_OS_IPHONE
+ mars::comm::ProxyInfo proxy_info;
+ callback_->GetProxyInfo(_host, proxy_info);
+ return proxy_info;
+#endif
+
+ if (got_proxy_) {
+ return proxy_info_;
+ }
+
+ if (!slproxymutex_.try_lock_for(std::chrono::milliseconds(500))) {
+ return {};
+ }
+
+ if (slproxycount_ < 3 || 5 * 1000 > gettickspan(slproxytimetick_)) {
+ std::thread([=]() {
+ AppManager::GetProxyInfo(_host, slproxytimetick_);
+ }).detach();
+ }
+
+ slproxymutex_.unlock();
+ if (got_proxy_) {
+ return proxy_info_;
+ }
+
+ return {};
+}
+
+std::string AppManager::GetAppFilePath() {
+ xassert2(callback_ != NULL);
+
+ std::string path = callback_->GetAppFilePath();
+
+#ifdef __APPLE__
+ setAttrProtectionNone(path.c_str());
+#endif
+
+ return path;
+}
+
+AccountInfo AppManager::GetAccountInfo() {
+ xassert2(callback_ != NULL);
+ return callback_->GetAccountInfo();
+}
+
+std::string AppManager::GetAppUserName() {
+ xassert2(callback_ != NULL);
+ AccountInfo info = callback_->GetAccountInfo();
+ return info.username;
+}
+
+std::string AppManager::GetRecentUserName() {
+ xassert2(callback_ != NULL);
+ if (callback_ == NULL) {
+ return "";
+ }
+ return GetAppUserName();
+}
+
+unsigned int AppManager::GetClientVersion() {
+ xassert2(callback_ != NULL);
+ if (callback_ == NULL) {
+ return 0;
+ }
+ return callback_->GetClientVersion();
+}
+
+DeviceInfo AppManager::GetDeviceInfo() {
+ xassert2(callback_ != NULL);
+ if (callback_) {
+ return callback_->GetDeviceInfo();
+ }
+
+ DeviceInfo empty;
+ empty.devicename = "DEFAULT";
+ empty.devicetype = "UNKNOWN";
+
+#ifdef ANDROID
+ empty.devicetype = "ANDROID";
+#elif defined(__WIN32__)
+ empty.devicetype = "WINDOWS";
+#elif defined(__APPLE__)
+#if TARGET_OS_IPHONE
+ empty.devicetype = "IPHONE";
+#else
+ empty.devicetype = "APPLE";
+#endif
+#endif
+
+ return empty;
+}
+
+void AppManager::GetProxyInfo(const std::string& _host, uint64_t _timetick) {
+ xinfo_function(TSF "time tick:%_, host:%_", _timetick, _host);
+ mars::comm::ProxyInfo proxy_info;
+ if (!callback_->GetProxyInfo(_host, proxy_info)) {
+ std::lock_guard lock(slproxymutex_);
+ if (_timetick != slproxytimetick_) {
+ return;
+ }
+ ++slproxycount_;
+ return;
+ }
+
+ {
+ std::lock_guard lock(slproxymutex_);
+ if (_timetick != slproxytimetick_) {
+ return;
+ }
+ ++slproxycount_;
+ proxy_info_ = proxy_info;
+ if (mars::comm::kProxyNone == proxy_info_.type || !proxy_info_.ip.empty() || proxy_info_.host.empty()) {
+ got_proxy_ = true;
+ return;
+ }
+ }
+
+ mars::comm::DNS dns;
+ std::vector ips;
+ dns.GetHostByName(proxy_info_.host, ips);
+
+ if (ips.empty()) {
+ return;
+ }
+
+ {
+ std::lock_guard lock(slproxymutex_);
+ proxy_info_.ip = ips.front();
+ got_proxy_ = true;
+ }
+}
+
+void AppManager::__CheckCommSetting(const std::string& key) {
+#ifdef ANDROID
+ xinfo2(TSF "AppConfig CheckCommSetting key:%_", key);
+ if (key == kKeyAlarmStartWakeupLook) {
+ int wakeup = GetConfig(kKeyAlarmStartWakeupLook, kAlarmStartWakeupLook);
+ comm::Alarm::SetStartAlarmWakeLock(wakeup);
+ } else if (key == kKeyAlarmOnWakeupLook) {
+ int wakeup = GetConfig(kKeyAlarmOnWakeupLook, kAlarmOnWakeupLook);
+ comm::Alarm::SetOnAlarmWakeLock(wakeup);
+ }
+#endif
+}
+
+// #if TARGET_OS_IPHONE
+void AppManager::ClearProxyInfo() {
+ std::lock_guard lock(slproxymutex_);
+ slproxytimetick_ = gettickcount();
+ slproxycount_ = 0;
+ got_proxy_ = false;
+ proxy_info_.type = mars::comm::kProxyNone;
+}
+// #endif
+
+AppManager* GetDefaultAppManager() {
+ auto* context = mars::boot::Context::CreateContext("default");
+ auto* manager = context->GetManager();
+ return manager;
+}
+
+} // namespace app
+} // namespace mars
diff --git a/mars/app/app_manager.h b/mars/app/app_manager.h
new file mode 100644
index 000000000..69b9927f3
--- /dev/null
+++ b/mars/app/app_manager.h
@@ -0,0 +1,95 @@
+//
+// Created by Changpeng Pan on 2022/8/29.
+//
+
+#ifndef MMNET_APP_MANAGER_H
+#define MMNET_APP_MANAGER_H
+
+#include
+#include
+#include
+#include
+
+#include "mars/app/app.h"
+//#include "mars/boost/any.hpp"
+#include "mars/boot/base_manager.h"
+#include "mars/boot/context.h"
+#include "mars/comm/comm_data.h"
+#include "mars/comm/time_utils.h"
+#include "mars/xlog/xlogger.h"
+
+namespace mars {
+namespace app {
+
+class AppManager : public mars::boot::BaseManager {
+ public:
+ explicit AppManager(mars::boot::Context* context);
+ ~AppManager() override;
+ std::string GetName() override;
+
+ private:
+ mars::boot::Context* context_;
+
+ public:
+ void SetCallback(Callback* callback);
+ mars::comm::ProxyInfo GetProxyInfo(const std::string& _host);
+ std::string GetAppFilePath();
+ AccountInfo GetAccountInfo();
+ std::string GetAppUserName(); // WinBase.h里面定义了GetUserName这个宏
+ std::string GetRecentUserName();
+ unsigned int GetClientVersion();
+ DeviceInfo GetDeviceInfo();
+
+ public:
+ void GetProxyInfo(const std::string& _host, uint64_t _timetick);
+ // #if TARGET_OS_IPHONE
+ void ClearProxyInfo();
+ // #endif
+
+ template
+ T GetConfig(const std::string& key, T default_value) {
+ xinfo2(TSF "AppConfig GetConfig key:%_, default value:%_", key, default_value);
+ std::unique_lock lock(mutex_);
+ auto it = config_.find(key);
+ auto type_it = types_.find(key);
+ if (it == config_.end() || type_it == types_.end() || types_.at(key).empty()
+ || types_.at(key) != std::type_index(typeid(T)).name()) {
+ xwarn2(TSF "AppConfig GetConfig return default value. ");
+ return default_value;
+ }
+ // return boost::any_cast(it->second);
+ return *static_cast(it->second);
+ }
+
+ template
+ void SetConfig(const std::string& key, T value) {
+ xinfo2(TSF "AppConfig SetConfig key:%_, value:%_", key, value);
+ std::unique_lock lock(mutex_);
+ config_[key] = new T(value);
+ types_[key] = std::type_index(typeid(T)).name();
+ lock.unlock();
+ __CheckCommSetting(key);
+ }
+
+ void __CheckCommSetting(const std::string& key);
+
+ private:
+ Callback* callback_;
+ mars::comm::ProxyInfo proxy_info_;
+ bool got_proxy_ = false;
+ std::timed_mutex slproxymutex_;
+ std::thread slproxythread_;
+ uint64_t slproxytimetick_ = gettickcount();
+ int slproxycount_ = 0;
+
+ std::mutex mutex_;
+ // std::unordered_map config_;
+ std::unordered_map config_;
+ std::unordered_map types_;
+};
+
+AppManager* GetDefaultAppManager();
+} // namespace app
+} // namespace mars
+
+#endif // MMNET_APP_MANAGER_H
diff --git a/mars/app/compiler_util.h b/mars/app/compiler_util.h
new file mode 100644
index 000000000..707b991d2
--- /dev/null
+++ b/mars/app/compiler_util.h
@@ -0,0 +1,33 @@
+// Tencent is pleased to support the open source community by making Mars available.
+// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
+
+// Licensed under the MIT License (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://opensource.org/licenses/MIT
+
+// Unless required by applicable law or agreed to in writing, software distributed under the License is
+// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+// either express or implied. See the License for the specific language governing permissions and
+// limitations under the License.
+
+/*
+ * compiler_util.h
+ *
+ * Created on: 2017-3-28
+ * Author: jehoochen
+ */
+
+#ifndef APP_COMPILER_UTIL_H_
+#define APP_COMPILER_UTIL_H_
+
+#if defined(_MSC_VER) && defined(MARS_USE_DLLS)
+#ifdef MARS_APP_EXPORTS
+#define MARS_APP_EXPORT __declspec(dllexport)
+#else
+#define MARS_APP_EXPORT __declspec(dllimport)
+#endif
+#else
+#define MARS_APP_EXPORT
+#endif
+
+#endif /* APP_COMPILER_UTIL_H_ */
diff --git a/mars/app/jni/Android.mk b/mars/app/jni/Android.mk
deleted file mode 100644
index 00f6dd7d6..000000000
--- a/mars/app/jni/Android.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-LOCAL_PATH :=$(call my-dir)
-include $(LOCAL_PATH)/../../mk_template/android_template.mk
\ No newline at end of file
diff --git a/mars/app/jni/Application.mk b/mars/app/jni/Application.mk
deleted file mode 100644
index cdda64028..000000000
--- a/mars/app/jni/Application.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-APP_LOCAL_PATH :=$(call my-dir)
-include $(APP_LOCAL_PATH)/../../mk_template/application_template.mk
\ No newline at end of file
diff --git a/mars/app/jni/app_manager_callback_wrapper.cc b/mars/app/jni/app_manager_callback_wrapper.cc
new file mode 100644
index 000000000..1dda66d7c
--- /dev/null
+++ b/mars/app/jni/app_manager_callback_wrapper.cc
@@ -0,0 +1,135 @@
+//
+// Created by Cpan on 2022/9/7.
+//
+
+#include "app_manager_callback_wrapper.h"
+
+#include "mars/comm/jni/jnicat/jnicat_core.h"
+#include "mars/comm/jni/util/comm_function.h"
+#include "mars/comm/jni/util/scope_jenv.h"
+#include "mars/comm/jni/util/scoped_jstring.h"
+#include "mars/comm/jni/util/var_cache.h"
+#include "mars/comm/thread/lock.h"
+#include "mars/comm/thread/mutex.h"
+#include "mars/comm/xlogger/xlogger.h"
+
+namespace mars {
+namespace app {
+
+DEFINE_FIND_CLASS(KC2Java, "com/tencent/mars/app/AppManager$CallBack")
+
+AppManagerJniCallback::AppManagerJniCallback(JNIEnv* env, jobject callback) {
+ callback_inst_ = env->NewGlobalRef(callback);
+ jclass objClass = env->GetObjectClass(callback);
+ if (objClass) {
+ callbacks_class_ = reinterpret_cast(env->NewGlobalRef(objClass));
+ env->DeleteLocalRef(objClass);
+ }
+}
+
+AppManagerJniCallback::~AppManagerJniCallback() {
+ jnienv_ptr env;
+ env->DeleteGlobalRef(callback_inst_);
+}
+
+bool AppManagerJniCallback::GetProxyInfo(const std::string& _host, mars::comm::ProxyInfo& _proxy_info) {
+ return false;
+}
+
+DEFINE_FIND_METHOD(KC2Java_getAppFilePath, KC2Java, "getAppFilePath", "()Ljava/lang/String;")
+std::string AppManagerJniCallback::GetAppFilePath() {
+ VarCache* cache_instance = VarCache::Singleton();
+ ScopeJEnv scope_jenv(cache_instance->GetJvm());
+ JNIEnv* env = scope_jenv.GetEnv();
+
+ jstring jstr = (jstring)JNU_CallMethodByMethodInfo(env, callback_inst_, KC2Java_getAppFilePath).l;
+ std::string filePath;
+ if (NULL != jstr) {
+ filePath.assign(ScopedJstring(env, jstr).GetChar());
+ env->DeleteLocalRef(jstr);
+ } else {
+ xerror2(TSF "getAppFilePath error");
+ }
+ return filePath;
+}
+
+DEFINE_FIND_METHOD(KC2Java_getAccountInfo, KC2Java, "getAccountInfo", "()Lcom/tencent/mars/app/AppLogic$AccountInfo;")
+AccountInfo AppManagerJniCallback::GetAccountInfo() {
+ xverbose_function();
+ VarCache* cache_instance = VarCache::Singleton();
+ ScopeJEnv scope_jenv(cache_instance->GetJvm());
+ JNIEnv* env = scope_jenv.GetEnv();
+
+ AccountInfo info;
+ jobject ret_obj = JNU_CallMethodByMethodInfo(env, callback_inst_, KC2Java_getAccountInfo).l;
+ if (NULL == ret_obj) {
+ xerror2(TSF "getAccountInfo error return null");
+ return info;
+ }
+
+ jlong uin = JNU_GetField(env, ret_obj, "uin", "J").i;
+ jstring username_jstr = (jstring)JNU_GetField(env, ret_obj, "userName", "Ljava/lang/String;").l;
+
+ info.uin = (long)uin;
+
+ if (username_jstr != NULL) {
+ info.username = ScopedJstring(env, username_jstr).GetChar();
+ env->DeleteLocalRef(username_jstr);
+ }
+
+ env->DeleteLocalRef(ret_obj);
+ return info;
+}
+
+DEFINE_FIND_METHOD(KC2Java_getClientVersion, KC2Java, "getClientVersion", "()I")
+unsigned int AppManagerJniCallback::GetClientVersion() {
+ VarCache* cache_instance = VarCache::Singleton();
+ ScopeJEnv scope_jenv(cache_instance->GetJvm());
+ JNIEnv* env = scope_jenv.GetEnv();
+
+ return JNU_CallMethodByMethodInfo(env, callback_inst_, KC2Java_getClientVersion).i;
+}
+
+DEFINE_FIND_CLASS(KC2JavaDeviceInfo, "com/tencent/mars/app/AppLogic$DeviceInfo")
+DEFINE_FIND_METHOD(KC2Java_getDeviceType, KC2Java, "getDeviceType", "()Lcom/tencent/mars/app/AppLogic$DeviceInfo;")
+DeviceInfo AppManagerJniCallback::GetDeviceInfo() {
+ VarCache* cache_instance = VarCache::Singleton();
+ ScopeJEnv scope_jenv(cache_instance->GetJvm());
+ JNIEnv* env = scope_jenv.GetEnv();
+
+ DeviceInfo info;
+ jobject ret_obj = JNU_CallMethodByMethodInfo(env, callback_inst_, KC2Java_getDeviceType).l;
+
+ if (NULL == ret_obj) {
+ xerror2(TSF "getDeviceType error return null");
+ return info;
+ }
+
+ jstring devicename_jstr = (jstring)JNU_GetField(env, ret_obj, "devicename", "Ljava/lang/String;").l;
+
+ static comm::Mutex mutex;
+ comm::ScopedLock lock(mutex);
+
+ if (NULL != devicename_jstr) {
+ ScopedJstring scoped_jstr(env, devicename_jstr);
+
+ jsize len = env->GetStringUTFLength(devicename_jstr);
+ info.devicename = std::string(scoped_jstr.GetChar(), len);
+
+ env->DeleteLocalRef(devicename_jstr);
+ }
+
+ jstring devicetype_jstr = (jstring)JNU_GetField(env, ret_obj, "devicetype", "Ljava/lang/String;").l;
+ if (NULL != devicetype_jstr) {
+ ScopedJstring scoped_jstr(env, devicetype_jstr);
+
+ jsize len = env->GetStringUTFLength(devicetype_jstr);
+ info.devicetype = std::string(scoped_jstr.GetChar(), len);
+
+ env->DeleteLocalRef(devicetype_jstr);
+ }
+ return info;
+}
+
+} // namespace app
+} // namespace mars
\ No newline at end of file
diff --git a/mars/app/jni/app_manager_callback_wrapper.h b/mars/app/jni/app_manager_callback_wrapper.h
new file mode 100644
index 000000000..c0913a8b6
--- /dev/null
+++ b/mars/app/jni/app_manager_callback_wrapper.h
@@ -0,0 +1,39 @@
+//
+// Created by Cpan on 2022/9/7.
+//
+
+#ifndef MMNET_APP_MANAGER_CALLBACK_WRAPPER_H
+#define MMNET_APP_MANAGER_CALLBACK_WRAPPER_H
+
+#include
+
+#include "mars/app/app.h"
+
+namespace mars {
+namespace app {
+
+class AppManagerJniCallback : public Callback {
+ public:
+ AppManagerJniCallback(JNIEnv* env, jobject callback);
+ virtual ~AppManagerJniCallback();
+
+ private:
+ jobject callback_inst_;
+ jclass callbacks_class_;
+
+ public:
+ virtual bool GetProxyInfo(const std::string& _host, mars::comm::ProxyInfo& _proxy_info) override;
+
+ virtual std::string GetAppFilePath() override;
+
+ virtual AccountInfo GetAccountInfo() override;
+
+ virtual unsigned int GetClientVersion() override;
+
+ virtual DeviceInfo GetDeviceInfo() override;
+};
+
+} // namespace app
+} // namespace mars
+
+#endif // MMNET_APP_MANAGER_CALLBACK_WRAPPER_H
diff --git a/mars/app/jni/app_manager_wrapper.cc b/mars/app/jni/app_manager_wrapper.cc
new file mode 100644
index 000000000..751c652f0
--- /dev/null
+++ b/mars/app/jni/app_manager_wrapper.cc
@@ -0,0 +1,98 @@
+//
+// Created by Cpan on 2022/9/7.
+//
+
+#include
+
+#include "comm/jni/jnicat/jnicat_core.h"
+#include "comm/jni/jnicat/jnicat_object_wrapper.h"
+#include "mars/app/app.h"
+#include "mars/app/app_manager.h"
+#include "mars/app/jni/app_manager_callback_wrapper.h"
+#include "mars/boot/context.h"
+#include "mars/comm/jni/util/scoped_jstring.h"
+
+using namespace mars::boot;
+
+namespace mars {
+namespace app {
+
+class JniAppManager {
+ public:
+ static void JniCreateAppManagerFromHandle(JNIEnv* env, jobject instance, jlong handle) {
+ auto app_manager_cpp = (AppManager*)j2c_cast(handle);
+ auto appManagerWrapper = new jnicat::JniObjectWrapper(app_manager_cpp);
+ appManagerWrapper->instantiate(env, instance);
+ }
+
+ static void JniCreateAppManagerFromContext(JNIEnv* env, jobject instance, jobject context) {
+ auto context_cpp = jnicat::JniObjectWrapper::object(env, context);
+ auto app_manager_cpp = new AppManager(context_cpp);
+ auto appManagerWrapper = new jnicat::JniObjectWrapper(app_manager_cpp);
+ appManagerWrapper->instantiate(env, instance);
+ }
+
+ static void JniOnDestroyAppManager(JNIEnv* env, jobject instance) {
+ auto app_manager_cpp = jnicat::JniObjectWrapper::object(env, instance);
+ jnicat::JniObjectWrapper::dispose(env, instance, "callbackHandle");
+ app_manager_cpp->SetCallback(nullptr);
+ jnicat::JniObjectWrapper::dispose(env, instance);
+ }
+
+ static void JniSetCallback(JNIEnv* env, jobject instance, jobject callback) {
+ auto app_manager_cpp = jnicat::JniObjectWrapper::object(env, instance);
+ auto appManagerJniCallback = new AppManagerJniCallback(env, callback);
+ auto appManagerCallbackWrapper = new jnicat::JniObjectWrapper(appManagerJniCallback);
+ appManagerCallbackWrapper->instantiate(env, instance, "callbackHandle");
+ app_manager_cpp->SetCallback(appManagerJniCallback);
+ }
+
+ static void JniSetConfigBooleanValue(JNIEnv* env, jobject instance, jstring jkey, jboolean jvalue) {
+ auto app_manager_cpp = jnicat::JniObjectWrapper::object(env, instance);
+ std::string key = (NULL == jkey ? "" : ScopedJstring(env, jkey).GetChar());
+ bool value = (jvalue == JNI_TRUE);
+ app_manager_cpp->SetConfig(key, value);
+ }
+
+ static void JniSetConfigIntValue(JNIEnv* env, jobject instance, jstring jkey, jint jvalue) {
+ auto app_manager_cpp = jnicat::JniObjectWrapper::object(env, instance);
+ std::string key = (NULL == jkey ? "" : ScopedJstring(env, jkey).GetChar());
+ int value = static_cast(jvalue);
+ app_manager_cpp->SetConfig(key, value);
+ }
+
+ static void JniSetConfigStringValue(JNIEnv* env, jobject instance, jstring jkey, jstring jvalue) {
+ auto app_manager_cpp = jnicat::JniObjectWrapper::object(env, instance);
+ std::string key = (NULL == jkey ? "" : ScopedJstring(env, jkey).GetChar());
+ std::string value = (NULL == jvalue ? "" : ScopedJstring(env, jvalue).GetChar());
+ app_manager_cpp->SetConfig(key, value);
+ }
+};
+
+static const JNINativeMethod kAppManagerJniMethods[] = {
+ {"OnJniCreateAppManagerFromHandle", "(J)V", (void*)&mars::app::JniAppManager::JniCreateAppManagerFromHandle},
+ {"OnJniCreateAppManagerFromContext",
+ "(Ljava/lang/Object;)V",
+ (void*)&mars::app::JniAppManager::JniCreateAppManagerFromContext},
+ {"OnJniDestroyAppManager", "()V", (void*)&mars::app::JniAppManager::JniOnDestroyAppManager},
+ {"OnJniSetCallback", "(Ljava/lang/Object;)V", (void*)&mars::app::JniAppManager::JniSetCallback},
+ {"OnJniSetConfigBooleanValue",
+ "(Ljava/lang/String;Z)V",
+ (void*)&mars::app::JniAppManager::JniSetConfigBooleanValue},
+ {"OnJniSetConfigIntValue", "(Ljava/lang/String;I)V", (void*)&mars::app::JniAppManager::JniSetConfigIntValue},
+ {"OnJniSetConfigStringValue",
+ "(Ljava/lang/String;Ljava/lang/String;)V",
+ (void*)&mars::app::JniAppManager::JniSetConfigStringValue},
+};
+
+static const size_t kAppManagerJniMethodsCount = sizeof(kAppManagerJniMethods) / sizeof(JNINativeMethod);
+JNICAT_DEFINE_JNI_METHOD(kAppManagerInterface,
+ "com/tencent/mars/app/AppManager",
+ kAppManagerJniMethods,
+ kAppManagerJniMethodsCount)
+
+} // namespace app
+} // namespace mars
+
+void ExportAppManager() {
+}
diff --git a/mars/app/jni/build.conf b/mars/app/jni/build.conf
deleted file mode 100644
index 7760951b6..000000000
--- a/mars/app/jni/build.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMP_LOCAL_PATH :=$(call my-dir)
-
-SELF_BUILD_CMD := BUILD_STATIC_LIBRARY
-SELF_LOCAL_MODULE := appcomm
-
-SELF_LOCAL_EXPORT_C_INCLUDES := $(TEMP_LOCAL_PATH)/../ $(TEMP_LOCAL_PATH)/../src $(TEMP_LOCAL_PATH)/../interface
-SELF_LOCAL_EXPORT_SRC_FILES :=
-
-SELF_LOCAL_IMPORT_LIBRARIES_PATH += $(TEMP_LOCAL_PATH)/../../comm/jni/export.mk
-SELF_LOCAL_IMPORT_LIBRARIES_PATH += $(TEMP_LOCAL_PATH)/../../log/jni/export.mk
diff --git a/mars/app/jni/com_tencent_mars_app_AppLogic_C2Java.cc b/mars/app/jni/com_tencent_mars_app_AppLogic_C2Java.cc
index 69740d735..9339d3045 100644
--- a/mars/app/jni/com_tencent_mars_app_AppLogic_C2Java.cc
+++ b/mars/app/jni/com_tencent_mars_app_AppLogic_C2Java.cc
@@ -1,7 +1,7 @@
// Tencent is pleased to support the open source community by making Mars available.
// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-// Licensed under the MIT License (the "License"); you may not use this file except in
+// Licensed under the MIT License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://opensource.org/licenses/MIT
@@ -13,7 +13,7 @@
// Tencent is pleased to support the open source community by making Mars available.
// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-// Licensed under the MIT License (the "License"); you may not use this file except in
+// Licensed under the MIT License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://opensource.org/licenses/MIT
@@ -27,153 +27,233 @@
* author : yanguoyue
*/
-
+#ifndef USE_CPP_CALLBACK
#include
+
#include
+#include "mars/app/app.h"
#include "mars/comm/autobuffer.h"
+#include "mars/comm/jni/util/comm_function.h"
+#include "mars/comm/jni/util/scope_jenv.h"
#include "mars/comm/jni/util/scoped_jstring.h"
-#include "mars/comm/xlogger/xlogger.h"
#include "mars/comm/jni/util/var_cache.h"
-#include "mars/comm/jni/util/scope_jenv.h"
-#include "mars/comm/jni/util/comm_function.h"
-
-#include "mars/app/app.h"
+#include "mars/comm/thread/lock.h"
+#include "mars/comm/thread/mutex.h"
+#include "mars/comm/xlogger/xlogger.h"
+#ifndef NATIVE_CALLBACK
DEFINE_FIND_CLASS(KC2Java, "com/tencent/mars/app/AppLogic")
+#endif // NATIVE_CALLBACK
namespace mars {
namespace app {
+#ifdef NATIVE_CALLBACK
+static std::weak_ptr applogic_native_callback_instance;
+
+void SetAppLogicNativeCallback(std::shared_ptr _cb) {
+ applogic_native_callback_instance = _cb;
+}
+
+#define CALL_NATIVE_CALLBACK_RETURN_FUN(fun, default_value) \
+ { \
+ auto cb = applogic_native_callback_instance.lock(); \
+ if (cb) { \
+ return (cb->fun); \
+ } \
+ xwarn2("applogic native callback is null"); \
+ return (default_value); \
+ }
+
+#define DEFINE_FIND_EMPTY_STATIC_METHOD(methodid) const static JniMethodInfo methodid = JniMethodInfo("", "", "");
+
+#endif // NATIVE_CALLBACK
+
+#ifndef NATIVE_CALLBACK
DEFINE_FIND_STATIC_METHOD(KC2Java_getAppFilePath, KC2Java, "getAppFilePath", "()Ljava/lang/String;")
+#else
+DEFINE_FIND_EMPTY_STATIC_METHOD(KC2Java_getAppFilePath)
+#endif
std::string GetAppFilePath() {
- xverbose_function();
+ xverbose_function();
+
+#ifdef NATIVE_CALLBACK
+ CALL_NATIVE_CALLBACK_RETURN_FUN(GetAppFilePath(), std::string(""));
+#endif
VarCache* cache_instance = VarCache::Singleton();
- ScopeJEnv scope_jenv(cache_instance->GetJvm());
- JNIEnv *env = scope_jenv.GetEnv();
+ ScopeJEnv scope_jenv(cache_instance->GetJvm());
+ JNIEnv* env = scope_jenv.GetEnv();
- jstring path = (jstring)JNU_CallStaticMethodByMethodInfo(env, KC2Java_getAppFilePath).l;
- if (NULL == path) {
- xerror2(TSF"getAppFilePath error return null");
- return "";
- }
+ jstring path = (jstring)JNU_CallStaticMethodByMethodInfo(env, KC2Java_getAppFilePath).l;
+ if (NULL == path) {
+ xerror2(TSF "getAppFilePath error return null");
+ return "";
+ }
- std::string app_path = ScopedJstring(env, path).GetChar();
- env->DeleteLocalRef(path);
+ std::string app_path = ScopedJstring(env, path).GetChar();
+ env->DeleteLocalRef(path);
- return app_path;
+ return app_path;
}
-DEFINE_FIND_STATIC_METHOD(KC2Java_getAccountInfo, KC2Java, "getAccountInfo", "()Lcom/tencent/mars/app/AppLogic$AccountInfo;")
+#ifndef NATIVE_CALLBACK
+DEFINE_FIND_STATIC_METHOD(KC2Java_getAccountInfo,
+ KC2Java,
+ "getAccountInfo",
+ "()Lcom/tencent/mars/app/AppLogic$AccountInfo;")
+#else
+DEFINE_FIND_EMPTY_STATIC_METHOD(KC2Java_getAccountInfo)
+#endif
AccountInfo GetAccountInfo() {
- xverbose_function();
+ xverbose_function();
+#ifdef NATIVE_CALLBACK
+ CALL_NATIVE_CALLBACK_RETURN_FUN(GetAccountInfo(), AccountInfo());
+#else
VarCache* cache_instance = VarCache::Singleton();
- ScopeJEnv scope_jenv(cache_instance->GetJvm());
- JNIEnv *env = scope_jenv.GetEnv();
+ ScopeJEnv scope_jenv(cache_instance->GetJvm());
+ JNIEnv* env = scope_jenv.GetEnv();
- AccountInfo info;
- jobject ret_obj = JNU_CallStaticMethodByMethodInfo(env, KC2Java_getAccountInfo).l;
- if (NULL == ret_obj) {
- xerror2(TSF"getAccountInfo error return null");
- return info;
- }
+ AccountInfo info;
+ jobject ret_obj = JNU_CallStaticMethodByMethodInfo(env, KC2Java_getAccountInfo).l;
+ if (NULL == ret_obj) {
+ xerror2(TSF "getAccountInfo error return null");
+ return info;
+ }
- jlong uin = JNU_GetField(env, ret_obj, "uin", "J").i;
- jstring username_jstr = (jstring)JNU_GetField(env, ret_obj, "userName", "Ljava/lang/String;").l;
+ jlong uin = JNU_GetField(env, ret_obj, "uin", "J").i;
+ jstring username_jstr = (jstring)JNU_GetField(env, ret_obj, "userName", "Ljava/lang/String;").l;
- info.uin = (long)uin;
+ info.uin = (long)uin;
- if (username_jstr != NULL) {
- info.username = ScopedJstring(env, username_jstr).GetChar();
- env->DeleteLocalRef(username_jstr);
- }
+ if (username_jstr != NULL) {
+ info.username = ScopedJstring(env, username_jstr).GetChar();
+ env->DeleteLocalRef(username_jstr);
+ }
- env->DeleteLocalRef(ret_obj);
- return info;
+ env->DeleteLocalRef(ret_obj);
+ return info;
+#endif
}
-std::string GetUserName() {
+std::string GetAppUserName() {
xverbose_function();
+#ifdef NATIVE_CALLBACK
+ CALL_NATIVE_CALLBACK_RETURN_FUN(GetAppUserName(), std::string(""));
+#endif
VarCache* cache_instance = VarCache::Singleton();
ScopeJEnv scope_jenv(cache_instance->GetJvm());
- JNIEnv *env = scope_jenv.GetEnv();
+ JNIEnv* env = scope_jenv.GetEnv();
jobject ret_obj = JNU_CallStaticMethodByMethodInfo(env, KC2Java_getAccountInfo).l;
- if (NULL == ret_obj) {
- return std::string();
- }
-
- jstring username_jstr = (jstring)JNU_GetField(env, ret_obj, "userName", "Ljava/lang/String;").l;
-
- env->DeleteLocalRef(ret_obj);
-
- if (username_jstr != NULL) {
- const char* name = env->GetStringUTFChars(username_jstr, NULL);
- std::string user_name(name);
- env->ReleaseStringUTFChars(username_jstr, name);
- env->DeleteLocalRef(username_jstr);
- return user_name;
- } else {
- return std::string();
- }
+ if (NULL == ret_obj) {
+ return std::string();
+ }
+
+ jstring username_jstr = (jstring)JNU_GetField(env, ret_obj, "userName", "Ljava/lang/String;").l;
+
+ env->DeleteLocalRef(ret_obj);
+
+ if (username_jstr != NULL) {
+ const char* name = env->GetStringUTFChars(username_jstr, NULL);
+ std::string user_name(name);
+ env->ReleaseStringUTFChars(username_jstr, name);
+ env->DeleteLocalRef(username_jstr);
+ return user_name;
+ } else {
+ return std::string();
+ }
}
std::string GetRecentUserName() {
- return GetUserName();
+ return GetAppUserName();
}
+#ifndef NATIVE_CALLBACK
DEFINE_FIND_STATIC_METHOD(KC2Java_getClientVersion, KC2Java, "getClientVersion", "()I")
+#else
+DEFINE_FIND_EMPTY_STATIC_METHOD(KC2Java_getClientVersion)
+#endif
unsigned int GetClientVersion() {
+#ifdef NATIVE_CALLBACK
+ CALL_NATIVE_CALLBACK_RETURN_FUN(GetClientVersion(), 0);
+#endif
+ static unsigned int s_version = 0;
+ if (0 != s_version) {
+ return s_version;
+ }
- static unsigned int s_version = 0;
- if (0 != s_version) {
- return s_version;
- }
-
- VarCache* cache_instance = VarCache::Singleton();
- ScopeJEnv scope_jenv(cache_instance->GetJvm());
- JNIEnv *env = scope_jenv.GetEnv();
- s_version = (unsigned int)JNU_CallStaticMethodByMethodInfo(env, KC2Java_getClientVersion).i;
+ VarCache* cache_instance = VarCache::Singleton();
+ ScopeJEnv scope_jenv(cache_instance->GetJvm());
+ JNIEnv* env = scope_jenv.GetEnv();
+ s_version = (unsigned int)JNU_CallStaticMethodByMethodInfo(env, KC2Java_getClientVersion).i;
- return s_version;
+ return s_version;
}
-DEFINE_FIND_STATIC_METHOD(KC2Java_getDeviceType, KC2Java, "getDeviceType", "()Lcom/tencent/mars/app/AppLogic$DeviceInfo;")
+#ifndef NATIVE_CALLBACK
+DEFINE_FIND_STATIC_METHOD(KC2Java_getDeviceType,
+ KC2Java,
+ "getDeviceType",
+ "()Lcom/tencent/mars/app/AppLogic$DeviceInfo;")
+#else
+DEFINE_FIND_EMPTY_STATIC_METHOD(KC2Java_getDeviceType)
+#endif
DeviceInfo GetDeviceInfo() {
- xverbose_function();
+ xverbose_function();
+#ifdef NATIVE_CALLBACK
+ CALL_NATIVE_CALLBACK_RETURN_FUN(GetDeviceInfo(), DeviceInfo());
+#endif
- static DeviceInfo s_info;
- if (!s_info.devicename.empty() || !s_info.devicetype.empty()) {
- return s_info;
- }
+ static DeviceInfo s_info;
+ if (!s_info.devicename.empty() || !s_info.devicetype.empty()) {
+ return s_info;
+ }
- VarCache* cache_instance = VarCache::Singleton();
- ScopeJEnv scope_jenv(cache_instance->GetJvm());
- JNIEnv *env = scope_jenv.GetEnv();
+ VarCache* cache_instance = VarCache::Singleton();
+ ScopeJEnv scope_jenv(cache_instance->GetJvm());
+ JNIEnv* env = scope_jenv.GetEnv();
+
+ jobject ret_obj = JNU_CallStaticMethodByMethodInfo(env, KC2Java_getDeviceType).l;
+ if (NULL == ret_obj) {
+ xerror2(TSF "GetDeviceInfo error return null");
+ return s_info;
+ }
+
+ jstring devicename_jstr = (jstring)JNU_GetField(env, ret_obj, "devicename", "Ljava/lang/String;").l;
+
+ static comm::Mutex mutex;
+ comm::ScopedLock lock(mutex);
- jobject ret_obj = JNU_CallStaticMethodByMethodInfo(env, KC2Java_getDeviceType).l;
- if (NULL == ret_obj) {
- xerror2(TSF"GetDeviceInfo error return null");
- return s_info;
- }
+ if (NULL != devicename_jstr) {
+ ScopedJstring scoped_jstr(env, devicename_jstr);
- jstring devicename_jstr = (jstring)JNU_GetField(env, ret_obj, "devicename", "Ljava/lang/String;").l;
+ jsize len = env->GetStringUTFLength(devicename_jstr);
+ s_info.devicename = std::string(scoped_jstr.GetChar(), len);
- if (NULL != devicename_jstr) {
- s_info.devicename = ScopedJstring(env, devicename_jstr).GetChar();
- env->DeleteLocalRef(devicename_jstr);
- }
+ env->DeleteLocalRef(devicename_jstr);
+ }
- jstring devicetype_jstr = (jstring)JNU_GetField(env, ret_obj, "devicetype", "Ljava/lang/String;").l;
- if (NULL != devicetype_jstr) {
- s_info.devicetype = ScopedJstring(env, devicetype_jstr).GetChar();
- env->DeleteLocalRef(devicetype_jstr);
- }
+ jstring devicetype_jstr = (jstring)JNU_GetField(env, ret_obj, "devicetype", "Ljava/lang/String;").l;
+ if (NULL != devicetype_jstr) {
+ ScopedJstring scoped_jstr(env, devicetype_jstr);
+
+ jsize len = env->GetStringUTFLength(devicetype_jstr);
+ s_info.devicetype = std::string(scoped_jstr.GetChar(), len);
+
+ env->DeleteLocalRef(devicetype_jstr);
+ }
+
+ return s_info;
+}
- return s_info;
+mars::comm::ProxyInfo GetProxyInfo(const std::string& _host) {
+ return mars::comm::ProxyInfo();
}
-}}
+} // namespace app
+} // namespace mars
+#endif
diff --git a/mars/app/jni/export.mk b/mars/app/jni/export.mk
deleted file mode 100644
index c59b7a960..000000000
--- a/mars/app/jni/export.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-EXPORT_LOCAL_PATH := $(call my-dir)
-SELF_LOCAL_EXPORT_C_INCLUDES:=
-SELF_LOCAL_EXPORT_SRC_FILES :=
-SELF_LOCAL_EXPORT_LDLIBS :=
-include $(EXPORT_LOCAL_PATH)/../../mk_template/export_template.mk
\ No newline at end of file
diff --git a/mars/app/jni/import.mk b/mars/app/jni/import.mk
deleted file mode 100644
index 22ef0a8e0..000000000
--- a/mars/app/jni/import.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-IMPORT_LOCAL_PATH := $(call my-dir)
-SELF_LOCAL_IMPORT_LIBRARIES_PATH :=
-include $(IMPORT_LOCAL_PATH)/../../mk_template/import_template.mk
\ No newline at end of file
diff --git a/mars/app/jni/sources.mk b/mars/app/jni/sources.mk
deleted file mode 100644
index c13e2e436..000000000
--- a/mars/app/jni/sources.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-
-TEMP_LOCAL_PATH :=$(call my-dir)
-
-LOCAL_C_INCLUDES += $(TEMP_LOCAL_PATH)/../src $(TEMP_LOCAL_PATH)/../../log/src/ $(TEMP_LOCAL_PATH)/../
-
-include $(TEMP_LOCAL_PATH)/../../mk_template/flags.mk
-LOCAL_CFLAGS += -fvisibility=hidden
-
-SRC := $(wildcard $(TEMP_LOCAL_PATH)/../src/*.cc)
-SRC := $(SRC:$(LOCAL_PATH)/%=%)
-LOCAL_SRC_FILES += $(SRC)
-
-SRC := $(wildcard $(TEMP_LOCAL_PATH)/../src/unix/*.cc)
-SRC := $(SRC:$(LOCAL_PATH)/%=%)
-LOCAL_SRC_FILES += $(SRC)
-
-SRC := $(wildcard $(TEMP_LOCAL_PATH)/*.cc)
-SRC := $(SRC:$(LOCAL_PATH)/%=%)
-LOCAL_SRC_FILES += $(SRC)
-
-LOCAL_C_INCLUDES += $(TEMP_LOCAL_PATH)/../ $(TEMP_LOCAL_PATH)/../src $(TEMP_LOCAL_PATH)/../../ $(TEMP_LOCAL_PATH)/../../../
\ No newline at end of file
diff --git a/mars/app/mmcomm-watch.xcodeproj/project.pbxproj b/mars/app/mmcomm-watch.xcodeproj/project.pbxproj
deleted file mode 100644
index 94ecbe1e3..000000000
--- a/mars/app/mmcomm-watch.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,372 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 13635A031981F37600EED49B /* ActiveLogic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359EB1981F37600EED49B /* ActiveLogic.cpp */; };
- 13635A041981F37600EED49B /* HttpRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359ED1981F37600EED49B /* HttpRequest.cpp */; };
- 13635A051981F37600EED49B /* logic_utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359F01981F37600EED49B /* logic_utils.cpp */; };
- 13635A061981F37600EED49B /* MMNewGetDns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359F31981F37600EED49B /* MMNewGetDns.cpp */; };
- 13635A071981F37600EED49B /* newdns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359F61981F37600EED49B /* newdns.cpp */; };
- 13635A081981F37600EED49B /* SocketUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359F81981F37600EED49B /* SocketUtils.cpp */; };
- 13635A091981F37600EED49B /* MMStackReportBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359FC1981F37600EED49B /* MMStackReportBase.cpp */; };
- 1392E92E1A834D890093185B /* MMFileReport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1392E92C1A834D890093185B /* MMFileReport.cpp */; };
- 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3170A02A177887B0004F5DDA /* Foundation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 3170A025177887B0004F5DDA /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "include/${PRODUCT_NAME}";
- dstSubfolderSpec = 16;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 136359EB1981F37600EED49B /* ActiveLogic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActiveLogic.cpp; sourceTree = ""; };
- 136359EC1981F37600EED49B /* ActiveLogic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActiveLogic.h; sourceTree = ""; };
- 136359ED1981F37600EED49B /* HttpRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpRequest.cpp; sourceTree = ""; };
- 136359EE1981F37600EED49B /* HttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequest.h; sourceTree = ""; };
- 136359EF1981F37600EED49B /* HttpUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpUtils.h; sourceTree = ""; };
- 136359F01981F37600EED49B /* logic_utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = logic_utils.cpp; sourceTree = ""; };
- 136359F11981F37600EED49B /* logic_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logic_utils.h; sourceTree = ""; };
- 136359F21981F37600EED49B /* MMComm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMComm.h; sourceTree = ""; };
- 136359F31981F37600EED49B /* MMNewGetDns.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MMNewGetDns.cpp; sourceTree = ""; };
- 136359F41981F37600EED49B /* MMNewGetDns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMNewGetDns.h; sourceTree = ""; };
- 136359F51981F37600EED49B /* MMStackReportBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMStackReportBase.h; sourceTree = ""; };
- 136359F61981F37600EED49B /* newdns.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = newdns.cpp; sourceTree = ""; };
- 136359F71981F37600EED49B /* platform_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform_logic.h; sourceTree = ""; };
- 136359F81981F37600EED49B /* SocketUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketUtils.cpp; sourceTree = ""; };
- 136359F91981F37600EED49B /* SocketUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketUtils.h; sourceTree = ""; };
- 136359FA1981F37600EED49B /* SpecialINI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpecialINI.h; sourceTree = ""; };
- 136359FC1981F37600EED49B /* MMStackReportBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MMStackReportBase.cpp; sourceTree = ""; };
- 136359FD1981F37600EED49B /* MMStackReportBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMStackReportBase.h; sourceTree = ""; };
- 137FEC26197621A30055BFF6 /* newdnscfg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = newdnscfg.h; sourceTree = ""; };
- 1392E92C1A834D890093185B /* MMFileReport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MMFileReport.cpp; sourceTree = ""; };
- 1392E92D1A834D890093185B /* MMFileReport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMFileReport.h; sourceTree = ""; };
- 3170A027177887B0004F5DDA /* libmmcomm-watch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libmmcomm-watch.a"; sourceTree = BUILT_PRODUCTS_DIR; };
- 3170A02A177887B0004F5DDA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 3170A024177887B0004F5DDA /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 136359EA1981F37600EED49B /* src */ = {
- isa = PBXGroup;
- children = (
- 1392E92C1A834D890093185B /* MMFileReport.cpp */,
- 1392E92D1A834D890093185B /* MMFileReport.h */,
- 136359EB1981F37600EED49B /* ActiveLogic.cpp */,
- 136359EC1981F37600EED49B /* ActiveLogic.h */,
- 136359ED1981F37600EED49B /* HttpRequest.cpp */,
- 136359EE1981F37600EED49B /* HttpRequest.h */,
- 136359EF1981F37600EED49B /* HttpUtils.h */,
- 136359F01981F37600EED49B /* logic_utils.cpp */,
- 136359F11981F37600EED49B /* logic_utils.h */,
- 136359F21981F37600EED49B /* MMComm.h */,
- 136359F31981F37600EED49B /* MMNewGetDns.cpp */,
- 136359F41981F37600EED49B /* MMNewGetDns.h */,
- 136359F51981F37600EED49B /* MMStackReportBase.h */,
- 136359F61981F37600EED49B /* newdns.cpp */,
- 136359F71981F37600EED49B /* platform_logic.h */,
- 136359F81981F37600EED49B /* SocketUtils.cpp */,
- 136359F91981F37600EED49B /* SocketUtils.h */,
- 136359FA1981F37600EED49B /* SpecialINI.h */,
- 136359FB1981F37600EED49B /* unix */,
- );
- path = src;
- sourceTree = "";
- };
- 136359FB1981F37600EED49B /* unix */ = {
- isa = PBXGroup;
- children = (
- 136359FC1981F37600EED49B /* MMStackReportBase.cpp */,
- 136359FD1981F37600EED49B /* MMStackReportBase.h */,
- );
- path = unix;
- sourceTree = "";
- };
- 137FEC25197621A30055BFF6 /* cfg */ = {
- isa = PBXGroup;
- children = (
- 137FEC26197621A30055BFF6 /* newdnscfg.h */,
- );
- path = cfg;
- sourceTree = "";
- };
- 3170A01E177887B0004F5DDA = {
- isa = PBXGroup;
- children = (
- 136359EA1981F37600EED49B /* src */,
- 137FEC25197621A30055BFF6 /* cfg */,
- 3170A029177887B0004F5DDA /* Frameworks */,
- 3170A028177887B0004F5DDA /* Products */,
- );
- sourceTree = "";
- };
- 3170A028177887B0004F5DDA /* Products */ = {
- isa = PBXGroup;
- children = (
- 3170A027177887B0004F5DDA /* libmmcomm-watch.a */,
- );
- name = Products;
- sourceTree = "";
- };
- 3170A029177887B0004F5DDA /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 3170A02A177887B0004F5DDA /* Foundation.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 3170A026177887B0004F5DDA /* mmcomm-watch */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "mmcomm-watch" */;
- buildPhases = (
- 3170A023177887B0004F5DDA /* Sources */,
- 3170A024177887B0004F5DDA /* Frameworks */,
- 3170A025177887B0004F5DDA /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "mmcomm-watch";
- productName = PublicComponent;
- productReference = 3170A027177887B0004F5DDA /* libmmcomm-watch.a */;
- productType = "com.apple.product-type.library.static";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 3170A01F177887B0004F5DDA /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0460;
- ORGANIZATIONNAME = Tencent;
- };
- buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "mmcomm-watch" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 3170A01E177887B0004F5DDA;
- productRefGroup = 3170A028177887B0004F5DDA /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 3170A026177887B0004F5DDA /* mmcomm-watch */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 3170A023177887B0004F5DDA /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 13635A091981F37600EED49B /* MMStackReportBase.cpp in Sources */,
- 13635A071981F37600EED49B /* newdns.cpp in Sources */,
- 13635A051981F37600EED49B /* logic_utils.cpp in Sources */,
- 13635A061981F37600EED49B /* MMNewGetDns.cpp in Sources */,
- 13635A031981F37600EED49B /* ActiveLogic.cpp in Sources */,
- 13635A081981F37600EED49B /* SocketUtils.cpp in Sources */,
- 13635A041981F37600EED49B /* HttpRequest.cpp in Sources */,
- 1392E92E1A834D890093185B /* MMFileReport.cpp in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 3170A033177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = watchos;
- };
- name = Debug;
- };
- 3170A034177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1";
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- SDKROOT = watchos;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 3170A036177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = /tmp/mmcomm.dst;
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_ENABLE_CPP_EXCEPTIONS = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = NO;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- MACOS,
- "XLOGGER_TAG='\"pubc_$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_VERSION = "";
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = (
- ../comm/crypt,
- ../comm,
- ../openssl/export_include,
- ../log/src,
- );
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_CPLUSPLUSFLAGS = (
- "$(OTHER_CFLAGS)",
- "-fno-exceptions",
- );
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = watchos;
- SKIP_INSTALL = YES;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 armv7k";
- };
- name = Debug;
- };
- 3170A037177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = /tmp/mmcomm.dst;
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_ENABLE_CPP_EXCEPTIONS = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = NO;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "NDEBUG=1",
- MACOS,
- "XLOGGER_TAG='\"pubc_$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_VERSION = "";
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = (
- ../comm/crypt,
- ../comm,
- ../openssl/export_include,
- ../log/src,
- );
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_CPLUSPLUSFLAGS = (
- "$(OTHER_CFLAGS)",
- "-fno-exceptions",
- );
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = watchos;
- SKIP_INSTALL = YES;
- STRIP_INSTALLED_PRODUCT = NO;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 armv7k";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "mmcomm-watch" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A033177887B0004F5DDA /* Debug */,
- 3170A034177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "mmcomm-watch" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A036177887B0004F5DDA /* Debug */,
- 3170A037177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 3170A01F177887B0004F5DDA /* Project object */;
-}
diff --git a/mars/app/src/traffic_statistics.cc b/mars/app/src/traffic_statistics.cc
new file mode 100644
index 000000000..f023d104e
--- /dev/null
+++ b/mars/app/src/traffic_statistics.cc
@@ -0,0 +1,112 @@
+/*
+ * traffic_statistics.cc
+ *
+ * Created on: 2012-9-18
+ * Author: garryyan
+ * Copyright (c) 2013-2015 Tencent. All rights reserved.
+ *
+ */
+
+#include "traffic_statistics.h"
+
+#include
+
+#include "mars/app/app.h"
+#include "mars/comm/platform_comm.h"
+#include "mars/comm/thread/lock.h"
+#include "mars/comm/time_utils.h"
+#include "mars/comm/xlogger/xlogger.h"
+
+using namespace mars::app;
+using namespace mars::comm;
+
+TrafficStatistics::TrafficStatistics()
+: report_timeout_(10 * 1000 /*10s*/)
+, report_size_threshold_(10 * 1024 /*10KB*/)
+, wifi_recv_data_size_(0)
+, wifi_send_data_size_(0)
+, mobile_recv_data_size_(0)
+, mobile_send_data_size_(0)
+, last_report_time_(gettickcount()) {
+}
+
+TrafficStatistics::TrafficStatistics(unsigned long _report_tmo, unsigned int _report_size_threshold)
+: report_timeout_(_report_tmo)
+, report_size_threshold_(_report_size_threshold)
+, wifi_recv_data_size_(0)
+, wifi_send_data_size_(0)
+, mobile_recv_data_size_(0)
+, mobile_send_data_size_(0)
+, last_report_time_(gettickcount()) {
+}
+
+TrafficStatistics::~TrafficStatistics() {
+ xinfo_function();
+ // Flush();
+}
+void TrafficStatistics::SetCallback(
+ const boost::function& _func_report_flow) {
+ ScopedLock lock(mutex_);
+ xassert2(!func_report_flow_);
+ func_report_flow_ = _func_report_flow;
+}
+void TrafficStatistics::Flush() {
+ ScopedLock lock(mutex_);
+ __ReportData();
+}
+
+void TrafficStatistics::Data(unsigned int _send, unsigned int _recv) {
+ ScopedLock lock(mutex_);
+
+ if (0 < _send || 0 < _recv) {
+ if (kMobile != getNetInfo())
+ wifi_recv_data_size_ += _recv;
+ else
+ mobile_recv_data_size_ += _recv;
+
+ if (kMobile != getNetInfo())
+ wifi_send_data_size_ += _send;
+ else
+ mobile_send_data_size_ += _send;
+ }
+
+ if (__IsShouldReport())
+ __ReportData();
+}
+
+void TrafficStatistics::__ReportData() {
+ if (func_report_flow_) {
+ if (wifi_recv_data_size_ > 0 || wifi_send_data_size_ || mobile_recv_data_size_ || mobile_send_data_size_)
+ func_report_flow_(wifi_recv_data_size_,
+ wifi_send_data_size_,
+ mobile_recv_data_size_,
+ mobile_send_data_size_);
+ xdebug2(TSF "wifi:%_, r:%_, mobile:s:%_, r:%_",
+ wifi_send_data_size_,
+ wifi_recv_data_size_,
+ mobile_send_data_size_,
+ mobile_recv_data_size_);
+ } else {
+ xassert2(false,
+ TSF "wifi:s:%_, r:%_, mobile:s:%_, r:%_",
+ wifi_send_data_size_,
+ wifi_recv_data_size_,
+ mobile_send_data_size_,
+ mobile_recv_data_size_);
+ }
+ wifi_recv_data_size_ = 0;
+ wifi_send_data_size_ = 0;
+ mobile_recv_data_size_ = 0;
+ mobile_send_data_size_ = 0;
+ last_report_time_ = gettickcount();
+}
+
+bool TrafficStatistics::__IsShouldReport() const {
+ if ((gettickcount() - last_report_time_ > report_timeout_)
+ || (wifi_recv_data_size_ + wifi_send_data_size_ + mobile_recv_data_size_ + mobile_send_data_size_
+ > report_size_threshold_)) {
+ return true;
+ }
+
+ return false;
+}
diff --git a/mars/app/src/traffic_statistics.h b/mars/app/src/traffic_statistics.h
new file mode 100644
index 000000000..54f0fe3e6
--- /dev/null
+++ b/mars/app/src/traffic_statistics.h
@@ -0,0 +1,55 @@
+/*
+ * traffic_statistics.h
+ *
+ * Created on: 2012-9-18
+ * Author: garryyan
+ * Copyright (c) 2013-2015 Tencent. All rights reserved.
+ *
+ */
+
+#ifndef STN_SRC_TRAFFIC_STATISTICS_H_
+#define STN_SRC_TRAFFIC_STATISTICS_H_
+
+#include "boost/function.hpp"
+#include "boost/signals2.hpp"
+#include "mars/comm/singleton.h"
+#include "mars/comm/thread/mutex.h"
+
+namespace mars {
+namespace app {
+
+class TrafficStatistics {
+ public:
+ TrafficStatistics();
+ TrafficStatistics(unsigned long _report_tmo, unsigned int _report_size_threshold);
+ ~TrafficStatistics();
+ void Data(unsigned int _send, unsigned int _recv);
+ void Flush();
+ void SetCallback(const boost::function& _func_report_flow);
+
+ private:
+ TrafficStatistics(const TrafficStatistics&);
+ TrafficStatistics& operator=(const TrafficStatistics&);
+
+ private:
+ void __ReportData();
+ bool __IsShouldReport() const;
+
+ private:
+ const unsigned long report_timeout_;
+ const unsigned int report_size_threshold_;
+
+ boost::function
+ func_report_flow_;
+
+ unsigned int wifi_recv_data_size_;
+ unsigned int wifi_send_data_size_;
+ unsigned int mobile_recv_data_size_;
+ unsigned int mobile_send_data_size_;
+ uint64_t last_report_time_;
+ comm::Mutex mutex_;
+};
+} // namespace app
+} // namespace mars
+
+#endif // STN_SRC_TRAFFIC_STATISTICS_H_
diff --git a/mars/app/src/wp/platform_logic.cpp b/mars/app/src/wp/platform_logic.cpp
index 6c33da810..bbb0c1a81 100644
--- a/mars/app/src/wp/platform_logic.cpp
+++ b/mars/app/src/wp/platform_logic.cpp
@@ -1,125 +1,107 @@
#include "../../interface/app.h"
-#include "runtime_logic.h"
-#include "xlogger.h"
#include "comm\platform_comm.h"
+#include "runtime_logic.h"
#include "runtime_utils.h"
+#include "xlogger.h"
using namespace PublicComponent;
using namespace Platform;
-std::string getUserNameNoLog()
-{
- String^ psUserName = Runtime2Cs_Logic::Singleton()->getUserName();
+std::string getUserNameNoLog() {
+ String ^ psUserName = Runtime2Cs_Logic::Singleton()->GetAppUserName();
- //std::wstring wsUsername(psUserName->Data());
- std::string sUsername = String2stdstring(psUserName);
- //sUsername.assign(wsUsername.begin(), wsUsername.end());
+ // std::wstring wsUsername(psUserName->Data());
+ std::string sUsername = String2stdstring(psUserName);
+ // sUsername.assign(wsUsername.begin(), wsUsername.end());
- return sUsername;
+ return sUsername;
}
-std::string getUserName()
-{
- xverbose_function();
+std::string GetAppUserName() {
+ xverbose_function();
- std::string userName = getUserNameNoLog();
- xdebug2(TSF"userName= %0", userName);
+ std::string userName = getUserNameNoLog();
+ xdebug2(TSF "userName= %0", userName);
return userName;
}
// ���ص�ǰ�û������û�У�����֮ǰ��½���Ǹ��û�����Ҫ���ؿվͿ���
-//wp�ͷ��ص�ǰusername
-std::string getRecentUserName()
-{
- xverbose_function();
+// wp�ͷ��ص�ǰusername
+std::string getRecentUserName() {
+ xverbose_function();
- return getUserName();
+ return GetAppUserName();
}
-unsigned int getClientVersionNoLog()
-{
- return Runtime2Cs_Logic::Singleton()->getClientVersion();
+unsigned int getClientVersionNoLog() {
+ return Runtime2Cs_Logic::Singleton()->getClientVersion();
}
-unsigned int getClientVersion()
-{
- xverbose_function();
+unsigned int getClientVersion() {
+ xverbose_function();
- unsigned int clientVersion = getClientVersionNoLog();
+ unsigned int clientVersion = getClientVersionNoLog();
- xdebug2(TSF"clientVersion= %0", clientVersion);
- return clientVersion;
+ xdebug2(TSF "clientVersion= %0", clientVersion);
+ return clientVersion;
}
-
-AccountInfo getAccountInfo()
-{
- xverbose_function();
- AccountInfo accountInfo;
- AccountInfoRef^ inforef = Runtime2Cs_Logic::Singleton()->getAccountInfo();
- if(inforef != nullptr)
- {
- accountInfo.qquin = inforef->qquin;
- accountInfo.uin = inforef->uin;
- //std::wstring wsUsername(inforef->username->Data());
- accountInfo.username = String2stdstring(inforef->username);
- }
-
- return accountInfo;
+AccountInfo getAccountInfo() {
+ xverbose_function();
+ AccountInfo accountInfo;
+ AccountInfoRef ^ inforef = Runtime2Cs_Logic::Singleton()->getAccountInfo();
+ if (inforef != nullptr) {
+ accountInfo.qquin = inforef->qquin;
+ accountInfo.uin = inforef->uin;
+ // std::wstring wsUsername(inforef->username->Data());
+ accountInfo.username = String2stdstring(inforef->username);
+ }
+
+ return accountInfo;
}
-void getUplodLogExtrasInfo(std::string& _extrasinfo)
-{
- xverbose_function();
- String^ psExInfo = Runtime2Cs_Logic::Singleton()->getUplodLogExtrasInfo();
-
- //std::wstring wsExinfo2(TSFpsExInfo->Data());
- _extrasinfo = String2stdstring(psExInfo);
+void getUplodLogExtrasInfo(std::string& _extrasinfo) {
+ xverbose_function();
+ String ^ psExInfo = Runtime2Cs_Logic::Singleton()->getUplodLogExtrasInfo();
+
+ // std::wstring wsExinfo2(TSFpsExInfo->Data());
+ _extrasinfo = String2stdstring(psExInfo);
}
-void getWatchDogPath(std::string& _watchDogPath)
-{
- xverbose_function();
- _watchDogPath = getAppFilePath();
- _watchDogPath += "\\watchdog\\";
+void getWatchDogPath(std::string& _watchDogPath) {
+ xverbose_function();
+ _watchDogPath = getAppFilePath();
+ _watchDogPath += "\\watchdog\\";
}
-void getKVCommPath(std::string& _kvCommPath)
-{
- xverbose_function();
- _kvCommPath = getAppFilePath();
- _kvCommPath += "\\kvcomm\\";
+void getKVCommPath(std::string& _kvCommPath) {
+ xverbose_function();
+ _kvCommPath = getAppFilePath();
+ _kvCommPath += "\\kvcomm\\";
}
-void getCrashFilePath(std::string& filePath, int timespan)
-{
- xverbose_function();
- String^ psfilePath = Runtime2Cs_Logic::Singleton()->getCrashFilePath(timespan);
-
- //std::wstring wsfilePath(psfilePath->Data());
- filePath = String2stdstring(psfilePath);
+void getCrashFilePath(std::string& filePath, int timespan) {
+ xverbose_function();
+ String ^ psfilePath = Runtime2Cs_Logic::Singleton()->getCrashFilePath(timespan);
+
+ // std::wstring wsfilePath(psfilePath->Data());
+ filePath = String2stdstring(psfilePath);
}
-unsigned int getNextNoopTime()
-{
- return Runtime2Cs_Logic::Singleton()->getNextNoopTime();
+unsigned int getNextNoopTime() {
+ return Runtime2Cs_Logic::Singleton()->getNextNoopTime();
}
-unsigned int getNoopInterval()
-{
- return Runtime2Cs_Logic::Singleton()->getNoopInterval();
+unsigned int getNoopInterval() {
+ return Runtime2Cs_Logic::Singleton()->getNoopInterval();
}
-std::string getDeviceType()
-{
- return String2stdstring(Runtime2Cs_Logic::Singleton()->getDeviceType());
+std::string getDeviceType() {
+ return String2stdstring(Runtime2Cs_Logic::Singleton()->getDeviceType());
}
-std::string getCurLanguage()
-{
- String^ curLanguage = Runtime2Cs_Logic::Singleton()->getCurLanguage();
- return String2stdstring(curLanguage);
+std::string getCurLanguage() {
+ String ^ curLanguage = Runtime2Cs_Logic::Singleton()->getCurLanguage();
+ return String2stdstring(curLanguage);
}
-std::string getDeviceInfo()
-{
- return "";
+std::string getDeviceInfo() {
+ return "";
}
-
diff --git a/mars/app/win32proj/app.vcxproj b/mars/app/win32proj/app.vcxproj
deleted file mode 100644
index a61389604..000000000
--- a/mars/app/win32proj/app.vcxproj
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
-
- {A941CF29-3C28-464B-80D5-DFCB8A3C57A9}
- Win32Proj
- app
- 8.1
-
-
-
- StaticLibrary
- true
- v140
- Unicode
-
-
- StaticLibrary
- false
- v120_xp
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
- $(SolutionDir)/../../;$(SolutionDir)/../comm/windows;$(SolutionDir)/../comm/windows/zlib;$(ProjectDir)/../src;$(IncludePath)
-
-
- $(SolutionDir)/../../;$(SolutionDir)/../comm/windows;$(SolutionDir)/../comm/windows/zlib;$(ProjectDir)/../src;$(IncludePath)
- true
-
-
-
-
-
- TurnOffAllWarnings
- Disabled
- WIN32;_DEBUG;_LIB;NOMINMAX;%(PreprocessorDefinitions)
- mars/comm/projdef.h
-
-
- Windows
- true
-
-
-
-
- TurnOffAllWarnings
-
-
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_LIB;NOMINMAX;%(PreprocessorDefinitions)
- mars/comm/projdef.h
- OldStyle
-
-
- Windows
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mars/app/win32proj/app.vcxproj.filters b/mars/app/win32proj/app.vcxproj.filters
deleted file mode 100644
index 4849a2dfe..000000000
--- a/mars/app/win32proj/app.vcxproj.filters
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hh;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
-
-
-
- Header Files
-
-
- Header Files
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/mars/app/win32proj/app.vcxproj.user b/mars/app/win32proj/app.vcxproj.user
deleted file mode 100644
index ef5ff2a1f..000000000
--- a/mars/app/win32proj/app.vcxproj.user
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/mars/baseevent/.cproject b/mars/baseevent/.cproject
deleted file mode 100644
index 12d4b4fd9..000000000
--- a/mars/baseevent/.cproject
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mars/baseevent/.project b/mars/baseevent/.project
deleted file mode 100644
index ddc318a7b..000000000
--- a/mars/baseevent/.project
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
- baseevent_mars
-
-
- comm_mars
-
-
-
- org.eclipse.cdt.managedbuilder.core.genmakebuilder
- clean,full,incremental,
-
-
- ?name?
-
-
-
- org.eclipse.cdt.make.core.append_environment
- true
-
-
- org.eclipse.cdt.make.core.buildArguments
-
-
-
- org.eclipse.cdt.make.core.buildCommand
- ndk-build
-
-
- org.eclipse.cdt.make.core.cleanBuildTarget
- clean
-
-
- org.eclipse.cdt.make.core.contents
- org.eclipse.cdt.make.core.activeConfigSettings
-
-
- org.eclipse.cdt.make.core.enableAutoBuild
- false
-
-
- org.eclipse.cdt.make.core.enableCleanBuild
- true
-
-
- org.eclipse.cdt.make.core.enableFullBuild
- true
-
-
- org.eclipse.cdt.make.core.fullBuildTarget
- NDK_DEBGU=0 V=1 LIBPREFIX=wechat -j2
-
-
- org.eclipse.cdt.make.core.stopOnError
- true
-
-
- org.eclipse.cdt.make.core.useDefaultBuildCmd
- true
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
- full,incremental,
-
-
-
-
-
- org.eclipse.cdt.core.cnature
- org.eclipse.cdt.core.ccnature
- org.eclipse.cdt.managedbuilder.core.managedBuildNature
- org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
-
-
diff --git a/mars/baseevent/CMakeLists.txt b/mars/baseevent/CMakeLists.txt
new file mode 100644
index 000000000..b24005c02
--- /dev/null
+++ b/mars/baseevent/CMakeLists.txt
@@ -0,0 +1,34 @@
+cmake_minimum_required (VERSION 3.6)
+
+set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE)
+message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
+
+project (baseevent)
+
+include(../comm/utils.cmake)
+include(../comm/CMakeExtraFlags.txt)
+
+
+include_directories(.)
+include_directories(src)
+include_directories(..)
+include_directories(../..)
+include_directories(../comm)
+include_directories(../../..)
+
+file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h)
+source_group(src FILES ${SELF_TEMP_SRC_FILES})
+list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES})
+
+
+if(MSVC)
+ add_definitions(/FI"../../comm/projdef.h")
+ include_directories(../comm/windows)
+elseif(ANDROID)
+ file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc)
+ list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES})
+endif()
+
+BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}")
+
+
diff --git a/mars/baseevent/active_logic.h b/mars/baseevent/active_logic.h
index ca0d26253..1b6578d1d 100644
--- a/mars/baseevent/active_logic.h
+++ b/mars/baseevent/active_logic.h
@@ -1,15 +1,15 @@
-// Tencent is pleased to support the open source community by making Mars available.
-// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-
-// Licensed under the MIT License (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://opensource.org/licenses/MIT
-
-// Unless required by applicable law or agreed to in writing, software distributed under the License is
-// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
-// either express or implied. See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Tencent is pleased to support the open source community by making Mars available.
+// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
+
+// Licensed under the MIT License (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://opensource.org/licenses/MIT
+
+// Unless required by applicable law or agreed to in writing, software distributed under the License is
+// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+// either express or implied. See the License for the specific language governing permissions and
+// limitations under the License.
+
/*
* active_logic.h
*
@@ -20,18 +20,25 @@
#ifndef MMCOMM_SRC_ACTIVE_LOGIC_H_
#define MMCOMM_SRC_ACTIVE_LOGIC_H_
-#include "boost/signals2.hpp"
+#include
+#include "boost/signals2.hpp"
#include "mars/comm/alarm.h"
+#include "mars/comm/singleton.h"
#include "mars/comm/thread/mutex.h"
-class ActiveLogic
-{
-public:
- boost::signals2::signal SignalForeground;
- boost::signals2::signal SignalActive;
+namespace mars {
+namespace comm {
+
+class ActiveLogic {
+ public:
+ // SINGLETON_INTRUSIVE(ActiveLogic, new ActiveLogic, delete);
+ boost::signals2::signal SignalForeground;
+ boost::signals2::signal SignalActive;
+ static std::shared_ptr Instance();
+ static void Release();
-public:
+ public:
ActiveLogic();
virtual ~ActiveLogic();
@@ -41,14 +48,19 @@ class ActiveLogic
bool IsForeground() const;
uint64_t LastForegroundChangeTime() const;
-private:
+ void SwitchActiveStateForDebug(bool _active);
+
+ private:
void __OnInActive();
-private:
- bool isforeground_;
- bool isactive_;
- Alarm alarm_;
+ private:
+ bool isforeground_;
+ bool isactive_;
+ Alarm alarm_;
uint64_t lastforegroundchangetime_;
+ static std::shared_ptr inst_;
};
-#endif // MMCOMM_SRC_ACTIVE_LOGIC_H_
+} // namespace comm
+} // namespace mars
+#endif // MMCOMM_SRC_ACTIVE_LOGIC_H_
diff --git a/mars/baseevent/base_logic.h b/mars/baseevent/base_logic.h
index 64cc6d2d7..2f34039f7 100644
--- a/mars/baseevent/base_logic.h
+++ b/mars/baseevent/base_logic.h
@@ -1,15 +1,15 @@
-// Tencent is pleased to support the open source community by making Mars available.
-// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-
-// Licensed under the MIT License (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://opensource.org/licenses/MIT
-
-// Unless required by applicable law or agreed to in writing, software distributed under the License is
-// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
-// either express or implied. See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Tencent is pleased to support the open source community by making Mars available.
+// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
+
+// Licensed under the MIT License (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://opensource.org/licenses/MIT
+
+// Unless required by applicable law or agreed to in writing, software distributed under the License is
+// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+// either express or implied. See the License for the specific language governing permissions and
+// limitations under the License.
+
/*
* baseprj.h
*
@@ -20,15 +20,23 @@
#ifndef MARS_BASELOGIC_H_
#define MARS_BASELOGIC_H_
-namespace mars{
-namespace baseevent{
- void OnCreate();
- void OnDestroy();
- void OnSingalCrash(int _sig);
- void OnExceptionCrash();
- void OnForeground(bool _isforeground);
- void OnNetworkChange();
-}
-}
+#include
+
+#include
+
+namespace mars {
+namespace baseevent {
+void OnCreate();
+void OnInitBeforeOnCreate(int _encoder_status);
+void OnInitBeforeOnCreateV2(int _encoder_status, std::string _encoder_name);
+void OnDestroy();
+void OnSingalCrash(int _sig);
+void OnExceptionCrash();
+void OnForeground(bool _isforeground);
+void OnNetworkChange();
+void OnNetworkDataChange(const char* _tag, int32_t _send, int32_t _recv);
+void OnAlarm(int64_t _id);
+} // namespace baseevent
+} // namespace mars
#endif /* MARS_BASELOGIC_H_ */
diff --git a/mars/baseevent/baseevent-mac.xcodeproj/project.pbxproj b/mars/baseevent/baseevent-mac.xcodeproj/project.pbxproj
deleted file mode 100644
index b870a68ab..000000000
--- a/mars/baseevent/baseevent-mac.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,531 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 55D908181CC7BC370076CBD9 /* active_logic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D908151CC7BC370076CBD9 /* active_logic.cc */; };
- 55D908191CC7BC370076CBD9 /* baseprj.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D908161CC7BC370076CBD9 /* baseprj.cc */; };
- 55D9081A1CC7BC370076CBD9 /* baseprjevent.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D908171CC7BC370076CBD9 /* baseprjevent.cc */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 3170A025177887B0004F5DDA /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "include/${PRODUCT_NAME}";
- dstSubfolderSpec = 16;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 1F25BF081CD3646400AC1003 /* active_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = active_logic.h; sourceTree = ""; };
- 1F25BF091CD3646400AC1003 /* base_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base_logic.h; sourceTree = ""; };
- 1F25BF0A1CD3646400AC1003 /* baseevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseevent.h; sourceTree = ""; };
- 1F25BF0B1CD3646400AC1003 /* baseprjevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseprjevent.h; sourceTree = ""; };
- 55D908151CC7BC370076CBD9 /* active_logic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = active_logic.cc; sourceTree = ""; };
- 55D908161CC7BC370076CBD9 /* baseprj.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprj.cc; sourceTree = ""; };
- 55D908171CC7BC370076CBD9 /* baseprjevent.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprjevent.cc; sourceTree = ""; };
- 55D9C0821CC7B1C90076CBD9 /* libbaseevent.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libbaseevent.a; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 3170A024177887B0004F5DDA /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 3170A01E177887B0004F5DDA = {
- isa = PBXGroup;
- children = (
- 1F25BF081CD3646400AC1003 /* active_logic.h */,
- 1F25BF091CD3646400AC1003 /* base_logic.h */,
- 1F25BF0A1CD3646400AC1003 /* baseevent.h */,
- 1F25BF0B1CD3646400AC1003 /* baseprjevent.h */,
- 55D908141CC7BC370076CBD9 /* src */,
- 55D9C0821CC7B1C90076CBD9 /* libbaseevent.a */,
- );
- sourceTree = "";
- };
- 55D908141CC7BC370076CBD9 /* src */ = {
- isa = PBXGroup;
- children = (
- 55D908151CC7BC370076CBD9 /* active_logic.cc */,
- 55D908161CC7BC370076CBD9 /* baseprj.cc */,
- 55D908171CC7BC370076CBD9 /* baseprjevent.cc */,
- );
- path = src;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 3170A026177887B0004F5DDA /* baseevent */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseevent" */;
- buildPhases = (
- 3170A023177887B0004F5DDA /* Sources */,
- 3170A024177887B0004F5DDA /* Frameworks */,
- 3170A025177887B0004F5DDA /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = baseevent;
- productName = PublicComponent;
- productReference = 55D9C0821CC7B1C90076CBD9 /* libbaseevent.a */;
- productType = "com.apple.product-type.library.static";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 3170A01F177887B0004F5DDA /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0460;
- ORGANIZATIONNAME = felixzhou;
- };
- buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseevent-mac" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 3170A01E177887B0004F5DDA;
- productRefGroup = 3170A01E177887B0004F5DDA;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 3170A026177887B0004F5DDA /* baseevent */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 3170A023177887B0004F5DDA /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 55D9081A1CC7BC370076CBD9 /* baseprjevent.cc in Sources */,
- 55D908181CC7BC370076CBD9 /* active_logic.cc in Sources */,
- 55D908191CC7BC370076CBD9 /* baseprj.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 3170A033177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = YES;
- ARCHS = "$(ARCHS_STANDARD_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 6.1;
- MACOSX_DEPLOYMENT_TARGET = 10.7;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx10.10;
- };
- name = Debug;
- };
- 3170A034177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = YES;
- ARCHS = "$(ARCHS_STANDARD_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 6.1;
- MACOSX_DEPLOYMENT_TARGET = 10.7;
- SDKROOT = macosx10.10;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 3170A036177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = /tmp/PublicComponent.dst;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "NETWORK=1",
- "KVCOMM=1",
- "XLOGGER=1",
- "DEBUG=1",
- "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = YES;
- GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = (
- $SOURCE_ROOT/,
- $SOURCE_ROOT/src,
- $SOURCE_ROOT/../,
- $SOURCE_ROOT/../../,
- $SOURCE_ROOT/../comm,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/comm/build/Release-iphoneos",
- "$(PROJECT_DIR)/comm/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/i386",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/netchecker/build/Release-iphoneos",
- "$(PROJECT_DIR)/netchecker/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdntran/build/Release-iphoneos",
- "$(PROJECT_DIR)/cdntran/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/streamcdn/build/Release-iphoneos",
- "$(PROJECT_DIR)/streamcdn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/i386",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmjpeg/build/Release-iphoneos",
- "$(PROJECT_DIR)/mmjpeg/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmjpeg/obj/local/armeabi",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/i386",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/app/build/Release-iphoneos",
- "$(PROJECT_DIR)/app/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/i386",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/i386",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/baseevent/build/Release-iphoneos",
- "$(PROJECT_DIR)/baseevent/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdn/build/Release-iphoneos",
- "$(PROJECT_DIR)/cdn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/i386",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/log/build/Release-iphoneos",
- "$(PROJECT_DIR)/log/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/i386",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/magicbox/build/Release-iphoneos",
- "$(PROJECT_DIR)/magicbox/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmcomm/build/Release-iphoneos",
- "$(PROJECT_DIR)/mmcomm/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmcomm/obj/local/armeabi",
- "$(PROJECT_DIR)/mmjpeg/build/Release",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/i386",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/protobuf/build/Release-iphoneos",
- "$(PROJECT_DIR)/protobuf/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/sdt/build/Release-iphoneos",
- "$(PROJECT_DIR)/sdt/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/i386",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/smc/build/Release-iphoneos",
- "$(PROJECT_DIR)/smc/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/i386",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/stn/build/Release-iphoneos",
- "$(PROJECT_DIR)/stn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/i386",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/openssl/build/Release-iphoneos",
- "$(PROJECT_DIR)/openssl/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/openssl/obj/local/armeabi",
- );
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = macosx;
- SKIP_INSTALL = YES;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 x86_64";
- };
- name = Debug;
- };
- 3170A037177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = /tmp/PublicComponent.dst;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "NETWORK=1",
- "KVCOMM=1",
- "XLOGGER=1",
- "NDEBUG=1",
- "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = YES;
- GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = (
- $SOURCE_ROOT/,
- $SOURCE_ROOT/src,
- $SOURCE_ROOT/../,
- $SOURCE_ROOT/../../,
- $SOURCE_ROOT/../comm,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/comm/build/Release-iphoneos",
- "$(PROJECT_DIR)/comm/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/i386",
- "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/netchecker/build/Release-iphoneos",
- "$(PROJECT_DIR)/netchecker/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdntran/build/Release-iphoneos",
- "$(PROJECT_DIR)/cdntran/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/streamcdn/build/Release-iphoneos",
- "$(PROJECT_DIR)/streamcdn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/i386",
- "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmjpeg/build/Release-iphoneos",
- "$(PROJECT_DIR)/mmjpeg/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmjpeg/obj/local/armeabi",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/i386",
- "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/app/build/Release-iphoneos",
- "$(PROJECT_DIR)/app/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/i386",
- "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/i386",
- "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/baseevent/build/Release-iphoneos",
- "$(PROJECT_DIR)/baseevent/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386",
- "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/cdn/build/Release-iphoneos",
- "$(PROJECT_DIR)/cdn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/i386",
- "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/log/build/Release-iphoneos",
- "$(PROJECT_DIR)/log/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/i386",
- "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/magicbox/build/Release-iphoneos",
- "$(PROJECT_DIR)/magicbox/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/mmcomm/build/Release-iphoneos",
- "$(PROJECT_DIR)/mmcomm/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/mmcomm/obj/local/armeabi",
- "$(PROJECT_DIR)/mmjpeg/build/Release",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/i386",
- "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/protobuf/build/Release-iphoneos",
- "$(PROJECT_DIR)/protobuf/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/sdt/build/Release-iphoneos",
- "$(PROJECT_DIR)/sdt/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/i386",
- "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/i386",
- "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/smc/build/Release-iphoneos",
- "$(PROJECT_DIR)/smc/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/i386",
- "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/stn/build/Release-iphoneos",
- "$(PROJECT_DIR)/stn/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/i386",
- "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/arm64",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/armv7",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/i386",
- "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/x86_64",
- "$(PROJECT_DIR)/openssl/build/Release-iphoneos",
- "$(PROJECT_DIR)/openssl/build/Release-iphonesimulator",
- "$(PROJECT_DIR)/openssl/obj/local/armeabi",
- );
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = macosx;
- SKIP_INSTALL = YES;
- STRIP_INSTALLED_PRODUCT = NO;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 x86_64";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseevent-mac" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A033177887B0004F5DDA /* Debug */,
- 3170A034177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseevent" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A036177887B0004F5DDA /* Debug */,
- 3170A037177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 3170A01F177887B0004F5DDA /* Project object */;
-}
diff --git a/mars/baseevent/baseevent.h b/mars/baseevent/baseevent.h
index d741380c5..3eedec6bc 100644
--- a/mars/baseevent/baseevent.h
+++ b/mars/baseevent/baseevent.h
@@ -1,7 +1,7 @@
// Tencent is pleased to support the open source community by making Mars available.
// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-// Licensed under the MIT License (the "License"); you may not use this file except in
+// Licensed under the MIT License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://opensource.org/licenses/MIT
@@ -20,8 +20,8 @@
#ifndef BASEEVENT_INTERFACE_BASEEVENT_H_
#define BASEEVENT_INTERFACE_BASEEVENT_H_
-#include
#include
+#include
#ifdef ANDROID
#include
@@ -29,12 +29,12 @@
namespace mars {
namespace baseevent {
- extern void addLoadModule(std::string _module_name);
+extern void addLoadModule(std::string _module_name);
- extern jobject getLoadLibraries(JNIEnv *_env);
+extern jobject getLoadLibraries(JNIEnv* _env);
-}
-}
+} // namespace baseevent
+} // namespace mars
#endif
diff --git a/mars/baseevent/baseevent.xcodeproj/project.pbxproj b/mars/baseevent/baseevent.xcodeproj/project.pbxproj
deleted file mode 100644
index df195dc4c..000000000
--- a/mars/baseevent/baseevent.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,322 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 13A2285C19755CB40035828E /* baseprj.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13A2285719755CB40035828E /* baseprj.cc */; };
- 13A2285D19755CB40035828E /* baseprjevent.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13A2285919755CB40035828E /* baseprjevent.cc */; };
- 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3170A02A177887B0004F5DDA /* Foundation.framework */; };
- 4F9D08F51C7C261400E2CEE6 /* active_logic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4F9D08F41C7C261400E2CEE6 /* active_logic.cc */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 3170A025177887B0004F5DDA /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "include/${PRODUCT_NAME}";
- dstSubfolderSpec = 16;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 13A2285719755CB40035828E /* baseprj.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprj.cc; sourceTree = ""; };
- 13A2285919755CB40035828E /* baseprjevent.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprjevent.cc; sourceTree = ""; };
- 1F25B3071CD334C400AC1003 /* active_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = active_logic.h; sourceTree = ""; };
- 1F25B3081CD334C400AC1003 /* base_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base_logic.h; sourceTree = ""; };
- 1F25B3091CD334C400AC1003 /* baseevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseevent.h; sourceTree = ""; };
- 1F25B30A1CD334C400AC1003 /* baseprjevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseprjevent.h; sourceTree = ""; };
- 3170A027177887B0004F5DDA /* libbaseevent.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libbaseevent.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 3170A02A177887B0004F5DDA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 4F9D08F41C7C261400E2CEE6 /* active_logic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = active_logic.cc; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 3170A024177887B0004F5DDA /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 13A2285619755CB40035828E /* src */ = {
- isa = PBXGroup;
- children = (
- 4F9D08F41C7C261400E2CEE6 /* active_logic.cc */,
- 13A2285719755CB40035828E /* baseprj.cc */,
- 13A2285919755CB40035828E /* baseprjevent.cc */,
- );
- path = src;
- sourceTree = "";
- };
- 3170A01E177887B0004F5DDA = {
- isa = PBXGroup;
- children = (
- 1F25B3071CD334C400AC1003 /* active_logic.h */,
- 1F25B3081CD334C400AC1003 /* base_logic.h */,
- 1F25B3091CD334C400AC1003 /* baseevent.h */,
- 1F25B30A1CD334C400AC1003 /* baseprjevent.h */,
- 13A2285619755CB40035828E /* src */,
- 3170A029177887B0004F5DDA /* Frameworks */,
- 3170A028177887B0004F5DDA /* Products */,
- );
- sourceTree = "";
- };
- 3170A028177887B0004F5DDA /* Products */ = {
- isa = PBXGroup;
- children = (
- 3170A027177887B0004F5DDA /* libbaseevent.a */,
- );
- name = Products;
- sourceTree = "";
- };
- 3170A029177887B0004F5DDA /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 3170A02A177887B0004F5DDA /* Foundation.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 3170A026177887B0004F5DDA /* baseevent */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseevent" */;
- buildPhases = (
- 3170A023177887B0004F5DDA /* Sources */,
- 3170A024177887B0004F5DDA /* Frameworks */,
- 3170A025177887B0004F5DDA /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = baseevent;
- productName = PublicComponent;
- productReference = 3170A027177887B0004F5DDA /* libbaseevent.a */;
- productType = "com.apple.product-type.library.static";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 3170A01F177887B0004F5DDA /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0720;
- ORGANIZATIONNAME = Tencent;
- };
- buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseevent" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 3170A01E177887B0004F5DDA;
- productRefGroup = 3170A028177887B0004F5DDA /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 3170A026177887B0004F5DDA /* baseevent */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 3170A023177887B0004F5DDA /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 4F9D08F51C7C261400E2CEE6 /* active_logic.cc in Sources */,
- 13A2285D19755CB40035828E /* baseprjevent.cc in Sources */,
- 13A2285C19755CB40035828E /* baseprj.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 3170A033177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- ENABLE_TESTABILITY = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = iphoneos;
- };
- name = Debug;
- };
- 3170A034177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1";
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- SDKROOT = iphoneos;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 3170A036177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_DEBUG_INFORMATION_LEVEL = default;
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = "/tmp/$(PROJECT_NAME).dst";
- ENABLE_BITCODE = NO;
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_ENABLE_CPP_EXCEPTIONS = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = NO;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- MACOS,
- "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = YES;
- GCC_VERSION = "";
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = (
- $SOURCE_ROOT/,
- $SOURCE_ROOT/../,
- $SOURCE_ROOT/../../,
- $SOURCE_ROOT/../comm,
- );
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_CPLUSPLUSFLAGS = (
- "$(OTHER_CFLAGS)",
- "-fno-exceptions",
- );
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = baseevent;
- SKIP_INSTALL = YES;
- STRIP_INSTALLED_PRODUCT = YES;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 armv7 arm64 x86_64";
- };
- name = Debug;
- };
- 3170A037177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_DEBUG_INFORMATION_LEVEL = "line-tables-only";
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = "/tmp/$(PROJECT_NAME).dst";
- ENABLE_BITCODE = NO;
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_ENABLE_CPP_EXCEPTIONS = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = NO;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "NDEBUG=1",
- MACOS,
- "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = YES;
- GCC_VERSION = "";
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = (
- $SOURCE_ROOT/,
- $SOURCE_ROOT/../,
- $SOURCE_ROOT/../../,
- $SOURCE_ROOT/../comm,
- );
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_CPLUSPLUSFLAGS = (
- "$(OTHER_CFLAGS)",
- "-fno-exceptions",
- );
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = baseevent;
- SKIP_INSTALL = YES;
- STRIP_INSTALLED_PRODUCT = YES;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 armv7 arm64 x86_64";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseevent" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A033177887B0004F5DDA /* Debug */,
- 3170A034177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseevent" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A036177887B0004F5DDA /* Debug */,
- 3170A037177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 3170A01F177887B0004F5DDA /* Project object */;
-}
diff --git a/mars/baseevent/baseprj-watch.xcodeproj/project.pbxproj b/mars/baseevent/baseprj-watch.xcodeproj/project.pbxproj
deleted file mode 100644
index 258e546ff..000000000
--- a/mars/baseevent/baseprj-watch.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,312 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 13A2285B19755CB40035828E /* Objc2C_Comm.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13A2285519755CB40035828E /* Objc2C_Comm.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; };
- 13A2285C19755CB40035828E /* baseprj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13A2285719755CB40035828E /* baseprj.cpp */; };
- 13A2285D19755CB40035828E /* baseprjevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13A2285919755CB40035828E /* baseprjevent.cpp */; };
- 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3170A02A177887B0004F5DDA /* Foundation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 3170A025177887B0004F5DDA /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "include/${PRODUCT_NAME}";
- dstSubfolderSpec = 16;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 13A2285519755CB40035828E /* Objc2C_Comm.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Objc2C_Comm.mm; sourceTree = ""; };
- 13A2285719755CB40035828E /* baseprj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprj.cpp; sourceTree = ""; };
- 13A2285819755CB40035828E /* baseprj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseprj.h; sourceTree = ""; };
- 13A2285919755CB40035828E /* baseprjevent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprjevent.cpp; sourceTree = ""; };
- 13A2285A19755CB40035828E /* baseprjevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseprjevent.h; sourceTree = ""; };
- 3170A027177887B0004F5DDA /* libbaseprj-watch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libbaseprj-watch.a"; sourceTree = BUILT_PRODUCTS_DIR; };
- 3170A02A177887B0004F5DDA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 3170A024177887B0004F5DDA /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 13A2285419755CB40035828E /* objc */ = {
- isa = PBXGroup;
- children = (
- 13A2285519755CB40035828E /* Objc2C_Comm.mm */,
- );
- path = objc;
- sourceTree = "";
- };
- 13A2285619755CB40035828E /* src */ = {
- isa = PBXGroup;
- children = (
- 13A2285719755CB40035828E /* baseprj.cpp */,
- 13A2285819755CB40035828E /* baseprj.h */,
- 13A2285919755CB40035828E /* baseprjevent.cpp */,
- 13A2285A19755CB40035828E /* baseprjevent.h */,
- );
- path = src;
- sourceTree = "";
- };
- 3170A01E177887B0004F5DDA = {
- isa = PBXGroup;
- children = (
- 13A2285419755CB40035828E /* objc */,
- 13A2285619755CB40035828E /* src */,
- 3170A029177887B0004F5DDA /* Frameworks */,
- 3170A028177887B0004F5DDA /* Products */,
- );
- sourceTree = "";
- };
- 3170A028177887B0004F5DDA /* Products */ = {
- isa = PBXGroup;
- children = (
- 3170A027177887B0004F5DDA /* libbaseprj-watch.a */,
- );
- name = Products;
- sourceTree = "";
- };
- 3170A029177887B0004F5DDA /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 3170A02A177887B0004F5DDA /* Foundation.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 3170A026177887B0004F5DDA /* baseprj-watch */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseprj-watch" */;
- buildPhases = (
- 3170A023177887B0004F5DDA /* Sources */,
- 3170A024177887B0004F5DDA /* Frameworks */,
- 3170A025177887B0004F5DDA /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "baseprj-watch";
- productName = PublicComponent;
- productReference = 3170A027177887B0004F5DDA /* libbaseprj-watch.a */;
- productType = "com.apple.product-type.library.static";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 3170A01F177887B0004F5DDA /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0460;
- ORGANIZATIONNAME = Tencent;
- };
- buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseprj-watch" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 3170A01E177887B0004F5DDA;
- productRefGroup = 3170A028177887B0004F5DDA /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 3170A026177887B0004F5DDA /* baseprj-watch */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 3170A023177887B0004F5DDA /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 13A2285B19755CB40035828E /* Objc2C_Comm.mm in Sources */,
- 13A2285D19755CB40035828E /* baseprjevent.cpp in Sources */,
- 13A2285C19755CB40035828E /* baseprj.cpp in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 3170A033177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = watchos;
- };
- name = Debug;
- };
- 3170A034177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1";
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- SDKROOT = watchos;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 3170A036177887B0004F5DDA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = "/tmp/$(PROJECT_NAME).dst";
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_ENABLE_CPP_EXCEPTIONS = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = NO;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- MACOS,
- "XLOGGER_TAG='\"pubc_$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_VERSION = "";
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = ../comm;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_CPLUSPLUSFLAGS = (
- "$(OTHER_CFLAGS)",
- "-fno-exceptions",
- );
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = watchos;
- SKIP_INSTALL = YES;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 armv7k";
- };
- name = Debug;
- };
- 3170A037177887B0004F5DDA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- DEAD_CODE_STRIPPING = YES;
- DEPLOYMENT_POSTPROCESSING = NO;
- DSTROOT = "/tmp/$(PROJECT_NAME).dst";
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_ENABLE_CPP_EXCEPTIONS = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = NO;
- GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "NDEBUG=1",
- MACOS,
- "XLOGGER_TAG='\"pubc_$(PROJECT_NAME)\"'",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_VERSION = "";
- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
- GCC_WARN_UNUSED_FUNCTION = YES;
- HEADER_SEARCH_PATHS = ../comm;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
- MACH_O_TYPE = staticlib;
- ONLY_ACTIVE_ARCH = NO;
- OTHER_CPLUSPLUSFLAGS = (
- "$(OTHER_CFLAGS)",
- "-fno-exceptions",
- );
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = watchos;
- SKIP_INSTALL = YES;
- STRIP_INSTALLED_PRODUCT = NO;
- STRIP_STYLE = all;
- VALID_ARCHS = "i386 armv7k";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseprj-watch" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A033177887B0004F5DDA /* Debug */,
- 3170A034177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseprj-watch" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 3170A036177887B0004F5DDA /* Debug */,
- 3170A037177887B0004F5DDA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 3170A01F177887B0004F5DDA /* Project object */;
-}
diff --git a/mars/baseevent/baseprjevent.h b/mars/baseevent/baseprjevent.h
index 55dc0006b..fd470562c 100644
--- a/mars/baseevent/baseprjevent.h
+++ b/mars/baseevent/baseprjevent.h
@@ -1,15 +1,15 @@
-// Tencent is pleased to support the open source community by making Mars available.
-// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-
-// Licensed under the MIT License (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://opensource.org/licenses/MIT
-
-// Unless required by applicable law or agreed to in writing, software distributed under the License is
-// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
-// either express or implied. See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Tencent is pleased to support the open source community by making Mars available.
+// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
+
+// Licensed under the MIT License (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://opensource.org/licenses/MIT
+
+// Unless required by applicable law or agreed to in writing, software distributed under the License is
+// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+// either express or implied. See the License for the specific language governing permissions and
+// limitations under the License.
+
/*
* baseprjevent.h
*
@@ -22,13 +22,17 @@
#include "boost/signals2.hpp"
-extern boost::signals2::signal& GetSignalOnCreate();
-extern boost::signals2::signal& GetSignalOnDestroy();
-extern boost::signals2::signal& GetSignalOnSingalCrash();
-extern boost::signals2::signal& GetSignalOnExceptionCrash();
-extern boost::signals2::signal& GetSignalOnForeground();
-extern boost::signals2::signal& GetSignalOnNetworkChange();
+extern boost::signals2::signal& GetSignalOnCreate();
+extern boost::signals2::signal& GetSignalOnInitBeforeOnCreate();
+extern boost::signals2::signal&
+GetSignalOnInitBeforeOnCreateV2();
+extern boost::signals2::signal& GetSignalOnDestroy();
+extern boost::signals2::signal& GetSignalOnSingalCrash();
+extern boost::signals2::signal& GetSignalOnExceptionCrash();
+extern boost::signals2::signal& GetSignalOnForeground();
+extern boost::signals2::signal& GetSignalOnNetworkChange();
-extern boost::signals2::signal& GetSignalOnNetworkDataChange();
+extern boost::signals2::signal& GetSignalOnNetworkDataChange();
+extern boost::signals2::signal& GetSignalOnAlarm();
#endif /* BASEPRJEVENT_H_ */
diff --git a/mars/baseevent/compiler_util.h b/mars/baseevent/compiler_util.h
new file mode 100644
index 000000000..5646dae9f
--- /dev/null
+++ b/mars/baseevent/compiler_util.h
@@ -0,0 +1,33 @@
+// Tencent is pleased to support the open source community by making Mars available.
+// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
+
+// Licensed under the MIT License (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://opensource.org/licenses/MIT
+
+// Unless required by applicable law or agreed to in writing, software distributed under the License is
+// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+// either express or implied. See the License for the specific language governing permissions and
+// limitations under the License.
+
+/*
+ * compiler_util.h
+ *
+ * Created on: 2017-3-28
+ * Author: jehoochen
+ */
+
+#ifndef BASEEVENT_COMPILER_UTIL_H_
+#define BASEEVENT_COMPILER_UTIL_H_
+
+#if defined(_MSC_VER) && defined(MARS_USE_DLLS)
+#ifdef MARS_BASEEVENT_EXPORTS
+#define MARS_BASEEVENT_EXPORT __declspec(dllexport)
+#else
+#define MARS_BASEEVENT_EXPORT __declspec(dllimport)
+#endif
+#else
+#define MARS_BASEEVENT_EXPORT
+#endif
+
+#endif /* BASEEVENT_COMPILER_UTIL_H_ */
diff --git a/mars/baseevent/jni/Android.mk b/mars/baseevent/jni/Android.mk
deleted file mode 100644
index 00f6dd7d6..000000000
--- a/mars/baseevent/jni/Android.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-LOCAL_PATH :=$(call my-dir)
-include $(LOCAL_PATH)/../../mk_template/android_template.mk
\ No newline at end of file
diff --git a/mars/baseevent/jni/Application.mk b/mars/baseevent/jni/Application.mk
deleted file mode 100644
index cdda64028..000000000
--- a/mars/baseevent/jni/Application.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-APP_LOCAL_PATH :=$(call my-dir)
-include $(APP_LOCAL_PATH)/../../mk_template/application_template.mk
\ No newline at end of file
diff --git a/mars/baseevent/jni/build.conf b/mars/baseevent/jni/build.conf
deleted file mode 100644
index 4cae3a948..000000000
--- a/mars/baseevent/jni/build.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMP_LOCAL_PATH :=$(call my-dir)
-
-SELF_BUILD_CMD := BUILD_STATIC_LIBRARY
-SELF_LOCAL_MODULE := baseevent
-
-SELF_LOCAL_EXPORT_C_INCLUDES := $(TEMP_LOCAL_PATH)/../../
-
-SELF_LOCAL_IMPORT_LIBRARIES_PATH += $(TEMP_LOCAL_PATH)/../../comm/jni/export.mk
\ No newline at end of file
diff --git a/mars/baseevent/jni/com_tencent_mars_BaseEvent.cc b/mars/baseevent/jni/com_tencent_mars_BaseEvent.cc
index 604b53d35..753f9d1dc 100644
--- a/mars/baseevent/jni/com_tencent_mars_BaseEvent.cc
+++ b/mars/baseevent/jni/com_tencent_mars_BaseEvent.cc
@@ -1,7 +1,7 @@
// Tencent is pleased to support the open source community by making Mars available.
// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-// Licensed under the MIT License (the "License"); you may not use this file except in
+// Licensed under the MIT License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://opensource.org/licenses/MIT
@@ -10,80 +10,85 @@
// either express or implied. See the License for the specific language governing permissions and
// limitations under the License.
-/**
- * created on : 2012-07-19
- * author : yanguoyue
- */
-
-#include
-#include
-
-#include "comm/jni/util/scoped_jstring.h"
-
-#include "mars/baseevent/base_logic.h"
-#include "mars/baseevent/baseevent.h"
-
-//DEFINE_FIND_CLASS(KBaseEventJava2C, "com/tencent/mars/BaseEvent");
-
-namespace mars {
-namespace baseevent {
-
- std::vector* getLoadModuleVec(){
- static std::vector sg_modules;
- return &sg_modules;
- }
-
- void addLoadModule(std::string _module_name) {
- getLoadModuleVec()->push_back(_module_name);
- }
-
- jobject getLoadLibraries(JNIEnv *_env) {
- jclass list_cls = _env->FindClass("java/util/ArrayList");
- jmethodID list_costruct = _env->GetMethodID(list_cls, "", "()V");
- jobject list_obj = _env->NewObject(list_cls , list_costruct);
-
- jmethodID list_add = _env->GetMethodID(list_cls, "add", "(Ljava/lang/Object;)Z");
-
- for(std::vector::iterator iter = getLoadModuleVec()->begin(); iter != getLoadModuleVec()->end(); ++iter){
- _env->CallBooleanMethod(list_obj , list_add , ScopedJstring(_env, (*iter).c_str()).GetJstr());
- }
-
- return list_obj;
- }
-}
-}
-
-extern "C" {
-
-JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onCreate(JNIEnv* env, jclass)
-{
- mars::baseevent::OnCreate();
-}
-
-JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onDestroy(JNIEnv* env, jclass)
-{
- mars::baseevent::OnDestroy();
-}
-
-JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onForeground (JNIEnv *, jclass, jboolean _isforeground)
-{
- mars::baseevent::OnForeground(_isforeground);
-}
-
-JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onNetworkChange (JNIEnv *, jclass)
-{
- mars::baseevent::OnNetworkChange();
-}
-
-JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onSingalCrash(JNIEnv *, jclass, jint _sig){
- mars::baseevent::OnSingalCrash((int)_sig);
-}
-
-JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onExceptionCrash(JNIEnv*, jclass){
- mars::baseevent::OnExceptionCrash();
-}
-
-}
-
-void ExportBaseEvent() {
-}
+/**
+ * created on : 2012-07-19
+ * author : yanguoyue
+ */
+
+#include
+#include
+
+#include "comm/jni/util/scoped_jstring.h"
+#include "mars/baseevent/base_logic.h"
+#include "mars/baseevent/baseevent.h"
+
+// DEFINE_FIND_CLASS(KBaseEventJava2C, "com/tencent/mars/BaseEvent");
+
+namespace mars {
+namespace baseevent {
+
+std::vector* getLoadModuleVec() {
+ static std::vector sg_modules;
+ return &sg_modules;
+}
+
+void addLoadModule(std::string _module_name) {
+ getLoadModuleVec()->push_back(_module_name);
+}
+
+jobject getLoadLibraries(JNIEnv* _env) {
+ jclass list_cls = _env->FindClass("java/util/ArrayList");
+ jmethodID list_costruct = _env->GetMethodID(list_cls, "", "()V");
+ jobject list_obj = _env->NewObject(list_cls, list_costruct);
+
+ jmethodID list_add = _env->GetMethodID(list_cls, "add", "(Ljava/lang/Object;)Z");
+
+ for (std::vector::iterator iter = getLoadModuleVec()->begin(); iter != getLoadModuleVec()->end();
+ ++iter) {
+ _env->CallBooleanMethod(list_obj, list_add, ScopedJstring(_env, (*iter).c_str()).GetJstr());
+ }
+
+ return list_obj;
+}
+} // namespace baseevent
+} // namespace mars
+
+extern "C" {
+
+JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onCreate(JNIEnv* env, jclass) {
+ mars::baseevent::OnCreate();
+}
+
+JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onInitConfigBeforeOnCreate(JNIEnv* env,
+ jclass,
+ jint _packer_encoder_version) {
+ mars::baseevent::OnInitBeforeOnCreate(_packer_encoder_version);
+}
+
+JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onDestroy(JNIEnv* env, jclass) {
+ mars::baseevent::OnDestroy();
+}
+
+JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onForeground(JNIEnv*, jclass, jboolean _isforeground) {
+ mars::baseevent::OnForeground(_isforeground);
+}
+
+JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onNetworkChange(JNIEnv*, jclass) {
+ mars::baseevent::OnNetworkChange();
+}
+
+JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onSingalCrash(JNIEnv*, jclass, jint _sig) {
+ mars::baseevent::OnSingalCrash((int)_sig);
+}
+
+JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onExceptionCrash(JNIEnv*, jclass) {
+ mars::baseevent::OnExceptionCrash();
+}
+
+JNIEXPORT void JNICALL Java_com_tencent_mars_comm_Alarm_onAlarm(JNIEnv* env, jclass, jlong _id) {
+ mars::baseevent::OnAlarm((int64_t)_id);
+}
+}
+
+void ExportBaseEvent() {
+}
diff --git a/mars/baseevent/jni/export.mk b/mars/baseevent/jni/export.mk
deleted file mode 100644
index c59b7a960..000000000
--- a/mars/baseevent/jni/export.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-EXPORT_LOCAL_PATH := $(call my-dir)
-SELF_LOCAL_EXPORT_C_INCLUDES:=
-SELF_LOCAL_EXPORT_SRC_FILES :=
-SELF_LOCAL_EXPORT_LDLIBS :=
-include $(EXPORT_LOCAL_PATH)/../../mk_template/export_template.mk
\ No newline at end of file
diff --git a/mars/baseevent/jni/import.mk b/mars/baseevent/jni/import.mk
deleted file mode 100644
index 22ef0a8e0..000000000
--- a/mars/baseevent/jni/import.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-IMPORT_LOCAL_PATH := $(call my-dir)
-SELF_LOCAL_IMPORT_LIBRARIES_PATH :=
-include $(IMPORT_LOCAL_PATH)/../../mk_template/import_template.mk
\ No newline at end of file
diff --git a/mars/baseevent/jni/sources.mk b/mars/baseevent/jni/sources.mk
deleted file mode 100644
index 7e182315f..000000000
--- a/mars/baseevent/jni/sources.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMP_LOCAL_PATH :=$(call my-dir)
-
-include $(TEMP_LOCAL_PATH)/../../mk_template/flags.mk
-
-SRC := $(wildcard $(TEMP_LOCAL_PATH)/../*.cc)
-SRC := $(SRC:$(LOCAL_PATH)/%=%)
-LOCAL_SRC_FILES += $(SRC)
-
-SRC := $(wildcard $(TEMP_LOCAL_PATH)/../src/*.cc)
-SRC := $(SRC:$(LOCAL_PATH)/%=%)
-LOCAL_SRC_FILES += $(SRC)
-
-SRC := $(wildcard $(TEMP_LOCAL_PATH)/*.cc)
-SRC := $(SRC:$(LOCAL_PATH)/%=%)
-LOCAL_SRC_FILES += $(SRC)
-
-LOCAL_C_INCLUDES += $(TEMP_LOCAL_PATH)/../ $(TEMP_LOCAL_PATH)/../src $(TEMP_LOCAL_PATH)/../../ $(TEMP_LOCAL_PATH)/../../../
diff --git a/mars/baseevent/src/active_logic.cc b/mars/baseevent/src/active_logic.cc
index 9d434240b..1defeb02c 100644
--- a/mars/baseevent/src/active_logic.cc
+++ b/mars/baseevent/src/active_logic.cc
@@ -1,7 +1,7 @@
// Tencent is pleased to support the open source community by making Mars available.
// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-// Licensed under the MIT License (the "License"); you may not use this file except in
+// Licensed under the MIT License (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://opensource.org/licenses/MIT
@@ -10,126 +10,153 @@
// either express or implied. See the License for the specific language governing permissions and
// limitations under the License.
-/*
- * active_logic.cc
- *
- * Created on: 2012-8-22
- * Author: yerungui
- */
-
-#include "boost/bind.hpp"
-
-#include "mars/baseevent/active_logic.h"
-#include "mars/baseevent/baseprjevent.h"
-#include "mars/comm/singleton.h"
-#include "mars/comm/xlogger/xlogger.h"
-#include "mars/comm/thread/lock.h"
-#include "mars/comm/time_utils.h"
-#include "mars/comm/bootrun.h"
-#include "mars/comm/messagequeue/message_queue.h"
-
-static void onForeground(bool _isforeground) {
- SINGLETON_STRONG(ActiveLogic)->OnForeground(_isforeground);
-}
-
-static void __initbind_baseprjevent() {
- GetSignalOnForeground().connect(&onForeground);
-}
-
-BOOT_RUN_STARTUP(__initbind_baseprjevent);
-
-#ifdef ANDROID
-#define INACTIVE_TIMEOUT (10*60*1000) //ms
-#elif defined Q_OS_BLACKBERRY
-#define INACTIVE_TIMEOUT (10*60*1000) //ms
-#elif defined _WIN32
-#define INACTIVE_TIMEOUT (10*60*1000) //ms
-#else
-#define INACTIVE_TIMEOUT (10*60*1000) //ms
-#endif
-
-
-ActiveLogic::ActiveLogic()
-: isforeground_(false), isactive_(true)
-, alarm_(boost::bind(&ActiveLogic::__OnInActive, this), false)
-, lastforegroundchangetime_(::gettickcount())
-{
- xinfo_function();
-#ifndef __APPLE__
- if (!alarm_.Start(INACTIVE_TIMEOUT))
- {
- xerror2(TSF"m_alarm.Start false");
- }
-#endif
-}
-
-ActiveLogic::~ActiveLogic()
-{
- xinfo_function();
- MessageQueue::CancelMessage(MessageQueue::DefAsyncInvokeHandler(MessageQueue::GetDefMessageQueue()), (MessageQueue::MessageTitle_t)this);
- MessageQueue::WaitForRuningLockEnd(MessageQueue::DefAsyncInvokeHandler(MessageQueue::GetDefMessageQueue()));
-}
-
-void ActiveLogic::OnForeground(bool _isforeground)
-{
- if (MessageQueue::GetDefMessageQueue()!=MessageQueue::CurrentThreadMessageQueue())
- {
- MessageQueue::AsyncInvoke(boost::bind(&ActiveLogic::OnForeground, this, _isforeground), (MessageQueue::MessageTitle_t)this, mq::DefAsyncInvokeHandler(mq::GetDefMessageQueue()));
- return;
- }
-
- xgroup2_define(group);
- xinfo2(TSF"OnForeground:%0, change:%1, ", _isforeground, _isforeground!=isforeground_) >> group;
-
- if (_isforeground == isforeground_) return;
-
- bool oldisactive = isactive_;
- isactive_ = true;
- isforeground_ = _isforeground;
- lastforegroundchangetime_ = ::gettickcount();
- alarm_.Cancel();
-
- if (!isforeground_)
- {
-#ifndef __APPLE__
- if (!alarm_.Start(INACTIVE_TIMEOUT))
- {
- xerror2(TSF"m_alarm.Start false") >> group;
- }
-#endif
- }
-
- bool isnotify = oldisactive!=isactive_;
- SignalForeground(isforeground_);
-
- if (isnotify)
- {
- xinfo2(TSF"active change:%0", isactive_) >> group;
- SignalActive(isactive_);
- }
-}
-
-bool ActiveLogic::IsActive() const
-{
- return isactive_;
-}
-
-bool ActiveLogic::IsForeground() const
-{
- return isforeground_;
-}
-
-uint64_t ActiveLogic::LastForegroundChangeTime() const
-{
- return lastforegroundchangetime_;
-}
-
-void ActiveLogic::__OnInActive()
-{
- xdebug_function();
- if (!isforeground_) isactive_ = false;
-
- bool isactive = isactive_;
- xinfo2(TSF"active change:%0", isactive_);
- SignalActive(isactive);
-}
+/*
+ * active_logic.cc
+ *
+ * Created on: 2012-8-22
+ * Author: yerungui
+ */
+
+#include "mars/baseevent/active_logic.h"
+
+#include "boost/bind.hpp"
+#include "mars/baseevent/baseprjevent.h"
+#include "mars/comm/bootrun.h"
+#include "mars/comm/messagequeue/message_queue.h"
+#include "mars/comm/singleton.h"
+#include "mars/comm/thread/lock.h"
+#include "mars/comm/thread/mutex.h"
+#include "mars/comm/time_utils.h"
+#include "mars/comm/xlogger/xlogger.h"
+
+namespace mars {
+namespace comm {
+
+static void onForeground(bool _isforeground) {
+ ActiveLogic::Instance()->OnForeground(_isforeground);
+}
+
+static void __initbind_baseprjevent() {
+ GetSignalOnForeground().connect(&onForeground);
+}
+
+BOOT_RUN_STARTUP(__initbind_baseprjevent);
+
+#define INACTIVE_TIMEOUT (10 * 60 * 1000) // ms
+
+#ifdef ANDROID
+static void onAlarm(int64_t id) {
+ Alarm::onAlarmImpl(id);
+}
+static const int kAlarmType = 100;
+#endif
+
+std::shared_ptr ActiveLogic::inst_ = nullptr;
+std::shared_ptr ActiveLogic::Instance() {
+ static Mutex mtx;
+ if (!inst_) {
+ ScopedLock lock(mtx);
+ if (!inst_) {
+ inst_ = std::make_shared();
+ }
+ }
+
+ return inst_;
+}
+
+void ActiveLogic::Release() {
+ inst_ = nullptr;
+}
+
+ActiveLogic::ActiveLogic()
+: isforeground_(false)
+, isactive_(true)
+, alarm_(boost::bind(&ActiveLogic::__OnInActive, this), false)
+, lastforegroundchangetime_(::gettickcount()) {
+ xinfo_function(TSF "MQ:%_, this:%_", MessageQueue::GetDefMessageQueue(), this);
+
+#ifdef __ANDROID__
+ GetSignalOnAlarm().connect(&onAlarm);
+ alarm_.SetType(kAlarmType);
+#endif
+#ifndef __APPLE__
+ if (!alarm_.Start(INACTIVE_TIMEOUT)) {
+ xerror2(TSF "m_alarm.Start false");
+ }
+#endif
+}
+
+ActiveLogic::~ActiveLogic() {
+ xinfo_function();
+ MessageQueue::CancelMessage(MessageQueue::DefAsyncInvokeHandler(MessageQueue::GetDefMessageQueue()),
+ (MessageQueue::MessageTitle_t)this);
+ MessageQueue::WaitForRunningLockEnd(MessageQueue::DefAsyncInvokeHandler(MessageQueue::GetDefMessageQueue()));
+}
+
+void ActiveLogic::OnForeground(bool _isforeground) {
+ if (MessageQueue::GetDefMessageQueue() != MessageQueue::CurrentThreadMessageQueue()) {
+ MessageQueue::AsyncInvoke(boost::bind(&ActiveLogic::OnForeground, this, _isforeground),
+ (MessageQueue::MessageTitle_t)this,
+ mq::DefAsyncInvokeHandler(mq::GetDefMessageQueue()),
+ "ActiveLogic::OnForeground");
+ return;
+ }
+
+ xgroup2_define(group);
+ xinfo2(TSF "OnForeground:%0, change:%1, this:%2", _isforeground, _isforeground != isforeground_, this) >> group;
+
+ if (_isforeground == isforeground_)
+ return;
+
+ bool oldisactive = isactive_;
+ isactive_ = true;
+ isforeground_ = _isforeground;
+ lastforegroundchangetime_ = ::gettickcount();
+ alarm_.Cancel();
+
+ if (!isforeground_) {
+#ifndef __APPLE__
+ if (!alarm_.Start(INACTIVE_TIMEOUT)) {
+ xerror2(TSF "m_alarm.Start false") >> group;
+ }
+#endif
+ }
+
+ bool isnotify = oldisactive != isactive_;
+ SignalForeground(isforeground_);
+
+ if (isnotify) {
+ xinfo2(TSF "active change:%0", isactive_) >> group;
+ SignalActive(isactive_);
+ }
+}
+
+bool ActiveLogic::IsActive() const {
+ return isactive_;
+}
+
+bool ActiveLogic::IsForeground() const {
+ return isforeground_;
+}
+
+uint64_t ActiveLogic::LastForegroundChangeTime() const {
+ return lastforegroundchangetime_;
+}
+
+void ActiveLogic::__OnInActive() {
+ xdebug_function();
+ if (!isforeground_)
+ isactive_ = false;
+
+ bool isactive = isactive_;
+ xinfo2(TSF "active change:%0", isactive_);
+ SignalActive(isactive);
+}
+
+void ActiveLogic::SwitchActiveStateForDebug(bool _active) {
+ isactive_ = _active;
+ __OnInActive();
+}
+
+} // namespace comm
+} // namespace mars
\ No newline at end of file
diff --git a/mars/baseevent/src/baseprj.cc b/mars/baseevent/src/baseprj.cc
index 332b7bca3..4a601d315 100644
--- a/mars/baseevent/src/baseprj.cc
+++ b/mars/baseevent/src/baseprj.cc
@@ -1,15 +1,15 @@
-// Tencent is pleased to support the open source community by making Mars available.
-// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-
-// Licensed under the MIT License (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://opensource.org/licenses/MIT
-
-// Unless required by applicable law or agreed to in writing, software distributed under the License is
-// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
-// either express or implied. See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Tencent is pleased to support the open source community by making Mars available.
+// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
+
+// Licensed under the MIT License (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://opensource.org/licenses/MIT
+
+// Unless required by applicable law or agreed to in writing, software distributed under the License is
+// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+// either express or implied. See the License for the specific language governing permissions and
+// limitations under the License.
+
/*
* baseprj.cpp
*
@@ -17,43 +17,62 @@
* Author: yerungui
*/
+#include "mars/baseevent/base_logic.h"
#include "mars/baseevent/baseprjevent.h"
-
-#include "mars/comm/compiler_util.h"
#include "mars/comm/bootregister.h"
+#include "mars/comm/platform_comm.h"
+#include "mars/comm/thread/lock.h"
+#include "mars/comm/time_utils.h"
+
+using namespace mars::comm;
+
+namespace mars {
+namespace baseevent {
+
+void OnCreate() {
+ GetSignalOnCreate()();
+}
+
+void OnInitBeforeOnCreate(int _encoder_status) {
+ GetSignalOnInitBeforeOnCreate()(_encoder_status);
+}
+
+void OnInitBeforeOnCreateV2(int _encoder_status, std::string _encoder_name) {
+ GetSignalOnInitBeforeOnCreateV2()(_encoder_status, _encoder_name);
+}
-namespace mars{
- namespace baseevent{
-
- void OnCreate()
- {
- GetSignalOnCreate()();
- }
-
- void OnDestroy()
- {
- GetSignalOnDestroy()();
- }
-
- void OnSingalCrash(int _sig)
- {
- GetSignalOnSingalCrash()(_sig);
- }
-
- void OnExceptionCrash()
- {
- GetSignalOnExceptionCrash()();
- }
-
- void OnForeground(bool _isforeground)
- {
- GetSignalOnForeground()(_isforeground);
- }
-
- void OnNetworkChange()
- {
- GetSignalOnNetworkChange()();
- }
- }
+void OnDestroy() {
+ GetSignalOnDestroy()();
}
+void OnSingalCrash(int _sig) {
+ GetSignalOnSingalCrash()(_sig);
+}
+
+void OnExceptionCrash() {
+ GetSignalOnExceptionCrash()();
+}
+
+void OnForeground(bool _isforeground) {
+ GetSignalOnForeground()(_isforeground);
+}
+
+void OnNetworkChange() {
+#ifdef __APPLE__
+ FlushReachability();
+#endif
+ OnPlatformNetworkChange();
+ GetSignalOnNetworkChange()();
+}
+
+void OnNetworkDataChange(const char* _tag, int32_t _send, int32_t _recv) {
+ GetSignalOnNetworkDataChange()(_tag, _send, _recv);
+}
+
+#ifdef ANDROID
+void OnAlarm(int64_t _id) {
+ GetSignalOnAlarm()(_id);
+}
+#endif
+} // namespace baseevent
+} // namespace mars
diff --git a/mars/baseevent/src/baseprjevent.cc b/mars/baseevent/src/baseprjevent.cc
index 35292c50e..49420ba88 100644
--- a/mars/baseevent/src/baseprjevent.cc
+++ b/mars/baseevent/src/baseprjevent.cc
@@ -1,15 +1,15 @@
-// Tencent is pleased to support the open source community by making Mars available.
-// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
-
-// Licensed under the MIT License (the "License"); you may not use this file except in
-// compliance with the License. You may obtain a copy of the License at
-// http://opensource.org/licenses/MIT
-
-// Unless required by applicable law or agreed to in writing, software distributed under the License is
-// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
-// either express or implied. See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Tencent is pleased to support the open source community by making Mars available.
+// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
+
+// Licensed under the MIT License (the "License"); you may not use this file except in
+// compliance with the License. You may obtain a copy of the License at
+// http://opensource.org/licenses/MIT
+
+// Unless required by applicable law or agreed to in writing, software distributed under the License is
+// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+// either express or implied. See the License for the specific language governing permissions and
+// limitations under the License.
+
/*
* baseprjevent.cpp
*
@@ -19,44 +19,52 @@
#include "mars/baseevent/baseprjevent.h"
-boost::signals2::signal& GetSignalOnCreate()
-{
- static boost::signals2::signal SignalOnCreate;
- return SignalOnCreate;
+boost::signals2::signal& GetSignalOnCreate() {
+ static boost::signals2::signal SignalOnCreate;
+ return SignalOnCreate;
+}
+
+boost::signals2::signal& GetSignalOnInitBeforeOnCreate() {
+ static boost::signals2::signal SignalOnInitBeforeOnCreate;
+ return SignalOnInitBeforeOnCreate;
}
-boost::signals2::signal& GetSignalOnDestroy()
-{
- static boost::signals2::signal SignalOnDestroy;
- return SignalOnDestroy;
+boost::signals2::signal& GetSignalOnInitBeforeOnCreateV2() {
+ static boost::signals2::signal SignalOnInitBeforeOnCreateV2;
+ return SignalOnInitBeforeOnCreateV2;
}
-boost::signals2::signal& GetSignalOnSingalCrash()
-{
- static boost::signals2::signal SignalOnSingalCrash;
- return SignalOnSingalCrash;
+boost::signals2::signal& GetSignalOnDestroy() {
+ static boost::signals2::signal SignalOnDestroy;
+ return SignalOnDestroy;
}
-boost::signals2::signal& GetSignalOnExceptionCrash()
-{
- static boost::signals2::signal SignalOnExceptionCrash;
- return SignalOnExceptionCrash;
+boost::signals2::signal& GetSignalOnSingalCrash() {
+ static boost::signals2::signal SignalOnSingalCrash;
+ return SignalOnSingalCrash;
}
-boost::signals2::signal& GetSignalOnForeground()
-{
- static boost::signals2::signal SignalOnForeground;
- return SignalOnForeground;
+boost::signals2::signal& GetSignalOnExceptionCrash() {
+ static boost::signals2::signal SignalOnExceptionCrash;
+ return SignalOnExceptionCrash;
}
-boost::signals2::signal& GetSignalOnNetworkChange()
-{
- static boost::signals2::signal SignalOnNetworkChange;
- return SignalOnNetworkChange;
+boost::signals2::signal& GetSignalOnForeground() {
+ static boost::signals2::signal SignalOnForeground;
+ return SignalOnForeground;
}
+boost::signals2::signal& GetSignalOnNetworkChange() {
+ static boost::signals2::signal SignalOnNetworkChange;
+ return SignalOnNetworkChange;
+}
-boost::signals2::signal& GetSignalOnNetworkDataChange() {
- static boost::signals2::signal SignalOnNetworkDataChange;
+boost::signals2::signal& GetSignalOnNetworkDataChange() {
+ static boost::signals2::signal SignalOnNetworkDataChange;
return SignalOnNetworkDataChange;
}
+
+boost::signals2::signal& GetSignalOnAlarm() {
+ static boost::signals2::signal SignalOnAlarm;
+ return SignalOnAlarm;
+}
diff --git a/mars/baseevent/win32proj/baseevent.vcxproj b/mars/baseevent/win32proj/baseevent.vcxproj
deleted file mode 100644
index 3d463b0c0..000000000
--- a/mars/baseevent/win32proj/baseevent.vcxproj
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
-
- {198E58C9-A8AE-49B2-85CF-FCF9349502B1}
- Win32Proj
- baseevent
- 8.1
-
-
-
- StaticLibrary
- true
- v140
- Unicode
-
-
- StaticLibrary
- false
- v120_xp
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
- $(SolutionDir)/../;$(SolutionDir)/../../;$(SolutionDir)/../comm/;$(SolutionDir)/../comm/windows;$(SolutionDir)/../comm/windows/zlib;$(ProjectDir)/../src;$(IncludePath)
-
-
- $(SolutionDir)/../;$(SolutionDir)/../../;$(SolutionDir)/../comm/;$(SolutionDir)/../comm/windows;$(SolutionDir)/../comm/windows/zlib;$(ProjectDir)/../src;$(IncludePath)
-
-
-
-
-
- TurnOffAllWarnings
- Disabled
- WIN32;_DEBUG;_LIB;NOMINMAX;%(PreprocessorDefinitions)
- mars/comm/projdef.h
-
-
- Windows
- true
-
-
-
-
- TurnOffAllWarnings
-
-
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_LIB;NOMINMAX;%(PreprocessorDefinitions)
- mars/comm/projdef.h
- OldStyle
-
-
- Windows
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mars/baseevent/win32proj/baseevent.vcxproj.filters b/mars/baseevent/win32proj/baseevent.vcxproj.filters
deleted file mode 100644
index 98ee16870..000000000
--- a/mars/baseevent/win32proj/baseevent.vcxproj.filters
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hh;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/mars/baseevent/win32proj/baseevent.vcxproj.user b/mars/baseevent/win32proj/baseevent.vcxproj.user
deleted file mode 100644
index ef5ff2a1f..000000000
--- a/mars/baseevent/win32proj/baseevent.vcxproj.user
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/mars/boost/CMakeLists.txt b/mars/boost/CMakeLists.txt
new file mode 100644
index 000000000..50b88fe09
--- /dev/null
+++ b/mars/boost/CMakeLists.txt
@@ -0,0 +1,86 @@
+cmake_minimum_required (VERSION 3.6)
+
+set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE)
+message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
+add_compile_options(-w) # 屏蔽所有编译警告
+
+project (mars-boost)
+
+include(../comm/utils.cmake)
+
+include_directories(.)
+include_directories(..)
+
+add_definitions(-DBOOST_NO_EXCEPTIONS)
+
+set(SELF_SRC_FILES
+ libs/atomic/src/lockpool.cpp
+ libs/date_time/src/gregorian/date_generators.cpp
+ libs/date_time/src/gregorian/gregorian_types.cpp
+ libs/date_time/src/gregorian/greg_month.cpp
+ libs/date_time/src/gregorian/greg_weekday.cpp
+ libs/date_time/src/posix_time/posix_time_types.cpp
+ libs/exception/src/clone_current_exception_non_intrusive.cpp
+ libs/filesystem/src/codecvt_error_category.cpp
+ libs/filesystem/src/operations.cpp
+ libs/filesystem/src/path.cpp
+ libs/filesystem/src/path_traits.cpp
+ libs/filesystem/src/portability.cpp
+ libs/filesystem/src/unique_path.cpp
+ libs/filesystem/src/utf8_codecvt_facet.cpp
+ libs/filesystem/src/windows_file_codecvt.cpp
+ libs/iostreams/src/file_descriptor.cpp
+ libs/iostreams/src/mapped_file.cpp
+ libs/smart_ptr/src/sp_collector.cpp
+ libs/smart_ptr/src/sp_debug_hooks.cpp
+ libs/system/src/error_code.cpp
+ libs/thread/src/future.cpp)
+
+
+if(MSVC)
+ include_directories(../comm/windows)
+ list(APPEND SELF_SRC_FILES
+ libs/thread/src/win32/thread.cpp
+ libs/thread/src/win32/tss_dll.cpp
+ libs/thread/src/win32/tss_pe.cpp)
+
+endif()
+
+if(ANDROID)
+ file(GLOB SELF_ANDROID_SRC_FILE
+ libs/coroutine/src/*.cpp
+ libs/coroutine/src/detail/*.cpp
+ libs/coroutine/src/posix/*.cpp
+ libs/context/src/*.cpp
+ libs/context/src/posix/*.cpp)
+
+ list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILE})
+ enable_language(ASM)
+
+ if(ANDROID_ABI MATCHES "^armeabi(-v7a)?$")
+ list(APPEND SELF_SRC_FILES
+ libs/context/src/asm/jump_arm_aapcs_elf_gas.S
+ libs/context/src/asm/make_arm_aapcs_elf_gas.S)
+ elseif(ANDROID_ABI STREQUAL arm64-v8a)
+ list(APPEND SELF_SRC_FILES
+ libs/context/src/asm/jump_arm64_aapcs_elf_gas.S
+ libs/context/src/asm/make_arm64_aapcs_elf_gas.S)
+ elseif(ANDROID_ABI STREQUAL x86)
+ list(APPEND SELF_SRC_FILES
+ libs/context/src/asm/jump_i386_sysv_elf_gas.S
+ libs/context/src/asm/make_i386_sysv_elf_gas.S)
+ elseif(ANDROID_ABI STREQUAL x86_64)
+ list(APPEND SELF_SRC_FILES
+ libs/context/src/asm/jump_x86_64_sysv_elf_gas.S
+ libs/context/src/asm/make_x86_64_sysv_elf_gas.S)
+ endif()
+
+endif()
+
+
+add_library(${PROJECT_NAME} STATIC ${SELF_SRC_FILES})
+
+install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${CMAKE_SYSTEM_NAME}.out)
+
+
+
diff --git a/mars/boost/boost.vcxproj b/mars/boost/boost.vcxproj
deleted file mode 100644
index 2353c2ec9..000000000
--- a/mars/boost/boost.vcxproj
+++ /dev/null
@@ -1,2331 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
- {0F71334B-8B28-4106-A8A5-9E4F46B195EE}
- boost
- 8.1
-
-
-
- Application
- true
- v140
- MultiByte
-
-
- Application
- false
- v140
- true
- MultiByte
-
-
- Application
- true
- v140
- MultiByte
-
-
- Application
- false
- v140
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(VC_IncludePath);$(WindowsSDK_IncludePath);$(ProjectDir)../;$(ProjectDir)../comm/windows/
-
-
-
- Level3
- Disabled
- true
-
-
-
-
- Level3
- Disabled
- true
-
-
-
-
- Level3
- MaxSpeed
- true
- true
- true
-
-
- true
- true
-
-
-
-
- Level3
- MaxSpeed
- true
- true
- true
-
-
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/mars/boost/boost.vcxproj.filters b/mars/boost/boost.vcxproj.filters
index 40add43cb..fcd8b282f 100644
--- a/mars/boost/boost.vcxproj.filters
+++ b/mars/boost/boost.vcxproj.filters
@@ -6635,9 +6635,6 @@
源文件
-
- 源文件
-
源文件
@@ -6647,5 +6644,8 @@
源文件
+
+ 源文件
+
\ No newline at end of file
diff --git a/mars/boost/boost.vcxproj.user b/mars/boost/boost.vcxproj.user
deleted file mode 100644
index abe8dd896..000000000
--- a/mars/boost/boost.vcxproj.user
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/mars/boost/boost_stdexcept b/mars/boost/boost_stdexcept
index 0ad2482eb..e72fc833f 100644
--- a/mars/boost/boost_stdexcept
+++ b/mars/boost/boost_stdexcept
@@ -5,7 +5,7 @@
#include
#include
-
+/*
namespace std
{
@@ -55,5 +55,5 @@ namespace std
};
-}
+} */
#endif
diff --git a/mars/boost/config/user.hpp b/mars/boost/config/user.hpp
index 8362b2ccb..d10c1d94f 100644
--- a/mars/boost/config/user.hpp
+++ b/mars/boost/config/user.hpp
@@ -143,3 +143,9 @@
#ifdef ANDROID //only for android stlport
#include "boost/boost_stdexcept"
#endif
+
+#ifdef WIN32
+ #ifdef BOOST_HAS_GETTIMEOFDAY
+ # undef BOOST_HAS_GETTIMEOFDAY
+ #endif
+#endif
diff --git a/mars/boost/coroutine/standard_stack_allocator.hpp b/mars/boost/coroutine/standard_stack_allocator.hpp
index 43cc21738..bdebc845b 100644
--- a/mars/boost/coroutine/standard_stack_allocator.hpp
+++ b/mars/boost/coroutine/standard_stack_allocator.hpp
@@ -17,7 +17,7 @@
#include
#include
-
+#include
#include
#include
#include
@@ -40,7 +40,7 @@ struct basic_standard_stack_allocator
BOOST_ASSERT( traits_type::is_unbounded() || ( traits_type::maximum_size() >= size) );
void * limit = std::malloc( size);
- if ( ! limit) mars_boost::throw_exception(std::bad_alloc());//throw std::bad_alloc();
+ if (!limit) mars_boost::throw_exception(std::bad_alloc());//throw std::bad_alloc();
ctx.size = size;
ctx.sp = static_cast< char * >( limit) + ctx.size;
@@ -60,7 +60,7 @@ struct basic_standard_stack_allocator
#endif
void * limit = static_cast< char * >( ctx.sp) - ctx.size;
- std::free( limit);
+ std::free(limit);
}
};
diff --git a/mars/boost/exception/detail/clone_current_exception.hpp b/mars/boost/exception/detail/clone_current_exception.hpp
index e40576f8a..ef60e4ce9 100644
--- a/mars/boost/exception/detail/clone_current_exception.hpp
+++ b/mars/boost/exception/detail/clone_current_exception.hpp
@@ -13,7 +13,7 @@
#endif
#ifdef BOOST_NO_EXCEPTIONS
-# error This header requires exception handling to be enabled.
+//# error This header requires exception handling to be enabled.
#endif
namespace mars_boost {} namespace boost = mars_boost; namespace
diff --git a/mars/boost/iostreams/detail/ios.hpp b/mars/boost/iostreams/detail/ios.hpp
index 18ed6304b..8fa73ab83 100644
--- a/mars/boost/iostreams/detail/ios.hpp
+++ b/mars/boost/iostreams/detail/ios.hpp
@@ -47,8 +47,8 @@ namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { nam
class failure : public std::exception {
public:
explicit failure(const std::string& what_arg) : what_(what_arg) { }
- virtual ~failure()_GABIXX_NOEXCEPT {}
- virtual const char* what() const _GABIXX_NOEXCEPT{ return what_.c_str(); };
+ virtual ~failure() {}
+ virtual const char* what() const throw() { return what_.c_str(); };
private:
std::string what_;
};
diff --git a/mars/boost/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S b/mars/boost/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S
index 35dcc7415..30f0a51d9 100644
--- a/mars/boost/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S
+++ b/mars/boost/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S
@@ -37,7 +37,7 @@
* *
*******************************************************/
-#if defined(__arm64__)
+#if defined(__aarch64__)
.cpu generic+fp+simd
.text
.align 2
diff --git a/mars/boost/libs/context/src/asm/make_arm64_aapcs_elf_gas.S b/mars/boost/libs/context/src/asm/make_arm64_aapcs_elf_gas.S
index b64ab94be..ddb236f6e 100644
--- a/mars/boost/libs/context/src/asm/make_arm64_aapcs_elf_gas.S
+++ b/mars/boost/libs/context/src/asm/make_arm64_aapcs_elf_gas.S
@@ -37,7 +37,7 @@
* *
*******************************************************/
-#if defined(__arm64__)
+#if defined(__aarch64__)
.cpu generic+fp+simd
.text
.align 2
diff --git a/mars/boost/libs/exception/src/clone_current_exception_non_intrusive.cpp b/mars/boost/libs/exception/src/clone_current_exception_non_intrusive.cpp
index 7c600c8df..8b58e5970 100644
--- a/mars/boost/libs/exception/src/clone_current_exception_non_intrusive.cpp
+++ b/mars/boost/libs/exception/src/clone_current_exception_non_intrusive.cpp
@@ -7,7 +7,7 @@
//Based on an exception_ptr implementation by Anthony Williams.
#ifdef BOOST_NO_EXCEPTIONS
-#error This file requires exception handling to be enabled.
+//#error This file requires exception handling to be enabled.
#endif
#include
diff --git a/mars/boost/libs/filesystem/src/operations.cpp b/mars/boost/libs/filesystem/src/operations.cpp
index 11726f81f..6b0874a32 100644
--- a/mars/boost/libs/filesystem/src/operations.cpp
+++ b/mars/boost/libs/filesystem/src/operations.cpp
@@ -10,7 +10,9 @@
//--------------------------------------------------------------------------------------//
-// define 64-bit offset macros BEFORE including boost/config.hpp (see ticket #5355)
+// define 64-bit offset macros BEFORE including boost/config.hpp (see ticket #5355)
+// Google Android NDK is broken though as it doesn't provide truncate() declaration when _FILE_OFFSET_BITS=64 is defined (https://github.com/boostorg/filesystem/issues/65)
+#if !defined(__ANDROID__) || (__ANDROID_API__+0) >= 21 || defined(__CRYSTAX__)
#if !(defined(__HP_aCC) && defined(_ILP32) && !defined(_STATVFS_ACPP_PROBLEMS_FIXED))
#define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect,
#endif
@@ -28,6 +30,7 @@
#else
#define _FILE_OFFSET_BITS 64
#endif
+#endif // !defined(__ANDROID__) || (__ANDROID_API__+0) >= 21 || defined(__CRYSTAX__)
// define BOOST_FILESYSTEM_SOURCE so that knows
// the library is being built (possibly exporting rather than importing code)
@@ -44,7 +47,8 @@
#include
#include
#include
-#include
+#include
+#include
#include // for malloc, free
#include
#include // for remove, rename
@@ -1593,6 +1597,12 @@ namespace detail
BOOST_FILESYSTEM_DECL
void resize_file(const path& p, uintmax_t size, system::error_code* ec)
{
+# if defined(BOOST_POSIX_API)
+ if (BOOST_UNLIKELY(size > static_cast< uintmax_t >((std::numeric_limits< off_t >::max)()))) {
+ error(system::errc::file_too_large, p, ec, "mars_boost::filesystem::resize_file");
+ return;
+ }
+# endif
error(!BOOST_RESIZE_FILE(p.c_str(), size) ? BOOST_ERRNO : 0, p, ec,
"mars_boost::filesystem::resize_file");
}
@@ -2060,8 +2070,7 @@ namespace
inline int readdir_r_simulator(DIR * dirp, struct dirent * entry,
struct dirent ** result)// *result set to 0 on end of directory
{
- errno = 0;
-
+
# if !defined(__CYGWIN__)\
&& defined(_POSIX_THREAD_SAFE_FUNCTIONS)\
&& defined(_SC_THREAD_SAFE_FUNCTIONS)\
@@ -2074,6 +2083,7 @@ namespace
struct dirent * p;
*result = 0;
+ errno = 0;
if ((p = ::readdir(dirp))== 0)
return errno;
std::strcpy(entry->d_name, p->d_name);
diff --git a/mars/boost/libs/iostreams/src/mapped_file.cpp b/mars/boost/libs/iostreams/src/mapped_file.cpp
index 54a0de15c..5b456c546 100644
--- a/mars/boost/libs/iostreams/src/mapped_file.cpp
+++ b/mars/boost/libs/iostreams/src/mapped_file.cpp
@@ -416,8 +416,10 @@ void mapped_file_impl::try_map_file(param_type p)
0,
0,
NULL );
- if (mapped_handle_ == NULL)
- cleanup_and_throw("failed create mapping");
+ if (mapped_handle_ == NULL) { // modified by Tencent garryyan 2018.05.17
+ cleanup_and_throw("failed create mapping");
+ return;
+ }
// Access data
DWORD access = priv ?
diff --git a/mars/boost/libs/thread/src/win32/thread.cpp b/mars/boost/libs/thread/src/win32/thread.cpp
index 4888237a5..f0850cdc9 100644
--- a/mars/boost/libs/thread/src/win32/thread.cpp
+++ b/mars/boost/libs/thread/src/win32/thread.cpp
@@ -63,7 +63,9 @@ namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost
for (async_states_t::iterator i = async_states_.begin(), e = async_states_.end();
i != e; ++i)
{
+#ifndef BOOST_NO_EXCEPTIONS
(*i)->make_ready();
+#endif
}
}
}
diff --git a/mars/boost/predef/other/endian.h b/mars/boost/predef/other/endian.h
index 1faf32c9a..bcc284799 100644
--- a/mars/boost/predef/other/endian.h
+++ b/mars/boost/predef/other/endian.h
@@ -69,19 +69,36 @@ information and acquired knowledge:
# endif
# endif
# endif
-# if defined(__BYTE_ORDER)
-# if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN)
-# undef BOOST_ENDIAN_BIG_BYTE
-# define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
-# endif
-# if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN)
-# undef BOOST_ENDIAN_LITTLE_BYTE
-# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
-# endif
-# if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN)
-# undef BOOST_ENDIAN_LITTLE_WORD
-# define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE
-# endif
+# ifdef WIN32
+# if defined(__BYTE_ORDER)
+# if defined(__BIG_ENDIAN) && __BYTE_ORDER == __BIG_ENDIAN
+# undef BOOST_ENDIAN_BIG_BYTE
+# define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN
+# undef BOOST_ENDIAN_LITTLE_BYTE
+# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(__PDP_ENDIAN) && __BYTE_ORDER == __PDP_ENDIAN
+# undef BOOST_ENDIAN_LITTLE_WORD
+# define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# endif
+# else
+# if defined(__BYTE_ORDER)
+# if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN)
+# undef BOOST_ENDIAN_BIG_BYTE
+# define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN)
+# undef BOOST_ENDIAN_LITTLE_BYTE
+# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN)
+# undef BOOST_ENDIAN_LITTLE_WORD
+# define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE
+# endif
+# endif
# endif
# if !defined(__BYTE_ORDER) && defined(_BYTE_ORDER)
# if defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN)
diff --git a/mars/boost/uuid/uuid_io.hpp b/mars/boost/uuid/uuid_io.hpp
new file mode 100644
index 000000000..6c4be4706
--- /dev/null
+++ b/mars/boost/uuid/uuid_io.hpp
@@ -0,0 +1,198 @@
+// Boost uuid_io.hpp header file ----------------------------------------------//
+
+// Copyright 2009 Andy Tompkins.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Revision History
+// 20 Mar 2009 - Initial Revision
+// 28 Nov 2009 - disabled deprecated warnings for MSVC
+
+#ifndef BOOST_UUID_IO_HPP
+#define BOOST_UUID_IO_HPP
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#if defined(_MSC_VER)
+#pragma warning(push) // Save warning settings.
+#pragma warning(disable : 4996) // Disable deprecated std::ctype::widen, std::copy
+#endif
+
+namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
+ namespace uuids {
+
+template
+ std::basic_ostream& operator<<(std::basic_ostream &os, uuid const& u)
+{
+ io::ios_flags_saver flags_saver(os);
+ io::basic_ios_fill_saver fill_saver(os);
+
+ const typename std::basic_ostream::sentry ok(os);
+ if (ok) {
+ const std::streamsize width = os.width(0);
+ const std::streamsize uuid_width = 36;
+ const std::ios_base::fmtflags flags = os.flags();
+ const typename std::basic_ios::char_type fill = os.fill();
+ if (flags & (std::ios_base::right | std::ios_base::internal)) {
+ for (std::streamsize i=uuid_width; i(*i_data);
+ if (i == 3 || i == 5 || i == 7 || i == 9) {
+ os << os.widen('-');
+ }
+ }
+
+ if (flags & std::ios_base::left) {
+ for (std::streamsize s=uuid_width; s
+ std::basic_istream& operator>>(std::basic_istream &is, uuid &u)
+{
+ const typename std::basic_istream::sentry ok(is);
+ if (ok) {
+ unsigned char data[16];
+
+ typedef std::ctype ctype_t;
+ ctype_t const& ctype = std::use_facet(is.getloc());
+
+ ch xdigits[16];
+ {
+ char szdigits[] = "0123456789ABCDEF";
+ ctype.widen(szdigits, szdigits+16, xdigits);
+ }
+ ch*const xdigits_end = xdigits+16;
+
+ ch c;
+ for (std::size_t i=0; i> c;
+ c = ctype.toupper(c);
+
+ ch* f = std::find(xdigits, xdigits_end, c);
+ if (f == xdigits_end) {
+ is.setstate(std::ios_base::failbit);
+ break;
+ }
+
+ unsigned char byte = static_cast