Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 08f41c0

Browse files
committed
fix android compile error
1 parent 012c2fb commit 08f41c0

File tree

5 files changed

+28
-18
lines changed

5 files changed

+28
-18
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Release Version](https://img.shields.io/badge/release-1.1.3-red.svg)](https://github.com/Tencent/mars/releases)
55
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/mars/pulls)
66
[![WeChat Approved](https://img.shields.io/badge/Wechat_Approved-1.1.3-red.svg)](https://github.com/Tencent/mars/wiki)
7+
[![WeChat Approved](https://img.shields.io/badge/Platform-iOS | OS X | Android -brightgreen.svg)](https://github.com/Tencent/mars/wiki)
78

89
(中文版本请参看[这里](#mars_cn))
910

mars/libraries/mars_android_sdk/jni/longlink_packer.cc

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
// Tencent is pleased to support the open source community by making Mars available.
2+
// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
3+
4+
// Licensed under the MIT License (the "License"); you may not use this file except in
5+
// compliance with the License. You may obtain a copy of the License at
6+
// http://opensource.org/licenses/MIT
7+
8+
// Unless required by applicable law or agreed to in writing, software distributed under the License is
9+
// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
10+
// either express or implied. See the License for the specific language governing permissions and
11+
// limitations under the License.
12+
113

214
/*
315
* longlink_packer.cc
@@ -17,11 +29,10 @@
1729
#include "comm/socket/unix_socket.h"
1830
#endif
1931

20-
static uint16_t sg_client_version = 0;
32+
static uint32_t sg_client_version = 0;
2133

2234
#pragma pack(push, 1)
23-
struct __STNetMsgXpHeader
24-
{
35+
struct __STNetMsgXpHeader {
2536
uint32_t head_length;
2637
uint32_t client_version;
2738
uint32_t cmdid;
@@ -38,8 +49,7 @@ namespace stn {
3849
}
3950
}
4051

41-
static int __unpack_test(const void* _packed, size_t _packed_len, uint32_t& _cmdid, uint32_t& _seq, size_t& _package_len, size_t& _body_len)
42-
{
52+
static int __unpack_test(const void* _packed, size_t _packed_len, uint32_t& _cmdid, uint32_t& _seq, size_t& _package_len, size_t& _body_len) {
4353
__STNetMsgXpHeader st = {0};
4454
if (_packed_len < sizeof(__STNetMsgXpHeader)) {
4555
_package_len = 0;
@@ -68,7 +78,6 @@ static int __unpack_test(const void* _packed, size_t _packed_len, uint32_t& _cmd
6878
}
6979

7080
void longlink_pack(uint32_t _cmdid, uint32_t _seq, const void* _raw, size_t _raw_len, AutoBuffer& _packed) {
71-
7281
__STNetMsgXpHeader st = {0};
7382
st.head_length = htonl(sizeof(__STNetMsgXpHeader));
7483
st.client_version = htonl(sg_client_version);
@@ -106,3 +115,5 @@ uint32_t longlink_noop_resp_cmdid() {return NOOP_CMDID;}
106115
uint32_t signal_keep_cmdid() {return SIGNALKEEP_CMDID;}
107116
void longlink_noop_req_body(AutoBuffer& _body) {}
108117
void longlink_noop_resp_body(AutoBuffer& _body) {}
118+
119+
bool longlink_complexconnect_need_verify() { return false; }

mars/libraries/mars_android_sdk/jni/longlink_packer.cc.rewriteme

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
static uint32_t sg_client_version = 0;
3333

3434
#pragma pack(push, 1)
35-
struct __STNetMsgXpHeader
36-
{
35+
struct __STNetMsgXpHeader {
3736
uint32_t head_length;
3837
uint32_t client_version;
3938
uint32_t cmdid;
@@ -50,8 +49,7 @@ namespace stn {
5049
}
5150
}
5251

53-
static int __unpack_test(const void* _packed, size_t _packed_len, uint32_t& _cmdid, uint32_t& _seq, size_t& _package_len, size_t& _body_len)
54-
{
52+
static int __unpack_test(const void* _packed, size_t _packed_len, uint32_t& _cmdid, uint32_t& _seq, size_t& _package_len, size_t& _body_len) {
5553
__STNetMsgXpHeader st = {0};
5654
if (_packed_len < sizeof(__STNetMsgXpHeader)) {
5755
_package_len = 0;
@@ -79,8 +77,7 @@ static int __unpack_test(const void* _packed, size_t _packed_len, uint32_t& _cmd
7977
return LONGLINK_UNPACK_OK;
8078
}
8179

82-
void longlink_pack(uint32_t _cmdid, uint32_t _seq, const void* _raw, size_t _raw_len, AutoBuffer& _packed)
83-
{
80+
void longlink_pack(uint32_t _cmdid, uint32_t _seq, const void* _raw, size_t _raw_len, AutoBuffer& _packed) {
8481
__STNetMsgXpHeader st = {0};
8582
st.head_length = htonl(sizeof(__STNetMsgXpHeader));
8683
st.client_version = htonl(sg_client_version);
@@ -118,3 +115,5 @@ uint32_t longlink_noop_resp_cmdid() {return NOOP_CMDID;}
118115
uint32_t signal_keep_cmdid() {return SIGNALKEEP_CMDID;}
119116
void longlink_noop_req_body(AutoBuffer& _body) {}
120117
void longlink_noop_resp_body(AutoBuffer& _body) {}
118+
119+
bool longlink_complexconnect_need_verify() { return false; }

mars/libraries/mars_android_sdk/jni/longlink_packer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ uint32_t signal_keep_cmdid();
4343
void longlink_noop_req_body(AutoBuffer& _body);
4444
void longlink_noop_resp_body(AutoBuffer& _body);
4545

46+
bool longlink_complexconnect_need_verify();
47+
4648
#endif // STN_SRC_LONGLINKPACKER_H_

mars/stn/proto/longlink_packer.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
static uint32_t sg_client_version = 0;
3333

3434
#pragma pack(push, 1)
35-
struct __STNetMsgXpHeader
36-
{
35+
struct __STNetMsgXpHeader {
3736
uint32_t head_length;
3837
uint32_t client_version;
3938
uint32_t cmdid;
@@ -50,8 +49,7 @@ namespace stn {
5049
}
5150
}
5251

53-
static int __unpack_test(const void* _packed, size_t _packed_len, uint32_t& _cmdid, uint32_t& _seq, size_t& _package_len, size_t& _body_len)
54-
{
52+
static int __unpack_test(const void* _packed, size_t _packed_len, uint32_t& _cmdid, uint32_t& _seq, size_t& _package_len, size_t& _body_len) {
5553
__STNetMsgXpHeader st = {0};
5654
if (_packed_len < sizeof(__STNetMsgXpHeader)) {
5755
_package_len = 0;
@@ -79,8 +77,7 @@ static int __unpack_test(const void* _packed, size_t _packed_len, uint32_t& _cmd
7977
return LONGLINK_UNPACK_OK;
8078
}
8179

82-
void longlink_pack(uint32_t _cmdid, uint32_t _seq, const void* _raw, size_t _raw_len, AutoBuffer& _packed)
83-
{
80+
void longlink_pack(uint32_t _cmdid, uint32_t _seq, const void* _raw, size_t _raw_len, AutoBuffer& _packed) {
8481
__STNetMsgXpHeader st = {0};
8582
st.head_length = htonl(sizeof(__STNetMsgXpHeader));
8683
st.client_version = htonl(sg_client_version);

0 commit comments

Comments
 (0)