Windows fixes

This commit is contained in:
Jack Andersen 2016-05-29 08:45:31 -10:00
parent 494a39e76a
commit c287173bab
3 changed files with 14 additions and 4 deletions

View File

@ -62,7 +62,7 @@ set(HEADERS
unset(EXTRAS) unset(EXTRAS)
if(TARGET boo) if(TARGET boo)
include_directories(${BOO_INCLUDE_DIR} ${BOO_INCLUDE_DIR}/../lib ${BOO_INCLUDE_DIR}/../soxr/src include_directories(${BOO_INCLUDE_DIR} ${BOO_INCLUDE_DIR}/../lib ${BOO_INCLUDE_DIR}/../soxr/src
${LOGVISOR_INCLUDE_DIR} ${ATHENA_INCLUDE_DIR}) ${LOGVISOR_INCLUDE_DIR} ${ATHENA_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
list(APPEND EXTRAS lib/BooBackend.cpp include/amuse/BooBackend.hpp) list(APPEND EXTRAS lib/BooBackend.cpp include/amuse/BooBackend.hpp)
endif() endif()

View File

@ -568,13 +568,20 @@ struct AppCallback : boo::IApplicationCallback
if (m_argc < 2) if (m_argc < 2)
Log.report(logvisor::Fatal, "needs group path argument"); Log.report(logvisor::Fatal, "needs group path argument");
amuse::ContainerRegistry::Type cType = amuse::ContainerRegistry::DetectContainerType(m_argv[1]); #if _WIN32
char utf8Path[1024];
WideCharToMultiByte(CP_UTF8, 0, m_argv[1], -1, utf8Path, 1024, nullptr, nullptr);
#else
const char* utf8Path = m_argv[1];
#endif
amuse::ContainerRegistry::Type cType = amuse::ContainerRegistry::DetectContainerType(utf8Path);
if (cType == amuse::ContainerRegistry::Type::Invalid) if (cType == amuse::ContainerRegistry::Type::Invalid)
Log.report(logvisor::Fatal, "invalid/no data at path argument"); Log.report(logvisor::Fatal, "invalid/no data at path argument");
Log.report(logvisor::Info, "Found '%s' Audio Group data", amuse::ContainerRegistry::TypeToName(cType)); Log.report(logvisor::Info, "Found '%s' Audio Group data", amuse::ContainerRegistry::TypeToName(cType));
std::vector<std::pair<std::string, amuse::IntrusiveAudioGroupData>> data = std::vector<std::pair<std::string, amuse::IntrusiveAudioGroupData>> data =
amuse::ContainerRegistry::LoadContainer(m_argv[1]); amuse::ContainerRegistry::LoadContainer(utf8Path);
if (data.empty()) if (data.empty())
Log.report(logvisor::Fatal, "invalid/no data at path argument"); Log.report(logvisor::Fatal, "invalid/no data at path argument");

View File

@ -4,9 +4,12 @@
#include <algorithm> #include <algorithm>
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <strings.h>
#include <stdint.h> #include <stdint.h>
#ifndef _MSC_VER
#include <strings.h>
#endif
namespace amuse namespace amuse
{ {