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

- misc.cpp : Androidビルド向けの修正 #194

Closed
wants to merge 1 commit into from
Closed
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
15 changes: 10 additions & 5 deletions source/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ extern "C" {
#include <sys/mman.h> // madvise()
#endif

#if defined(__APPLE__) || defined(__ANDROID__) || defined(__OpenBSD__) || (defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC) && !defined(_WIN32)) || defined(__e2k__)
#define POSIXALIGNEDALLOC
#include <stdlib.h>
#endif

#include "misc.h"
#include "thread.h"
#include "usi.h"
Expand Down Expand Up @@ -166,7 +171,7 @@ const string engine_info() {
#undef TOSTRING
#else
ENGINE_NAME
#endif
#endif
<< ' '
<< EVAL_TYPE_NAME << ' '
<< ENGINE_VERSION << std::setfill('0')
Expand Down Expand Up @@ -491,7 +496,7 @@ void* aligned_large_pages_alloc(size_t allocSize , size_t align /* ignore */) {

#else

void* aligned_large_pages_alloc(size_t allocSize) {
void* aligned_large_pages_alloc(size_t allocSize , size_t align /* ignore */) {

#if defined(__linux__)
constexpr size_t alignment = 2 * 1024 * 1024; // assumed 2MB page size
Expand Down Expand Up @@ -919,7 +924,7 @@ namespace Tools
buffer, // マップ先ワイド文字列を入れるバッファのアドレス
length // バッファのサイズ
);

if (result == 0)
return std::wstring(); // 何故かエラーなのだ…。

Expand Down Expand Up @@ -1505,7 +1510,7 @@ namespace StringExtension

// 数字に相当する文字か
bool is_number(char c) { return '0' <= c && c <= '9'; }

// 行の末尾の"\r","\n",スペース、"\t"を除去した文字列を返す。
std::string trim(const std::string& input)
{
Expand Down Expand Up @@ -1737,7 +1742,7 @@ namespace Directory {
}
}

#elif defined(__GNUC__)
#elif defined(__GNUC__)

#include <direct.h>
namespace Directory {
Expand Down