MythTV  master
Classes | Macros | Typedefs | Functions
compat.h File Reference
#include <cstdio>
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <cstdlib>
#include <ctime>
#include <sys/time.h>
#include <sys/types.h>
#include <QtGlobal>
#include <QRandomGenerator>
#include <sys/param.h>
#include "mythconfig.h"
Include dependency graph for compat.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  statfs
 

Macros

#define close   wsock_close
 
#define NOMINMAX
 
#define fsync(FD)   0
 
#define minor(X)   0
 
#define setenv(x, y, z)   ::SetEnvironmentVariableA(x, y)
 
#define unsetenv(x)   0
 
#define lstat   stat
 
#define nice(x)
 
#define PRIO_PROCESS   0
 
#define setpriority(x, y, z)   ((x) == PRIO_PROCESS && y == 0 ? nice(z) : -1)
 
#define SIGHUP   1
 
#define SIGQUIT   3
 
#define SIGKILL   9
 
#define SIGUSR1   10
 
#define SIGUSR2   12
 
#define SIGPIPE   13
 
#define SIGALRM   14
 
#define SIGCONT   18
 
#define SIGSTOP   19
 
#define S_IRGRP   0
 
#define S_IROTH   0
 
#define O_SYNC   0
 
#define mkfifo(path, mode)
 
#define RTLD_LAZY   0
 
#define dlopen(x, y)   LoadLibraryA((x))
 
#define dlclose(x)   !FreeLibrary((HMODULE)(x))
 
#define dlsym(x, y)   GetProcAddress((HMODULE)(x), (y))
 
#define DLERR_MAX   512
 
#define getuid()   0
 
#define geteuid()   0
 
#define setuid(x)   0
 
#define seteuid(x)   0
 
#define timeradd(a, b, result)
 
#define timersub(a, b, result)
 
#define daemon(x, y)   -1
 
#define getloadavg(x, y)   -1
 
#define WIFEXITED(w)   (((w) & 0xff) == 0)
 
#define WIFSIGNALED(w)   (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
 
#define WIFSTOPPED(w)   (((w) & 0xff) == 0x7f)
 
#define WEXITSTATUS(w)   (((w) >> 8) & 0xff)
 
#define WTERMSIG(w)   ((w) & 0x7f)
 
#define fseeko(stream, offset, whence)   fseeko64(stream, offset, whence)
 
#define ftello(stream)   ftello64(stream)
 
#define PREFIX64   "I64"
 
#define LZO_COMPILE_TIME_ASSERT_HEADER(a)
 
#define LZO_COMPILE_TIME_ASSERT(a)
 

Typedefs

typedef unsigned int uint
 
typedef long suseconds_t
 

Functions

static void srandom (unsigned int)
 
static long int random (void)
 
unsigned sleep (unsigned int x)
 
int statfs (const char *path, struct statfs *buffer)
 
const char * dlerror (void)
 
static __inline struct tm * gmtime_r (const time_t *timep, struct tm *result)
 
static __inline struct tm * localtime_r (const time_t *timep, struct tm *result)
 

Macro Definition Documentation

◆ close

#define close   wsock_close

Definition at line 16 of file compat.h.

◆ NOMINMAX

#define NOMINMAX

Definition at line 20 of file compat.h.

◆ fsync

#define fsync (   FD)    0

Definition at line 136 of file compat.h.

◆ minor

#define minor (   X)    0

Definition at line 138 of file compat.h.

◆ setenv

#define setenv (   x,
  y,
 
)    ::SetEnvironmentVariableA(x, y)

Definition at line 156 of file compat.h.

◆ unsetenv

#define unsetenv (   x)    0

Definition at line 157 of file compat.h.

◆ lstat

#define lstat   stat

Definition at line 194 of file compat.h.

◆ nice

#define nice (   x)
Value:
((int)!::SetPriorityClass(\
::GetCurrentProcess(), ((x) < -10) ? \
HIGH_PRIORITY_CLASS : (((x) < 0) ? \
ABOVE_NORMAL_PRIORITY_CLASS : (((x) > 10) ? \
IDLE_PRIORITY_CLASS : (((x) > 0) ? \
BELOW_NORMAL_PRIORITY_CLASS : \
NORMAL_PRIORITY_CLASS)))))

Definition at line 195 of file compat.h.

◆ PRIO_PROCESS

#define PRIO_PROCESS   0

Definition at line 202 of file compat.h.

◆ setpriority

#define setpriority (   x,
  y,
 
)    ((x) == PRIO_PROCESS && y == 0 ? nice(z) : -1)

Definition at line 203 of file compat.h.

◆ SIGHUP

#define SIGHUP   1

Definition at line 213 of file compat.h.

◆ SIGQUIT

#define SIGQUIT   3

Definition at line 214 of file compat.h.

◆ SIGKILL

#define SIGKILL   9

Definition at line 215 of file compat.h.

◆ SIGUSR1

#define SIGUSR1   10

Definition at line 216 of file compat.h.

◆ SIGUSR2

#define SIGUSR2   12

Definition at line 217 of file compat.h.

◆ SIGPIPE

#define SIGPIPE   13

Definition at line 218 of file compat.h.

◆ SIGALRM

#define SIGALRM   14

Definition at line 219 of file compat.h.

◆ SIGCONT

#define SIGCONT   18

Definition at line 220 of file compat.h.

◆ SIGSTOP

#define SIGSTOP   19

Definition at line 221 of file compat.h.

◆ S_IRGRP

#define S_IRGRP   0

Definition at line 223 of file compat.h.

◆ S_IROTH

#define S_IROTH   0

Definition at line 224 of file compat.h.

◆ O_SYNC

#define O_SYNC   0

Definition at line 225 of file compat.h.

◆ mkfifo

#define mkfifo (   path,
  mode 
)
Value:
(int)CreateNamedPipeA(path, PIPE_ACCESS_DUPLEX | WRITE_DAC, \
PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, \
1024, 1024, 10000, nullptr)

Definition at line 227 of file compat.h.

◆ RTLD_LAZY

#define RTLD_LAZY   0

Definition at line 232 of file compat.h.

◆ dlopen

#define dlopen (   x,
 
)    LoadLibraryA((x))

Definition at line 233 of file compat.h.

◆ dlclose

#define dlclose (   x)    !FreeLibrary((HMODULE)(x))

Definition at line 234 of file compat.h.

◆ dlsym

#define dlsym (   x,
 
)    GetProcAddress((HMODULE)(x), (y))

Definition at line 235 of file compat.h.

◆ DLERR_MAX

#define DLERR_MAX   512

◆ getuid

#define getuid ( )    0

Definition at line 260 of file compat.h.

◆ geteuid

#define geteuid ( )    0

Definition at line 261 of file compat.h.

◆ setuid

#define setuid (   x)    0

Definition at line 262 of file compat.h.

◆ seteuid

#define seteuid (   x)    0

Definition at line 263 of file compat.h.

◆ timeradd

#define timeradd (   a,
  b,
  result 
)
Value:
do { \
(result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
if ((result)->tv_usec >= 1000000) \
{ \
++(result)->tv_sec; \
(result)->tv_usec -= 1000000; \
} \
} while (0)
unsigned char b
Definition: ParseText.cpp:329

Definition at line 300 of file compat.h.

◆ timersub

#define timersub (   a,
  b,
  result 
)
Value:
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
if ((result)->tv_usec < 0) { \
--(result)->tv_sec; \
(result)->tv_usec += 1000000; \
} \
} while (0)
unsigned char b
Definition: ParseText.cpp:329

Definition at line 310 of file compat.h.

◆ daemon

#define daemon (   x,
 
)    -1

Definition at line 321 of file compat.h.

◆ getloadavg

#define getloadavg (   x,
 
)    -1

Definition at line 322 of file compat.h.

◆ WIFEXITED

#define WIFEXITED (   w)    (((w) & 0xff) == 0)

Definition at line 325 of file compat.h.

◆ WIFSIGNALED

#define WIFSIGNALED (   w)    (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))

Definition at line 326 of file compat.h.

◆ WIFSTOPPED

#define WIFSTOPPED (   w)    (((w) & 0xff) == 0x7f)

Definition at line 327 of file compat.h.

◆ WEXITSTATUS

#define WEXITSTATUS (   w)    (((w) >> 8) & 0xff)

Definition at line 328 of file compat.h.

◆ WTERMSIG

#define WTERMSIG (   w)    ((w) & 0x7f)

Definition at line 329 of file compat.h.

◆ fseeko

#define fseeko (   stream,
  offset,
  whence 
)    fseeko64(stream, offset, whence)

Definition at line 359 of file compat.h.

◆ ftello

#define ftello (   stream)    ftello64(stream)

Definition at line 360 of file compat.h.

◆ PREFIX64

#define PREFIX64   "I64"

Definition at line 393 of file compat.h.

◆ LZO_COMPILE_TIME_ASSERT_HEADER

#define LZO_COMPILE_TIME_ASSERT_HEADER (   a)

Definition at line 412 of file compat.h.

◆ LZO_COMPILE_TIME_ASSERT

#define LZO_COMPILE_TIME_ASSERT (   a)

Definition at line 418 of file compat.h.

Typedef Documentation

◆ uint

typedef unsigned int uint

Definition at line 140 of file compat.h.

◆ suseconds_t

typedef long suseconds_t

Definition at line 331 of file compat.h.

Function Documentation

◆ srandom()

static void srandom ( unsigned int  )
inlinestatic

Definition at line 148 of file compat.h.

Referenced by MythCoreContextPrivate::MythCoreContextPrivate().

◆ random()

static long int random ( void  )
inlinestatic

◆ sleep()

unsigned sleep ( unsigned int  x)
inline

◆ statfs()

int statfs ( const char *  path,
struct statfs buffer 
)
inline

◆ dlerror()

const char* dlerror ( void  )
inline

◆ gmtime_r()

static __inline struct tm* gmtime_r ( const time_t *  timep,
struct tm *  result 
)
static

Definition at line 269 of file compat.h.

Referenced by cCiDateTime::SendDateTime().

◆ localtime_r()

static __inline struct tm* localtime_r ( const time_t *  timep,
struct tm *  result 
)
static