diff --git a/third_party/mspack.lua b/third_party/mspack.lua index 85b6bc08f..c1d1b44a5 100644 --- a/third_party/mspack.lua +++ b/third_party/mspack.lua @@ -2,8 +2,10 @@ group("third_party") project("mspack") uuid("0881692A-75A1-4E7B-87D8-BB9108CEDEA4") kind("StaticLib") - language("C") - + language("C++") + links({ + "xenia-base", + }) defines({ "_LIB", "HAVE_CONFIG_H", @@ -16,6 +18,7 @@ project("mspack") "mspack", }) files({ + "mspack/logging.cc", "mspack/lzx.h", "mspack/lzxd.c", "mspack/mspack.h", diff --git a/third_party/mspack/logging.cc b/third_party/mspack/logging.cc new file mode 100644 index 000000000..ae70478d0 --- /dev/null +++ b/third_party/mspack/logging.cc @@ -0,0 +1,10 @@ +#include "xenia/base/logging.h" + +extern "C" void xenia_log(const char* fmt, ...) { + char buffer[128]; + va_list args; + va_start(args, fmt); + vsnprintf(buffer, sizeof(buffer), fmt, args); + va_end(args); + XELOGW("mspack: %s", buffer); +} diff --git a/third_party/mspack/lzxd.c b/third_party/mspack/lzxd.c index 6cc33df08..548366409 100644 --- a/third_party/mspack/lzxd.c +++ b/third_party/mspack/lzxd.c @@ -15,6 +15,11 @@ #include #include +extern void xenia_log(const char*, ...); + +#undef D +#define D(x) do { xenia_log x; } while (0); + /* Microsoft's LZX document (in cab-sdk.exe) and their implementation * of the com.ms.util.cab Java package do not concur. *