]>
Commit | Line | Data |
---|---|---|
1 | #ifndef _CONFIG_H | |
2 | #define _CONFIG_H | |
3 | ||
4 | # if !defined(WINDOWS) && !defined(WIN32_SYSTEM) | |
5 | # define _UNIX_ | |
6 | ||
7 | # include <stdlib.h> | |
8 | # include <sys/types.h> | |
9 | ||
10 | # define MEM_ALLOC(size) (malloc((size_t)(size))) | |
11 | # define MEM_FREE(ptr) {if(ptr) free(ptr);} | |
12 | ||
13 | # define STRCPY(t, s) (strcpy((char*)(t), (char*)(s))) | |
14 | # define STRNCPY(t,s,n) (strncpy((char*)(t), (char*)(s), (size_t)(n))) | |
15 | # define STRCAT(t, s) (strcat((char*)(t), (char*)(s))) | |
16 | # define STRNCAT(t,s,n) (strncat((char*)(t), (char*)(s), (size_t)(n))) | |
17 | # define STREQ(a, b) (strcmp((char*)(a), (char*)(b)) == 0) | |
18 | # define STRLEN(str) ((str)? strlen((char*)(str)):0) | |
19 | ||
20 | # define EXPORT | |
21 | # define CALLBACK | |
22 | # define FAR | |
23 | ||
24 | typedef signed short SSHOR; | |
25 | typedef short WORD; | |
26 | typedef long DWORD; | |
27 | ||
28 | typedef WORD WPARAM; | |
29 | typedef DWORD LPARAM; | |
30 | typedef void* HWND; | |
31 | typedef int BOOL; | |
32 | ||
33 | # endif /* _UNIX_ */ | |
34 | ||
35 | # if defined(WINDOWS) || defined(WIN32_SYSTEM) | |
36 | ||
37 | # include <windows.h> | |
38 | # include <windowsx.h> | |
39 | ||
40 | # ifdef _MSVC_ | |
41 | # define MEM_ALLOC(size) (fmalloc((size_t)(size))) | |
42 | # define MEM_FREE(ptr) ((ptr)? ffree((PTR)(ptr)):0)) | |
43 | # define STRCPY(t, s) (fstrcpy((char FAR*)(t), (char FAR*)(s))) | |
44 | # define STRNCPY(t,s,n) (fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n))) | |
45 | # define STRLEN(str) ((str)? fstrlen((char FAR*)(str)):0) | |
46 | # define STREQ(a, b) (fstrcmp((char FAR*)(a), (char FAR*)(b) == 0) | |
47 | # endif | |
48 | ||
49 | # ifdef _BORLAND_ | |
50 | # define MEM_ALLOC(size) (farmalloc((unsigned long)(size)) | |
51 | # define MEM_FREE(ptr) ((ptr)? farfree((void far*)(ptr)):0) | |
52 | # define STRCPY(t, s) (_fstrcpy((char FAR*)(t), (char FAR*)(s))) | |
53 | # define STRNCPY(t,s,n) (_fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n))) | |
54 | # define STRLEN(str) ((str)? _fstrlen((char FAR*)(str)):0) | |
55 | # define STREQ(a, b) (_fstrcmp((char FAR*)(a), (char FAR*)(b) == 0) | |
56 | # endif | |
57 | ||
58 | # endif /* WINDOWS */ | |
59 | ||
60 | # define SYSERR (-1) | |
61 | ||
62 | # ifndef NULL | |
63 | # define NULL ((void FAR*)0UL) | |
64 | # endif | |
65 | ||
66 | #endif |