Database now runs on linux

This commit is contained in:
2022-03-05 19:59:39 +02:00
parent f4f90b2533
commit 90ef09c331
131 changed files with 467 additions and 446 deletions

View File

@ -1,41 +1,7 @@
#ifndef __INC_LIBTHECORE_FDWATCH_H__
#define __INC_LIBTHECORE_FDWATCH_H__
#ifndef __WIN32__
typedef struct fdwatch FDWATCH;
typedef struct fdwatch * LPFDWATCH;
enum EFdwatch
{
FDW_NONE = 0,
FDW_READ = 1,
FDW_WRITE = 2,
FDW_WRITE_ONESHOT = 4,
FDW_EOF = 8,
};
typedef struct kevent KEVENT;
typedef struct kevent * LPKEVENT;
typedef int KQUEUE;
struct fdwatch
{
KQUEUE kq;
int nfiles;
LPKEVENT kqevents;
int nkqevents;
LPKEVENT kqrevents;
int * fd_event_idx;
void ** fd_data;
int * fd_rw;
};
#else
#if defined(WIN32) || defined(__linux__)
typedef struct fdwatch FDWATCH;
typedef struct fdwatch * LPFDWATCH;
@ -68,6 +34,40 @@
int* fd_rw;
};
#else
typedef struct fdwatch FDWATCH;
typedef struct fdwatch* LPFDWATCH;
enum EFdwatch
{
FDW_NONE = 0,
FDW_READ = 1,
FDW_WRITE = 2,
FDW_WRITE_ONESHOT = 4,
FDW_EOF = 8,
};
typedef struct kevent KEVENT;
typedef struct kevent* LPKEVENT;
typedef int KQUEUE;
struct fdwatch
{
KQUEUE kq;
int nfiles;
LPKEVENT kqevents;
int nkqevents;
LPKEVENT kqrevents;
int* fd_event_idx;
void** fd_data;
int* fd_rw;
};
#endif // WIN32
#ifdef __cplusplus

View File

@ -47,7 +47,7 @@ struct timespec
// C runtime library adjustments
#define strlcat(dst, src, size) strcat_s(dst, size, src)
#define strlcpy(dst, src, size) strncpy_s(dst, size, src, _TRUNCATE)
#define strncpy(dst, src, size) strncpy_s(dst, size, src, _TRUNCATE)
#define strtoull(str, endptr, base) _strtoui64(str, endptr, base)
#define strtof(str, endptr) (float)strtod(str, endptr)
#define strcasecmp(s1, s2) stricmp(s1, s2)