Skip to content
Snippets Groups Projects
Commit 0b384d2a authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Get working in visual studio

parent ec560ae9
Branches
Tags
No related merge requests found
Pipeline #10424 passed
......@@ -75,6 +75,7 @@ bool ftl::is_video(const string &file) {
bool ftl::create_directory(const std::string &path) {
#ifdef WIN32
// TODO(nick)
return false;
#else
if (!is_directory(path)) {
int err = ::mkdir(path.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
......@@ -167,7 +168,11 @@ static map<string, string> read_options(char ***argv, int *argc) {
opts[cmd.substr(2)] = "true";
} else {
auto val = cmd.substr(p+1);
#ifdef WIN32
if ((val[0] >= 48 && val[0] <= 57) || val == "true" || val == "false" || val == "null") {
#else
if (std::isdigit(val[0]) || val == "true" || val == "false" || val == "null") {
#endif
opts[cmd.substr(2, p-2)] = val;
} else {
if (val[0] == '\\') opts[cmd.substr(2, p-2)] = val;
......
#ifndef _FTL_NET_PEER_HPP_
#define _FTL_NET_PEER_HPP_
#ifndef NOMINMAX
#define NOMINMAX
#endif
#ifndef WIN32
#define INVALID_SOCKET -1
#include <netinet/in.h>
......
#ifndef _FTL_NET_UNIVERSE_HPP_
#define _FTL_NET_UNIVERSE_HPP_
#ifdef _MSC_VER
#include <msgpack_optional.hpp>
#endif
#include <ftl/net/peer.hpp>
#include <ftl/net/listener.hpp>
#include <ftl/net/dispatcher.hpp>
......
......@@ -2,6 +2,10 @@
#include <glog/logging.h>
#include <ctpl_stl.h>
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <fcntl.h>
#ifdef WIN32
#include <winsock2.h>
......@@ -9,6 +13,11 @@
#include <windows.h>
#endif
#ifdef WIN32
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "Rpcrt4.lib")
#endif
#include <ftl/uri.hpp>
#include <ftl/net/peer.hpp>
#include <ftl/net/ws_internal.hpp>
......
#include <ftl/uri.hpp>
using ftl::URI;
using ftl::uri_t;
using std::string;
URI::URI(uri_t puri) {
......
......@@ -7,7 +7,7 @@
#include <glog/logging.h>
#include <ftl/configuration.hpp>
#include <ctpl_stl.h>
#include <zlib.h>
// #include <zlib.h>
#include <string>
#include <map>
......
......@@ -10,6 +10,7 @@ using cv::Size;
using std::string;
using std::min;
using std::max;
using std::isnan;
static void skip_comment(FILE *fp) {
// skip comment lines in the headers of pnm files
......@@ -195,7 +196,7 @@ void ftl::middlebury::evaldisp(const Mat &disp, const Mat &gtdisp, const Mat &ma
if (gt == INFINITY) // unknown
continue;
float d = scale * disp.at<float>(y / scale, x / scale, 0);
int valid = (!isnanf(d) && d < 256.0f); // NOTE: Is meant to be infinity in middlebury
int valid = (!isnan(d) && d < 256.0f); // NOTE: Is meant to be infinity in middlebury
if (valid) {
float maxd = scale * maxdisp; // max disp range
d = max(0.0f, min(maxd, d)); // clip disps to max disp range
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment