I spent a good part of today trying to port the expresso logic heuristic to windows/visual studios so that I can link it as a static library. Github Link (I spent a good part of yesterday trying to find a version that works on windows that's not just a exe so I can link it to my c++ code before giving up and trying to implement it myself)
Most of my effort was fixing all the link errors and editing a NodeJS bridge for it so that I can (somewhat easily) link it as a static library with a "minimize_from_data" function however a lot of my "porting" was pretty hamfisted and I simply disabled some functions that were POSIX only.
Now that I've gotten it to compile I'm trying to go back over and make sure it's not buggy before I use it safely in some personal projects (I don't fully trust that I ported it correctly). One of the functions I "disabled" was a sys/resource function that sets the RLIMIT_CPU to some seconds value functioning as what I can understand a timeout function that kills the program If it takes too long. copying here
void set_time_limit(int seconds){
#ifndef _WIN32
struct rlimit rlp_st, *rlp = &rlp_st;
rlp->rlim_cur = seconds;
setrlimit(RLIMIT_CPU, rlp);
#endif
}
Is there any way to replace this functionality in windows? Currently, I've set all the expresso source code to compile as c (/TC
/Za
in VS) however as my final environment is linking it to C++ a C++ method that I can extern "C"
into the c code works just as well. (I know tagging both c and c++ is frowned upon)
The closest relevant question I found was about stack size using strlimit
EDIT: was a non-issue in my case. Leaving a potential solution for the future