Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile on MacOS (Sierra) #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.8)
project(fbx-writer)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++17 -lstdc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++1z -lstdc++")

find_package( ZLIB REQUIRED )

Expand Down
8 changes: 5 additions & 3 deletions src/fbxproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ FBXProperty::FBXProperty(std::ifstream &input)
uint8_t compressedBuffer[compressedLength];
reader.read((char*)compressedBuffer, compressedLength);

uint64_t destLen = uncompressedLength;
uint64_t srcLen = compressedLength;
uncompress2(decompressedBuffer, &destLen, compressedBuffer, &srcLen);
auto destLen = static_cast<unsigned long>(uncompressedLength);
auto srcLen = static_cast<unsigned long>(compressedLength);
uncompress(decompressedBuffer, &destLen, compressedBuffer, srcLen);

if(srcLen != compressedLength) throw std::string("compressedLength does not match data");
if(destLen != uncompressedLength) throw std::string("uncompressedLength does not match data");
Expand Down Expand Up @@ -263,6 +263,8 @@ string FBXProperty::to_string()
string s("\"");
for(uint8_t c : raw) {
if(c == '\\') s += "\\\\";
else if(c == '"') s += "\\\"";
else if(c == '\n') s += "\\\\n";
else if(c >= 32 && c <= 126) s += c;
else s = s + "\\u00" + base16Number(c);
}
Expand Down