source: trunk/src/win32k/clfix.c@ 4292

Last change on this file since 4292 was 4292, checked in by bird, 25 years ago

New fix for the 16-bit C compiler (M$C 6.0a).

File size: 2.4 KB
Line 
1/* $Id: clfix.c,v 1.1 2000-09-21 15:37:09 bird Exp $
2 *
3 * A wrapper program for cl.exe fix will try fix some of the problems
4 * we have seen.
5 *
6 * syntax: clfix.exe <cl> [cl arguments]
7 *
8 * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
9 *
10 * Project Odin Software License can be found in LICENSE.TXT
11 *
12 */
13
14/*******************************************************************************
15* Defined Constants And Macros *
16*******************************************************************************/
17#define INCL_BASE
18
19/*******************************************************************************
20* Header Files *
21*******************************************************************************/
22#include <os2.h>
23#include <string.h>
24
25
26
27int main(int argc, char **argv)
28{
29 static char szArgBuffer[32768];
30 RESULTCODES resc;
31 int argi;
32 char * psz;
33
34 /*
35 * Check that we have cl.exe at least passed in.
36 */
37 if (argc < 2)
38 {
39 PSZ psz =
40 "A wrapper program for cl.exe fix will try fix some of the problems\r\n"
41 "we have seen.\r\n"
42 "\r\n"
43 " syntax: clfix.exe <drive:fullpath\\cl.exe> [cl arguments]\r\n";
44 ULONG cch = strlen(psz);
45 DosWrite(0, psz, cch, &cch);
46 return -1;
47 }
48
49
50 /*
51 * First argument
52 */
53 psz = strcpy(szArgBuffer, argv[1]);
54 psz += strlen(psz);
55 psz++;
56
57
58 /* The other arguments. */
59 if (argc > 2)
60 {
61 argi = 2;
62 while (argi < argc)
63 {
64 strcpy(psz, argv[argi]);
65 psz += strlen(psz);
66 *psz++ = ' ';
67 argi++;
68 }
69 psz[-1] = '\0';
70 }
71 *psz = '\0';
72
73
74 /*
75 * Set max filehandles (is this inherited?)
76 */
77 DosSetMaxFH(100);
78
79
80 /*
81 * Execute argument without any environment.
82 * Some of the internal errors which has occured might be caused by long variables or
83 * generally a big environment block. We'll send in an empty environment block and hope
84 * this will solve the problems.
85 */
86 if (DosExecPgm(NULL, 0, EXEC_SYNC, szArgBuffer, "\0\0", &resc, szArgBuffer) != NO_ERROR)
87 {
88 /*complain*/
89 return -1;
90 }
91
92
93 /*
94 * return result code from cl.exe.
95 */
96 return resc.codeResult;
97}
98
Note: See TracBrowser for help on using the repository browser.