Skip to content

Commit

Permalink
Funapi 플러그인: Win32 환경에서 rapidjson _GNUC_ 정의 되지않은 컴파일러 경고 제거
Browse files Browse the repository at this point in the history
Win32 환경에서 rapidjson 파일이 컴파일 될때 C4668 error 가 발생한다.

코드에서 각 컴파일러 및 아키텍쳐를 확인하는 부분에서 발생하는 에러로
에러가 발생하는 biginteger.h, diyfp.h 파일에만 경고를 무시하는 컴파일러 옵션을 넣는다.

Change-Id: Ibf42b779d6fc4e61c67680b9685baa48ec32d417
  • Loading branch information
SungjinB committed Sep 5, 2019
1 parent 4ab8156 commit a402938
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Plugins/Funapi/Funapi.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion" : 3,
"Version" : 1,
"VersionName" : "1.153",
"VersionName" : "1.154",
"FriendlyName" : "Funapi Plugin",
"Description" : "Funapi Plugin UE4",
"Category" : "iFunFactory",
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Funapi/Source/Funapi/Private/funapi_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace fun {
enum class FunapiVersion : int
{
kProtocolVersion = 1,
kPluginVersion = 153,
kPluginVersion = 154,
};

}
Expand Down
25 changes: 18 additions & 7 deletions Plugins/Funapi/ThirdParty/include/rapidjson/internal/biginteger.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Tencent is pleased to support the open source community by making RapidJSON available.
//
//
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 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
// 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.

#ifndef RAPIDJSON_BIGINTEGER_H_
Expand All @@ -21,6 +21,12 @@
#include <intrin.h> // for _umul128
#endif

// NOTE(Sungjin): Window 32 bit 환경에서 에러를 방지한다.
#if defined(_MSC_VER) && !defined(_M_AMD64)
#pragma warning( push )
#pragma warning( disable : 4668 )
#endif

RAPIDJSON_NAMESPACE_BEGIN
namespace internal {

Expand Down Expand Up @@ -52,7 +58,7 @@ class BigInteger {
}

BigInteger& operator=(uint64_t u) {
digits_[0] = u;
digits_[0] = u;
count_ = 1;
return *this;
}
Expand Down Expand Up @@ -85,7 +91,7 @@ class BigInteger {
digits_[i] = MulAdd64(digits_[i], u, k, &hi);
k = hi;
}

if (k > 0)
PushBack(k);

Expand All @@ -108,7 +114,7 @@ class BigInteger {
digits_[i] = (p0 & 0xFFFFFFFF) | (p1 << 32);
k = p1 >> 32;
}

if (k > 0)
PushBack(k);

Expand Down Expand Up @@ -277,4 +283,9 @@ class BigInteger {
} // namespace internal
RAPIDJSON_NAMESPACE_END

// NOTE(Sungjin): Window 32 bit 환경에서 에러를 방지한다.
#if defined(_MSC_VER) && !defined(_M_AMD64)
#pragma warning( pop )
#endif

#endif // RAPIDJSON_BIGINTEGER_H_
25 changes: 18 additions & 7 deletions Plugins/Funapi/ThirdParty/include/rapidjson/internal/diyfp.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Tencent is pleased to support the open source community by making RapidJSON available.
//
//
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 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
// 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.

// This is a C++ header-only implementation of Grisu2 algorithm from the publication:
Expand All @@ -26,6 +26,12 @@
#pragma intrinsic(_BitScanReverse64)
#endif

// NOTE(Sungjin): Window 32 bit 환경에서 에러를 방지한다.
#if defined(_MSC_VER) && !defined(_M_AMD64)
#pragma warning( push )
#pragma warning( disable : 4668 )
#endif

RAPIDJSON_NAMESPACE_BEGIN
namespace internal {

Expand All @@ -50,7 +56,7 @@ struct DiyFp {
if (biased_e != 0) {
f = significand + kDpHiddenBit;
e = biased_e - kDpExponentBias;
}
}
else {
f = significand;
e = kDpMinExponent + 1;
Expand Down Expand Up @@ -135,7 +141,7 @@ struct DiyFp {
double d;
uint64_t u64;
}u;
const uint64_t be = (e == kDpDenormalExponent && (f & kDpHiddenBit) == 0) ? 0 :
const uint64_t be = (e == kDpDenormalExponent && (f & kDpHiddenBit) == 0) ? 0 :
static_cast<uint64_t>(e + kDpExponentBias);
u.u64 = (f & kDpSignificandMask) | (be << kDpSignificandSize);
return u.d;
Expand Down Expand Up @@ -216,7 +222,7 @@ inline DiyFp GetCachedPowerByIndex(size_t index) {
};
return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]);
}

inline DiyFp GetCachedPower(int e, int* K) {

//int k = static_cast<int>(ceil((-61 - e) * 0.30102999566398114)) + 374;
Expand Down Expand Up @@ -244,4 +250,9 @@ RAPIDJSON_DIAG_POP
} // namespace internal
RAPIDJSON_NAMESPACE_END

// NOTE(Sungjin): Window 32 bit 환경에서 에러를 방지한다.
#if defined(_MSC_VER) && !defined(_M_AMD64)
#pragma warning( pop )
#endif

#endif // RAPIDJSON_DIYFP_H_

0 comments on commit a402938

Please sign in to comment.