kolibrios-fun/programs/games/checkers/trunk/sysproc.h
CleverMouse fbdccce9a4 * gcc flags: add -march=pentium-mmx -fno-rtti
* menuetlibc: fix printf, sprintf
* menuetlibc: alias clock() to sysfn 26.9.
  Not exactly what is required by POSIX, but better than zero
* autobuild games/checkers

git-svn-id: svn://kolibrios.org@5123 a494cfbc-eb01-0410-851d-a64ba20cac60
2014-09-15 09:42:01 +00:00

32 lines
1007 B
C

#ifndef _HEADER_SYSTEM_PROCESS_H
#define _HEADER_SYSTEM_PROCESS_H
#include <stdlib.h>
#include <time.h>
#if defined _KOLIBRI
# define DIR_SEPARATOR ('/')
inline long GetProcessId() {return 0;}
inline long DuplicateProcess() {return -1;}
inline int random(int m) {return ((unsigned long)rand()) % m;}
inline void randomize() {srand(__menuet__getsystemclock());}
#elif defined __GNUC__
# include <unistd.h>
# define DIR_SEPARATOR ('/')
inline long GetProcessId() {return (long)getpid();}
inline long DuplicateProcess() {return (long)fork();}
inline int random(int m) {return ((unsigned long)rand()) % m;}
inline void randomize() {srand(time(0));}
#elif defined __TURBOC__
# include <process.h>
# define DIR_SEPARATOR ('\\')
inline long GetProcessId() {return (long)getpid();}
inline long DuplicateProcess() {return -1;}
#else
# define DIR_SEPARATOR ('\\')
inline long GetProcessId() {return 0;}
inline long DuplicateProcess() {return -1;}
#endif
#endif //_HEADER_SYSTEM_PROCESS_H