9#if QT_VERSION >= QT_VERSION_CHECK(6,5,0)
10#include <QtSystemDetection>
15# define S_IREAD S_IRUSR
18# define S_IWRITE S_IRUSR
24# include <sys/resource.h>
25# include <sys/socket.h>
28# define close wsock_close
63#define nice(x) ((int)!::SetPriorityClass(\
64 ::GetCurrentProcess(), ((x) < -10) ? \
65 HIGH_PRIORITY_CLASS : (((x) < 0) ? \
66 ABOVE_NORMAL_PRIORITY_CLASS : (((x) > 10) ? \
67 IDLE_PRIORITY_CLASS : (((x) > 0) ? \
68 BELOW_NORMAL_PRIORITY_CLASS : \
69 NORMAL_PRIORITY_CLASS)))))
71#define setpriority(x, y, z) ((x) == PRIO_PROCESS && y == 0 ? nice(z) : -1)
89 #define mkfifo(path, mode) \
90 (CreateNamedPipeA(path, PIPE_ACCESS_DUPLEX | WRITE_DAC, \
91 PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, \
92 1024, 1024, 10000, nullptr) == INVALID_HANDLE_VALUE ? -1 : 0)
95# define dlopen(x, y) LoadLibraryA((x))
96# define dlclose(x) !FreeLibrary((HMODULE)(x))
97# define dlsym(x, y) GetProcAddress((HMODULE)(x), (y))
102 #define DLERR_MAX 512
104 DWORD errCode = GetLastError();
106 if (!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
107 FORMAT_MESSAGE_IGNORE_INSERTS |
108 FORMAT_MESSAGE_MAX_WIDTH_MASK,
110 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
113 "dlopen()/dlsym() caused error %d", (
int)errCode);
126# define daemon(x, y) -1
127# define getloadavg(x, y) -1
130# define WIFEXITED(w) (((w) & 0xff) == 0)
131# define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
132# define WIFSTOPPED(w) (((w) & 0xff) == 0x7f)
133# define WEXITSTATUS(w) (((w) >> 8) & 0xff)
134# define WTERMSIG(w) ((w) & 0x7f)
139# define O_NONBLOCK 04000
const char * dlerror(void)