mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-30 12:11:15 -06:00
WIP: Moved sources int src/, separated most of the source code from Perl.
The XS was left only for the unit / integration tests, and it links libslic3r only. No wxWidgets are allowed to be used from Perl starting from now.
This commit is contained in:
parent
3ddaccb641
commit
0558b53493
1706 changed files with 7413 additions and 7638 deletions
|
|
@ -1,44 +0,0 @@
|
|||
#include "unistd.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
int usleep(unsigned usec)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(usec));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// SO: https://stackoverflow.com/questions/10905892/equivalent-of-gettimeday-for-windows
|
||||
int gettimeofday(struct timeval *tp, struct timezone *tzp)
|
||||
{
|
||||
// Note: some broken versions only have 8 trailing zero's, the correct epoch has 9 trailing zero's
|
||||
// This magic number is the number of 100 nanosecond intervals since January 1, 1601 (UTC)
|
||||
// until 00:00:00 January 1, 1970
|
||||
static const std::uint64_t EPOCH = ((std::uint64_t) 116444736000000000ULL);
|
||||
|
||||
SYSTEMTIME system_time;
|
||||
FILETIME file_time;
|
||||
std::uint64_t time;
|
||||
|
||||
GetSystemTime(&system_time);
|
||||
SystemTimeToFileTime(&system_time, &file_time);
|
||||
time = ((std::uint64_t)file_time.dwLowDateTime);
|
||||
time += ((std::uint64_t)file_time.dwHighDateTime) << 32;
|
||||
|
||||
tp->tv_sec = (long)((time - EPOCH) / 10000000L);
|
||||
tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue