mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 13:23:25 +03:00
Portability and include fixes.
Add <cstdlib> include for srand()/rand(), and <unistd.h> for open() etc. Include <unistd.h> on Windows if using MinGW. Disable MeteorScorer on Windows, since it doesn't have fork() and pipe().
This commit is contained in:
parent
0698da8b0f
commit
8a3ae2fd5c
@ -13,6 +13,8 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "util/unistd.hh"
|
||||
|
||||
#if defined(__GLIBCXX__) || defined(__GLIBCPP__)
|
||||
#include <ext/stdio_filebuf.h>
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "ScoreStats.h"
|
||||
#include "Util.h"
|
||||
#include "util/unistd.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -25,7 +26,7 @@ namespace MosesTuning
|
||||
{
|
||||
|
||||
// Meteor supported
|
||||
#if defined(__GLIBCXX__) || defined(__GLIBCPP__)
|
||||
#if (defined(__GLIBCXX__) || defined(__GLIBCPP__)) && !defined(_WIN32)
|
||||
|
||||
// for clarity
|
||||
#define CHILD_STDIN_READ pipefds_input[0]
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef UTIL_UNISTD_H
|
||||
#define UTIL_UNISTD_H
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
|
||||
|
||||
// Windows doesn't define <unistd.h>
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user