Merge branch 'vim'
[MacVim.git] / src / os_win16.h
blob17f876c7cc5718730eb32f53b3abf83312b92f1c
1 /* vi:set ts=8 sts=4 sw=4:
3 * VIM - Vi IMproved by Bram Moolenaar
5 * Do ":help uganda" in Vim to read copying and usage conditions.
6 * Do ":help credits" in Vim to see a list of people who contributed.
7 */
9 /*
10 * Win16 (Windows 3.1x) machine-dependent things.
13 #include "os_dos.h" /* common MS-DOS and Windows stuff */
15 #define BINARY_FILE_IO
16 #define USE_EXE_NAME /* use argv[0] for $VIM */
17 #define SYNC_DUP_CLOSE /* sync() a file with dup() and close() */
18 #define USE_TERM_CONSOLE
19 #define HAVE_STRING_H
20 #define HAVE_STRCSPN
21 #define HAVE_STRICMP
22 #define HAVE_STRNICMP
23 #define HAVE_STRFTIME /* guessed */
24 #define HAVE_MEMSET
25 #define USE_TMPNAM /* use tmpnam() instead of mktemp() */
26 #define HAVE_LOCALE_H
27 #define HAVE_FCNTL_H
28 #define HAVE_QSORT
29 #define HAVE_ST_MODE /* have stat.st_mode */
30 #define HAVE_MATH_H
31 //#define USE_FNAME_CASE /* adjust case of file names */
32 #ifndef FEAT_CLIPBOARD
33 # define FEAT_CLIPBOARD /* include clipboard support */
34 #endif
35 #if defined(__DATE__) && defined(__TIME__)
36 # define HAVE_DATE_TIME
37 #endif
38 #define HAVE_AVAIL_MEM
40 #define SHORT_FNAME /* always 8.3 file name */
42 #define SMALL_MALLOC /* 16 bit storage allocation */
44 #ifdef __BORLANDC__
45 # define HAVE_PUTENV /* at least Bcc 5.2 has it */
46 #endif
48 #ifdef FEAT_GUI_W16
49 # define NO_CONSOLE /* don't included console-only code */
50 #endif
52 /* toupper() is not really broken, but it's very slow. Probably because of
53 * using unicde characters on Windows NT */
54 #define BROKEN_TOUPPER
56 #define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
58 #ifndef SIZEOF_INT
59 # define SIZEOF_INT 2
60 #endif
62 typedef long off_t;
64 #include <stdlib.h>
65 #include <time.h>
66 #include <dos.h>
67 #include <dir.h>
69 #ifndef STRICT
70 # define STRICT
71 #endif
72 #ifndef COBJMACROS
73 # define COBJMACROS /* For OLE: Enable "friendlier" access to objects */
74 #endif
75 #include <windows.h>
78 * plenty of memory, use large buffers
80 #define CMDBUFFSIZE 1024 /* size of the command processing buffer */
83 #define BASENAMELEN (MAXPATHL-5) /* length of base of file name */
85 #ifndef DFLT_MAXMEM
86 # define DFLT_MAXMEM (256) /* use up to 256K for a buffer*/
87 #endif
89 #ifndef DFLT_MAXMEMTOT
90 # define DFLT_MAXMEMTOT (5*1024) /* use up to 5 Mbyte for Vim */
91 #endif
94 * Some simple debugging macros that look and behave a lot like their
95 * namesakes in MFC.
98 #ifdef _DEBUG
100 # if defined(_MSC_VER) && (_MSC_VER >= 1000)
101 /* Use the new debugging tools in Visual C++ 4.x */
102 # include <crtdbg.h>
103 # define ASSERT(f) _ASSERT(f)
104 # else
105 # include <assert.h>
106 # define ASSERT(f) assert(f)
107 # endif
109 # define TRACE Trace
110 # define TRACE0(sz) Trace(_T("%s"), _T(sz))
111 # define TRACE1(sz, p1) Trace(_T(sz), p1)
112 # define TRACE2(sz, p1, p2) Trace(_T(sz), p1, p2)
113 # define TRACE3(sz, p1, p2, p3) Trace(_T(sz), p1, p2, p3)
115 /* In debug version, writes trace messages to debug stream */
116 void __cdecl
117 Trace(char *pszFormat, ...);
119 #else /* !_DEBUG */
121 /* These macros should all compile away to nothing */
122 # define ASSERT(f) ((void)0)
123 # define TRACE 1 ? (void)0 : printf
124 # define TRACE0(sz)
125 # define TRACE1(sz, p1)
126 # define TRACE2(sz, p1, p2)
127 # define TRACE3(sz, p1, p2, p3)
129 #endif /* !_DEBUG */
132 #define ASSERT_POINTER(p, type) \
133 ASSERT(((p) != NULL) && IsValidAddress((p), sizeof(type), FALSE))
135 #define ASSERT_NULL_OR_POINTER(p, type) \
136 ASSERT(((p) == NULL) || IsValidAddress((p), sizeof(type), FALSE))
138 #define mch_setenv(name, val, x) setenv(name, val, x)