blob: 17f876c7cc5718730eb32f53b3abf83312b92f1c [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001/* vi:set ts=8 sts=4 sw=4:
2 *
3 * VIM - Vi IMproved by Bram Moolenaar
4 *
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 */
8
9/*
10 * Win16 (Windows 3.1x) machine-dependent things.
11 */
12
13#include "os_dos.h" /* common MS-DOS and Windows stuff */
14
15#define BINARY_FILE_IO
16#define USE_EXE_NAME /* use argv[0] for $VIM */
Bram Moolenaar071d4272004-06-13 20:20:40 +000017#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 */
Bram Moolenaar8c8de832008-06-24 22:58:06 +000030#define HAVE_MATH_H
Bram Moolenaar071d4272004-06-13 20:20:40 +000031//#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
39
40#define SHORT_FNAME /* always 8.3 file name */
41
42#define SMALL_MALLOC /* 16 bit storage allocation */
43
44#ifdef __BORLANDC__
45# define HAVE_PUTENV /* at least Bcc 5.2 has it */
46#endif
47
48#ifdef FEAT_GUI_W16
49# define NO_CONSOLE /* don't included console-only code */
50#endif
51
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
55
56#define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
57
58#ifndef SIZEOF_INT
59# define SIZEOF_INT 2
60#endif
61
62typedef long off_t;
63
64#include <stdlib.h>
65#include <time.h>
66#include <dos.h>
67#include <dir.h>
68
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>
76
77/*
78 * plenty of memory, use large buffers
79 */
80#define CMDBUFFSIZE 1024 /* size of the command processing buffer */
81
82
83#define BASENAMELEN (MAXPATHL-5) /* length of base of file name */
84
85#ifndef DFLT_MAXMEM
86# define DFLT_MAXMEM (256) /* use up to 256K for a buffer*/
87#endif
88
89#ifndef DFLT_MAXMEMTOT
90# define DFLT_MAXMEMTOT (5*1024) /* use up to 5 Mbyte for Vim */
91#endif
92
93/*
94 * Some simple debugging macros that look and behave a lot like their
95 * namesakes in MFC.
96 */
97
98#ifdef _DEBUG
99
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
108
Bram Moolenaar071d4272004-06-13 20:20:40 +0000109# 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)
114
115/* In debug version, writes trace messages to debug stream */
116void __cdecl
117Trace(char *pszFormat, ...);
118
119#else /* !_DEBUG */
120
121 /* These macros should all compile away to nothing */
122# define ASSERT(f) ((void)0)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000123# 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)
128
129#endif /* !_DEBUG */
130
131
132#define ASSERT_POINTER(p, type) \
133 ASSERT(((p) != NULL) && IsValidAddress((p), sizeof(type), FALSE))
134
135#define ASSERT_NULL_OR_POINTER(p, type) \
136 ASSERT(((p) == NULL) || IsValidAddress((p), sizeof(type), FALSE))
137
138#define mch_setenv(name, val, x) setenv(name, val, x)