-
Notifications
You must be signed in to change notification settings - Fork 2
/
platform.cpp
62 lines (53 loc) · 1.27 KB
/
platform.cpp
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
#include "platform.h"
#include <stdio.h>
/*!
* Set current thread to a lower priority
*/
void LOWPRIORITY()
{
#ifndef CYGWIN
sched_param param;
int policy, rc;
pthread_getschedparam(pthread_self(), &policy, ¶m);
param.sched_priority = 1;
rc = pthread_setschedparam(pthread_self(), policy, ¶m);
// printf("pthread_setschedparam(): %d\n", rc);
#endif
}
/*!
* Set current thread to a higher priority
*/
void HIGHPRIORITY()
{
#ifndef CYGWIN
sched_param param;
int policy, rc;
pthread_getschedparam(pthread_self(), &policy, ¶m);
param.sched_priority = 1;
policy = SCHED_FIFO;
rc = pthread_setschedparam(pthread_self(), policy, ¶m);
printf("HI pthread_setschedparam(): %d\n", rc);
#endif
}
#ifdef CYGWIN
int main(int argc, char* argv[]);
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,
LPSTR lpCmdLine,int CmdShow)
{
char *cmd[0] = {};
printf("Here!\n");
main(0, cmd);
exit(0);
return 0;
}
/* SDL depends on these two functions which are defined in MSVCRT.DLL,
which we are not linking to, so provide stubs here. We are not using
them anyways. */
unsigned long _beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *),
void*, unsigned, unsigned*)
{
}
void _endthreadex (unsigned)
{
}
#endif