Rev 1805 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1805 | Rev 5123 | ||
---|---|---|---|
1 | #ifndef _HEADER_SYSTEM_PROCESS_H |
1 | #ifndef _HEADER_SYSTEM_PROCESS_H |
2 | #define _HEADER_SYSTEM_PROCESS_H |
2 | #define _HEADER_SYSTEM_PROCESS_H |
3 | - | ||
4 | #ifndef __MENUET__ |
3 | |
5 | #include |
4 | #include |
6 | #include |
- | |
- | 5 | #include |
|
- | 6 | ||
- | 7 | #if defined _KOLIBRI |
|
- | 8 | # define DIR_SEPARATOR ('/') |
|
- | 9 | inline long GetProcessId() {return 0;} |
|
- | 10 | inline long DuplicateProcess() {return -1;} |
|
7 | #endif |
11 | inline int random(int m) {return ((unsigned long)rand()) % m;} |
8 | 12 | inline void randomize() {srand(__menuet__getsystemclock());} |
|
9 | #if defined __GNUC__ |
13 | #elif defined __GNUC__ |
10 | # include |
14 | # include |
11 | # define DIR_SEPARATOR ('/') |
15 | # define DIR_SEPARATOR ('/') |
12 | inline long GetProcessId() {return (long)getpid();} |
16 | inline long GetProcessId() {return (long)getpid();} |
13 | inline long DuplicateProcess() {return (long)fork();} |
17 | inline long DuplicateProcess() {return (long)fork();} |
14 | inline int random(int m) {return ((unsigned long)rand()) % m;} |
18 | inline int random(int m) {return ((unsigned long)rand()) % m;} |
15 | inline void randomize() {srand(time(0));} |
19 | inline void randomize() {srand(time(0));} |
16 | #elif defined __TURBOC__ && !defined __MENUET__ |
20 | #elif defined __TURBOC__ |
17 | # include |
21 | # include |
18 | # define DIR_SEPARATOR ('\\') |
22 | # define DIR_SEPARATOR ('\\') |
19 | inline long GetProcessId() {return (long)getpid();} |
23 | inline long GetProcessId() {return (long)getpid();} |
20 | inline long DuplicateProcess() {return -1;} |
24 | inline long DuplicateProcess() {return -1;} |
21 | #else |
25 | #else |
22 | # define DIR_SEPARATOR ('\\') |
26 | # define DIR_SEPARATOR ('\\') |
23 | inline long GetProcessId() {return 0;} |
27 | inline long GetProcessId() {return 0;} |
24 | inline long DuplicateProcess() {return -1;} |
28 | inline long DuplicateProcess() {return -1;} |
25 | #endif |
29 | #endif |
26 | 30 | ||
27 | #endif //_HEADER_SYSTEM_PROCESS_H |
31 | #endif //_HEADER_SYSTEM_PROCESS_H |