Rev 1 | Rev 5 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 2 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | */ |
12 | */ |
13 | 13 | ||
14 | #ifndef _SYSTEM_H |
14 | #ifndef _SYSTEM_H |
15 | #define _SYSTEM_H |
15 | #define _SYSTEM_H |
16 | 16 | ||
- | 17 | #ifdef WIN32 |
|
17 | /* there are true at least on x86 platforms */ |
18 | /* there are true at least on x86 platforms */ |
18 | typedef unsigned char U8; // 8 bits unsigned |
19 | typedef unsigned char U8; // 8 bits unsigned |
19 | typedef unsigned short U16; // 16 bits unsigned |
20 | typedef unsigned short U16; // 16 bits unsigned |
20 | typedef unsigned long U32; // 32 bits unsigned |
21 | typedef unsigned long U32; // 32 bits unsigned |
21 | typedef signed char S8; // 8 bits signed |
22 | typedef signed char S8; // 8 bits signed |
22 | typedef signed short S16; // 16 bits signed |
23 | typedef signed short S16; // 16 bits signed |
23 | typedef signed long S32; // 32 bits signed |
24 | typedef signed long S32; // 32 bits signed |
- | 25 | #else // !WIN32 |
|
- | 26 | #include <stdint.h> |
|
- | 27 | typedef uint8_t U8; |
|
- | 28 | typedef uint16_t U16; |
|
- | 29 | typedef uint32_t U32; |
|
- | 30 | typedef int8_t S8; |
|
- | 31 | typedef int16_t S16; |
|
- | 32 | typedef int32_t S32; |
|
- | 33 | #define strcpy_s(dest,size,source) strcpy (dest, source) |
|
- | 34 | #define strcat_s(dest,size,source) strcat (dest, source) |
|
- | 35 | #define sprintf_s(dest,size,format,...) sprintf (dest, format, __VA_ARGS__) |
|
- | 36 | #define strncpy_s(dest,size,source,count) strncpy (dest, source, count) |
|
- | 37 | #define vsprintf_s(buffer,maxsize,format,...) vsprintf(buffer,format, ##__VA_ARGS__) |
|
- | 38 | #define fopen_s(fp,filename,mode) *(fp) = fopen (filename, mode) |
|
- | 39 | #endif // WIN32 |
|
24 | 40 | ||
25 | /* this must be after typedefs because it relies on types defined above */ |
41 | /* this must be after typedefs because it relies on types defined above */ |
26 | #include "rects.h" |
42 | #include "rects.h" |
27 | #include "img.h" |
43 | #include "img.h" |
28 | 44 | ||
29 | /* |
45 | /* |
30 | * main section |
46 | * main section |
31 | */ |
47 | */ |
32 | extern void sys_init (int, char **); |
48 | extern void sys_init (int, char **); |
33 | extern void sys_shutdown (void); |
49 | extern void sys_shutdown (void); |
- | 50 | extern char *sys_getbasepath (void); |
|
34 | extern void sys_panic (char *, ...); |
51 | extern void sys_panic (char *, ...); |
35 | extern void sys_printf (char *, ...); |
52 | extern void sys_printf (char *, ...); |
36 | extern U32 sys_gettime (void); |
53 | extern U32 sys_gettime (void); |
37 | extern void sys_sleep (int); |
54 | extern void sys_sleep (int); |
38 | 55 |