-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathstdafx.h
82 lines (63 loc) · 2.27 KB
/
stdafx.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
#include <Windows.h>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <iomanip>
#include <algorithm>
#include <functional>
#include "ApiStatistics.h"
#include "Timer.h"
#include "ApiFunctors/ApiFunction.h"
#include "TestUnit/TestLog.h"
#include "TestUnit/TestUtility.h"
#include "ApiFunctors/FileManagement/ApiDeleteFile.h"
#include <assert.h>
/*
When the compiler sees a line like this:
chMSG(Fix this later);
it outputs a line like this:
c:\CD\CmnHdr.h(82):Fix this later
You can easily jump directly to this line and examine the surrounding code.
*/
#define chSTR2(x) #x
#define chSTR(x) chSTR2(x)
#define chMSG(desc) message(__FILE__ "(" chSTR(__LINE__) "): --------" #desc "--------")
#define chFixLater message(__FILE__ "(" chSTR(__LINE__) "): --------Fix this later--------")
#define FixLater \
do { \
__pragma(chFixLater) \
__pragma (warning(push)) \
__pragma (warning(disable:4127)) \
} while(0) \
__pragma (warning(pop))
#define MSG(desc) \
do { \
__pragma(chMSG(desc)) \
__pragma (warning(push)) \
__pragma (warning(disable:4127)) \
} while(0) \
__pragma (warning(pop))
///////////////////////////// chBEGINTHREADEX Macro ///////////////////////////
// This macro function calls the C runtime's _beginthreadex function.
// The C runtime library doesn't want to have any reliance on Windows' data
// types such as HANDLE. This means that a Windows programmer needs to cast
// values when using _beginthreadex. Since this is terribly inconvenient,
// I created this macro to perform the casting.
typedef unsigned (__stdcall *PTHREAD_START) (void *);
#define chBEGINTHREADEX(psa, cbStackSize, pfnStartAddr, \
pvParam, dwCreateFlags, pdwThreadId) \
((HANDLE)_beginthreadex( \
(void *) (psa), \
(unsigned) (cbStackSize), \
(PTHREAD_START) (pfnStartAddr), \
(void *) (pvParam), \
(unsigned) (dwCreateFlags), \
(unsigned *) (pdwThreadId)))