1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
Our setup:
Sun 3/60 with cgfour
SunOS 4.0 (plus what Sun calls their "general hygiene" patch tape)
XV11R3 + MIT fixes 1 through 8 + "Purdue enhancements" + one local
"ANSIfication" fix (previously reported to MIT,
and attached below)
I installed gcc 1.34 (plus the expr.c fix) and also ran the "fixincludes"
script.
I built the X stuff with with the "CC" line in the "Sun.macros" file set to:
CC = gcc -fcombine-regs -fstrength-reduce -finline-functions -fpcc-struct-return -DPURDUE -Dinline=INLINE -DNOSTDHDRS
where -fcombine-regs, -fstrength-reduce, and -finline-functions
specify desired optimizations, -fpcc-struct-return makes things
compatible with the dbm library, -DPURDUE buys the Purdue speedups,
-Dinline=INLINE avoids a problem with a variable named "inline" in the
X file "fonts/bdftosnf/fontutil.c", and -DNOSTDHDRS avoids a problem
with multiple (and conflicting) typedef'ing of "size_t" in the
gcc-provided STDDEF_H and Sun's "sys/types.h".
Some clients may need -fwritable-strings. twm is said to need it.
The ANSIfication fix:
> From ado Mon Dec 26 10:55:28 1988
> To: xbugs@expo.lcs.mit.edu
> Subject: Xlibint and __STDC__ don't mix
>
>
> X Window System Bug Report
> xbugs@expo.lcs.mit.edu
>
>
>
>
> VERSION:
> R3
>
> CLIENT MACHINE and OPERATING SYSTEM:
> Sun 3/60 running SunOS 4.0
>
> DISPLAY:
> Sun CG4
>
> WINDOW MANAGER:
> uwm
>
> AREA:
> Xlib
>
> SYNOPSIS:
> Xlibint.h and __STDC__ don't mix
>
> DESCRIPTION:
> If __STDC__ is defined (and UNIXCPP is not defined),
> code that uses the GetReqExtra macro defined in Xlibint.h
> is uncompilable.
>
> REPEAT BY:
> Script started on Mon Dec 26 10:52:58 1988
> elsie$ cd lib/X
> elsie$ rm Xbackgnd.o
> rm: Xbackgnd.o: No such file or directory
> elsie$ rm XBackgnd.o
> elsie$ make XBackgnd.o CC=/usr/local/bin/gcc
> rm -f XBackgnd.o
> /usr/local/bin/gcc -c -O -I. -I../../. -I../.././X11 -DTCPCONN -DUNIXCONN XBackgnd.c
> XBackgnd.c: In function XSetWindowBackground:
> XBackgnd.c:16: undeclared variable `sz_' (first use here)
> *** Error code 1
> make: Fatal error: Command failed for target `XBackgnd.o'
> elsie$ exit
>
> script done on Mon Dec 26 10:53:51 1988
>
> SAMPLE FIX:
> *** 1.1/Xlibint.h Mon Dec 26 10:39:37 1988
> --- 1.2/Xlibint.h Mon Dec 26 10:39:37 1988
> ***************
> *** 122,133 ****
> #if defined(__STDC__) && !defined(UNIXCPP)
> #define GetReqExtra(name, n, req) \
> WORD64ALIGN\
> ! if ((dpy->bufptr + SIZEOF(*req) + n) > dpy->bufmax)\
> _XFlush(dpy);\
> req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
> req->reqType = X_##name;\
> ! req->length = (SIZEOF(*req) + n)>>2;\
> ! dpy->bufptr += SIZEOF(*req) + n;\
> dpy->request++
> #else
> #define GetReqExtra(name, n, req) \
> --- 122,133 ----
> #if defined(__STDC__) && !defined(UNIXCPP)
> #define GetReqExtra(name, n, req) \
> WORD64ALIGN\
> ! if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\
> _XFlush(dpy);\
> req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\
> req->reqType = X_##name;\
> ! req->length = (SIZEOF(x##name##Req) + n)>>2;\
> ! dpy->bufptr += SIZEOF(x##name##Req) + n;\
> dpy->request++
> #else
> #define GetReqExtra(name, n, req) \
> --
> Arthur David Olson ado@ncifcrf.gov ADO is a trademark of Ampex.
|