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

Fix (cross) build for Mingw-w64 #511

Merged
merged 2 commits into from
Nov 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion ccstruct/imagedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
#include "helpers.h"
#include "tprintf.h"

#include <thread>
#if defined(__MINGW32__)
# include <unistd.h>
#else
# include <thread>
#endif

// Number of documents to read ahead while training. Doesn't need to be very
// large.
Expand Down Expand Up @@ -449,7 +453,11 @@ const ImageData* DocumentData::GetPage(int index) {
if (needs_loading) LoadPageInBackground(index);
// We can't directly load the page, or the background load will delete it
// while the caller is using it, so give it a chance to work.
#if defined(__MINGW32__)
sleep(1);
#else
std::this_thread::sleep_for(std::chrono::seconds(1));
#endif
}
return page;
}
Expand Down
2 changes: 2 additions & 0 deletions ccutil/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

#define DLLSYM
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif /* NOMINMAX */
#define WIN32_LEAN_AND_MEAN
#ifdef __GNUC__
#define ultoa _ultoa
Expand Down