CPPMyth
Library to interoperate with MythTV server
os-types.h
1
#pragma once
2
3
#if !defined(__WINDOWS__)
4
#define __WINDOWS__
5
#endif
6
7
/* Enable LEAN_AND_MEAN support */
8
#define WIN32_LEAN_AND_MEAN
9
10
/* Don't define min() and max() to prevent a clash with std::min() and std::max */
11
#ifndef NOMINMAX
12
#define NOMINMAX
13
#endif
14
15
/* Disable warning C4005: '_WINSOCKAPI_' : macro redefinition */
16
#pragma warning(disable:4005)
17
#include <WinSock2.h>
18
#pragma warning(default:4005)
19
#include <Windows.h>
20
#include <wchar.h>
21
#include <time.h>
22
#include <sys/timeb.h>
23
#include <io.h>
24
#include <stdlib.h>
25
#include <errno.h>
26
#include <stddef.h>
27
#include <stdint.h>
28
#ifndef __STDC_FORMAT_MACROS
29
#define __STDC_FORMAT_MACROS
30
#endif
31
32
/* prevent inclusion of wingdi.h */
33
#define NOGDI
34
35
typedef
SOCKET net_socket_t;
36
#define INVALID_SOCKET_VALUE INVALID_SOCKET
37
38
/* OS dependent path separator */
39
#ifndef PATH_SEPARATOR_CHAR
40
#define PATH_SEPARATOR_CHAR '\\'
41
#define PATH_SEPARATOR_STRING "\\"
42
#endif
43
44
#ifndef _SSIZE_T_DEFINED
45
#ifdef _WIN64
46
typedef
__int64 ssize_t;
47
#else
48
typedef
_W64
int
ssize_t;
49
#endif
50
#define _SSIZE_T_DEFINED
51
#endif
52
53
__inline
int
usleep(
unsigned
int
usec)
54
{
55
Sleep((DWORD)(usec / 1000));
56
return
0;
57
}
58
59
__inline
unsigned
int
sleep(
unsigned
int
sec)
60
{
61
Sleep((DWORD)(sec * 1000));
62
return
0;
63
}
64
65
/* Using MS Visual C++ compilers */
66
#if defined(_MSC_VER)
67
68
#if (_MSC_VER < 1800)
69
#include "msc_inttypes.h"
70
#else
71
#include <inttypes.h>
72
#endif
73
74
struct
timezone
75
{
76
int
tz_minuteswest;
77
int
tz_dsttime;
78
};
79
80
/* String to 64-bit int */
81
#if (_MSC_VER < 1800)
82
#define atoll(S) _atoi64(S)
83
#endif
84
85
/* Prevent deprecation warnings */
86
#if (_MSC_VER < 1900)
87
#define snprintf _snprintf
88
#endif
89
90
#define strnicmp _strnicmp
91
92
#else
93
#include <inttypes.h>
94
#endif
/* _MSC_VER */
cppmyth
src
private
os
windows
os-types.h
Generated on Thu Jan 9 2020 15:17:59 for CPPMyth by
1.8.13