forked from xmlee/TDB-program
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlatform.h
More file actions
45 lines (34 loc) · 1003 Bytes
/
Platform.h
File metadata and controls
45 lines (34 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __PLATFORM_H__
#define __PLATFORM_H__
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) || defined(_WINDOWS)
#define __PLATFORM_WINDOWS__
#else
#define __PLATFORM_LINUX__
#endif
#ifdef __PLATFORM_LINUX__
#include <sys/syscall.h>
#define gettid() syscall(__NR_gettid)
#include <sys/time.h>
#include <stdio.h>
void Sleep(long long nMiniSecods);
#define strtok_s strtok_r
#define stricmp strcasecmp
#define strnicmp strncasecmp
#define _snprintf snprintf
#define _snprintf_s(szBuf, len1, len2, ...) _snprintf(szBuf, len1, __VA_ARGS__)
#define __int64 long long
#define GetCurrentThreadId gettid
#define vsnprintf_s(szBuf, len1, len2, ...) vsnprintf(szBuf, len1, __VA_ARGS__)
#define DebugPrint
typedef struct __tagGUID
{
char val[16];
}GUID;
#else
#include <Guiddef.h>
void gettimeofday(struct timeval* pTime);
#endif
struct timespec;
void gettimeofday_spec(struct timespec* pTime);
int get_uniq_id();
#endif