annotate src/s/sunos4-0.h @ 315:5e87bc5b1ee4

Added tag r21-0b55 for changeset 341dac730539
author cvs
date Mon, 13 Aug 2007 10:44:26 +0200
parents 83b3d10dcba9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Synched up with: FSF 19.31. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 /* For building XEmacs under SunOS 4.1.* with static libraries. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 #ifndef _S_SUNOS4_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 #define _S_SUNOS4_H_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 #include "bsd4-2.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 #ifndef SUNOS4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 #define SUNOS4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 #if 0 /* This may have been needed for an earlier version of Sun OS 4.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 It seems to cause warnings in 4.0.3 and 4.1. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 #define O_NDELAY FNDELAY /* Non-blocking I/O (4.2 style) */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 #ifdef NOT_C_CODE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 /* The new sunOS unexec eliminates the need for a custom crt0.o, so we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 can just let the compiler invoke the linker and don't have to guess
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 what options it might have passed it. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 # define ORDINARY_LINK
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 # define START_FILES
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 # define LD_CMD $(CC)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 # ifndef LD_SWITCH_SYSTEM
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
27 # define LD_SWITCH_SYSTEM "-Bstatic"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 # endif
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 155
diff changeset
29 # define UNEXEC "unexsunos4.o"
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
30 #endif /* NOT_C_CODE */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #define RUN_TIME_REMAP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 /* these don't matter, but we have to define something to keep
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 sysdep.c from introducing bogus symbols */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #define TEXT_START 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #define DATA_START 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 /* #### XEmacs: #define of SYSTEM_MALLOC removed. Is this OK? FSF says:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 In SunOS 4.1, a static function called by tzsetwall reportedly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 clears the byte just past an eight byte region it mallocs, corrupting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 GNU malloc's memory pool. But Sun's malloc doesn't seem to mind. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 /* XEmacs: additions for proper prototyping. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 #ifndef NOT_C_CODE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 #ifdef __STDC__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 /* Sun's headers are categorically losing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 Mly uses broken-sun.h to get the protos for this, but lcc provides all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 of the prototypes for the ANSI routines. So I'm just going to put the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 protos of the non-ANSI routines that we use here (I guess that would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 be things that are Posix but not ANSI?) You're in a maze of twisty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 little standards, all alike...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 /* Since lcc is not going to be heavily used anymore if it ever was, I'm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 putting broken-sun.h back in. */
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
57 /* Since Gcc 2.8 appears to have fixed the problem, I'm conditionalizing */
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
58 /* this ugly hack. */
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
59
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
60 #if defined (__GNUC__)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
61 #if defined (__GNUC_MINOR__)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
62 #if ((__GNUC__ == 2) && (__GNUC_MINOR__ > 7)) || ((__GNUC__ > 2))
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
63 /* Don't include for gcc 2.8.0*/
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
64 #else
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 155
diff changeset
65 #include "../broken-sun.h"
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
66 #endif
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
67
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
68 #else /* __GNUC_MINOR__ is undefined */
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
69 #include "../broken-sun.h"
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
70 #endif
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
71
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
72 #else
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
73 /* Not GNU C */
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
74 #endif
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 175
diff changeset
75
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 extern char *strdup ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 extern char *ttyname (int);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 extern void tzsetwall (void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 extern int getpagesize (void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
81 #include <memory.h>
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
82 #ifdef __SUNPRO_C
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
83 /* Suppress zillions of warnings from outdated SunOS4 prototypes */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 /* Bother! Sun can't even get the arg types right. */
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
85 #include <string.h>
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
86 #define memset(a,b,c) memset((char*) (a), b, c)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
87 #define memcpy(a,b,c) memcpy((char*) (a), (char*) (b), c)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
88 #define memcmp(a,b,c) memcmp((char*) (a), (char*) (b), c)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
89 #define memchr(a,b,c) memchr((char*) (a), b, c)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
90 void * __builtin_alloca(int);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
91 #ifdef HAVE_X_WINDOWS
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
92 #include <X11/Xlib.h>
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
93 #define XFree(p) XFree((char*)(p))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
94 #endif /* X Windows */
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
95 #endif /* __SUNPRO_C */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 #endif /* __STDC__ */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 # ifdef __GNUC__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 /* XEmacs addition: */
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
101 /* gcc has the bug that it claims to conform to the ANSI C standard
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (which is what setting __STDC__ to 1 means) but does not necessarily
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 provide all of the library routines which the standard requires of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 conforming compiler -- such as memmove. The other Sun ANSI compilers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (Sun's acc and Lucid's lcc) do not have this bug. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 # define memmove(to, from, size) bcopy ((char *) (from), (char *) (to), (size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 /* We must define mkdir with this arg prototype
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 to match GCC's fixed stat.h. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 # define MKDIR_PROTOTYPE \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 int mkdir (const char *dpath, unsigned short dmode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 # endif /* __GNUC__ */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
113 #endif /* C_CODE */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 #endif /* _S_SUNOS4_H_ */