comparison anagram/support/port.h @ 0:13d2b8934445

Import AnaGram (near-)release tree into Mercurial.
author David A. Holland
date Sat, 22 Dec 2007 17:52:45 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 /*
2 * AnaGram, A System for Syntax Directed Programming
3 * Copyright 1993-2002 Parsifal Software. All Rights Reserved.
4 * Copyright 2006 David A. Holland. All rights reserved.
5 * See the file COPYING for license and usage terms.
6 *
7 * port.h - portability file
8 */
9
10 #ifndef PORT_H
11 #define PORT_H
12
13 /*
14 * OS issues
15 * (note that a bunch of file-related issues are handled in file.h)
16 */
17
18 #ifdef AG_ON_UNIX
19 #define stricmp strcasecmp
20 #define strnicmp strncasecmp
21 #define _MAX_PATH PATH_MAX
22
23 char *strlwr(char *string);
24 #endif
25
26 #ifdef AG_ON_WINDOWS
27 #define PATH_MAX _MAX_PATH
28 #endif
29
30 /*
31 * Compiler issues
32 */
33
34 #ifdef __GNUC__
35 #define PRINTFFY(a,b) __attribute__((__format__(__printf__, a, b)))
36 #else
37 #define PRINTFFY(a,b)
38 #endif
39
40 #ifdef __IBMCPP__
41 /* obsolete compiler, no snprintf */
42 int snprintf(char *, unsigned, const char *, ...) PRINTFFY(3,4);
43 #endif
44
45 /* this is some kind of function pointer weirdness, maybe dll-related */
46 #ifdef __IBMCPP__
47 #define OPTLINK _Optlink
48 #else
49 #define OPTLINK
50 #endif
51
52 /*
53 * Nothing currently supported has a useful way to check for stack
54 * overflow.
55 */
56
57 //#define check_stack if (stackavail() < 0x100) bad_stack();
58 #define check_stack
59
60 /*
61 * these are used by dict.cpp, stk.cpp, and tsd.cpp and it's not at all
62 * clear why they're here, or where they should go. (XXX)
63 */
64
65 #define MAX_BYTES 10000000U
66 #define MAX_INTS 10000000U
67
68 #endif /* PORT_H */